Whamcloud - gitweb
LU-8633 llite: do not clear uptodate bit in page delete 27/22827/3
authorJinshan Xiong <jinshan.xiong@intel.com>
Thu, 29 Sep 2016 21:31:01 +0000 (14:31 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 28 Oct 2016 23:49:39 +0000 (23:49 +0000)
Otherwise, if the race between page fault and truncate occurs, it
will cause the page fault routine to return an EIO error.

In filemap_fault() {
    page_not_uptodate:
...
        ClearPageError(page);
        error = mapping->a_ops->readpage(file, page);
        if (!error) {
                wait_on_page_locked(page);
                if (!PageUptodate(page))
                        error = -EIO;
}
...
}

However, I tend to think this is a defect in kernel implementation,
because it assumes PageUptodate shouldn't be cleared but file read
routine doesn't make the same assumption.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: Ic4a919607a6121098e41eaf56b8ce3200f778ecf
Reviewed-on: http://review.whamcloud.com/22827
Tested-by: Maloo <hpdd-maloo@intel.com>
Tested-by: Jenkins
Reviewed-by: Li Dongyang <dongyang.li@anu.edu.au>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/vvp_page.c

index c530730..6d1c770 100644 (file)
@@ -167,7 +167,6 @@ static void vvp_page_delete(const struct lu_env *env,
        refc = atomic_dec_return(&page->cp_ref);
        LASSERTF(refc >= 1, "page = %p, refc = %d\n", page, refc);
 
-       ClearPageUptodate(vmpage);
        ClearPagePrivate(vmpage);
        vmpage->private = 0;
        /*