]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: Fix a regression in the read() syscall
authorTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 3 Mar 2015 04:32:08 +0000 (23:32 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 3 Mar 2015 18:02:29 +0000 (13:02 -0500)
commit094ca1a146149a6dfad127c1609db0e8eb004522
tree0fd166cc4798b50069d1120f822f094a60b7a9c2
parent8bc6312c9c958474b8f17838d3b9662b75b75d26
NFS: Fix a regression in the read() syscall

When invalidating the page cache for a regular file, we want to first
sync all dirty data to disk and then call invalidate_inode_pages2().
The latter relies on nfs_launder_page() and nfs_release_page() to deal
respectively with dirty pages, and unstable written pages.

When commit 5587fa4e0c427 ("NFS: avoid deadlocks with loop-back mounted
NFS filesystems.") changed the behaviour of nfs_release_page(), then it
made it possible for invalidate_inode_pages2() to fail with an EBUSY.
Unfortunately, that error is then propagated back to read().

Let's therefore work around the problem for now by protecting the call
to sync the data and invalidate_inode_pages2() so that they are atomic
w.r.t. the addition of new writes.
Later on, we can revisit whether or not we still need nfs_launder_page()
and nfs_release_page().

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/file.c
fs/nfs/inode.c
include/linux/nfs_fs.h