mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-02 01:37:17 -04:00
pNFS: Fix potential corruption of page being written
nfs_want_read_modify_write() didn't check for !PagePrivate when pNFS block or SCSI layout was in use, therefore we could lose data forever if the page being written was filled by a read before completion. Signed-off-by: Kazuo Ito <ito_kazuo_g3@lab.ntt.co.jp> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
committed by
Trond Myklebust
parent
bf211ca1a8
commit
97ae91bbf3
@@ -299,7 +299,7 @@ static int nfs_want_read_modify_write(struct file *file, struct page *page,
|
||||
unsigned int end = offset + len;
|
||||
|
||||
if (pnfs_ld_read_whole_page(file->f_mapping->host)) {
|
||||
if (!PageUptodate(page))
|
||||
if (!PageUptodate(page) && !PagePrivate(page))
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user