Skip to content

Commit 97ae91b

Browse files
Kazuo ItoTrond Myklebust
authored andcommitted
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>
1 parent bf211ca commit 97ae91b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ static int nfs_want_read_modify_write(struct file *file, struct page *page,
299299
unsigned int end = offset + len;
300300

301301
if (pnfs_ld_read_whole_page(file->f_mapping->host)) {
302-
if (!PageUptodate(page))
302+
if (!PageUptodate(page) && !PagePrivate(page))
303303
return 1;
304304
return 0;
305305
}

0 commit comments

Comments
 (0)