aboutsummaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorKazuo Ito <ito_kazuo_g3@lab.ntt.co.jp>2019-02-14 18:36:58 +0900
committerTrond Myklebust <trond.myklebust@hammerspace.com>2019-02-20 17:33:55 -0500
commit97ae91bbf3a70fc8cee3c9030564cfc892cc8cee (patch)
tree85286f5e9682492ed23368211ee078b17c40fac5 /fs/nfs
parentbf211ca1a84c570607137f4a556870ac034e318c (diff)
downloadlinux-stericsson-97ae91bbf3a70fc8cee3c9030564cfc892cc8cee.tar.gz
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>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index e4a33e66f417..7086d5677ed3 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -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;
}