提交 b9031262 编写于 作者: K Kazuo Ito 提交者: Xie XiuQi

pNFS: Fix potential corruption of page being written

mainline inclusion
from mainline-5.1-rc1
commit 97ae91bbf3a70fc8cee3c9030564cfc892cc8cee
category: bugfix
bugzilla: NA
CVE: NA

-------------------------------------------------

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: NKazuo Ito <ito_kazuo_g3@lab.ntt.co.jp>
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Nkoulihong <koulihong@huawei.com>
Reviewed-by: NMiao Xie <miaoxie@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 d597314e
...@@ -299,7 +299,7 @@ static int nfs_want_read_modify_write(struct file *file, struct page *page, ...@@ -299,7 +299,7 @@ static int nfs_want_read_modify_write(struct file *file, struct page *page,
unsigned int end = offset + len; unsigned int end = offset + len;
if (pnfs_ld_read_whole_page(file->f_mapping->host)) { if (pnfs_ld_read_whole_page(file->f_mapping->host)) {
if (!PageUptodate(page)) if (!PageUptodate(page) && !PagePrivate(page))
return 1; return 1;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册