diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-03-03 00:06:35 -0500 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-03-03 13:58:08 -0500 |
commit | ef070dcb3989f553f5d84edf555eebc7e204099d (patch) | |
tree | 57a10c226e43b7eb28b03786591164686d88fbf5 /fs/nfs | |
parent | 874f946376de57c8d6230b30ad71f742883fee3a (diff) |
NFS: Don't write enable new pages while an invalidation is proceeding
nfs_vm_page_mkwrite() should wait until the page cache invalidation
is finished. This is the second patch in a 2 patch series to deprecate
the NFS client's reliance on nfs_release_page() in the context of
nfs_invalidate_mapping().
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/file.c | 3 | ||||
-rw-r--r-- | fs/nfs/inode.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 41963ffca597..e679d24c39d3 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -623,6 +623,9 @@ static int nfs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
623 | /* make sure the cache has finished storing the page */ | 623 | /* make sure the cache has finished storing the page */ |
624 | nfs_fscache_wait_on_page_write(NFS_I(inode), page); | 624 | nfs_fscache_wait_on_page_write(NFS_I(inode), page); |
625 | 625 | ||
626 | wait_on_bit_action(&NFS_I(inode)->flags, NFS_INO_INVALIDATING, | ||
627 | nfs_wait_bit_killable, TASK_KILLABLE); | ||
628 | |||
626 | lock_page(page); | 629 | lock_page(page); |
627 | mapping = page_file_mapping(page); | 630 | mapping = page_file_mapping(page); |
628 | if (mapping != inode->i_mapping) | 631 | if (mapping != inode->i_mapping) |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 8edb7d049565..d42dff6d5e98 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -1035,6 +1035,7 @@ static int nfs_invalidate_mapping(struct inode *inode, struct address_space *map | |||
1035 | 1035 | ||
1036 | if (mapping->nrpages != 0) { | 1036 | if (mapping->nrpages != 0) { |
1037 | if (S_ISREG(inode->i_mode)) { | 1037 | if (S_ISREG(inode->i_mode)) { |
1038 | unmap_mapping_range(mapping, 0, 0, 0); | ||
1038 | ret = nfs_sync_mapping(mapping); | 1039 | ret = nfs_sync_mapping(mapping); |
1039 | if (ret < 0) | 1040 | if (ret < 0) |
1040 | return ret; | 1041 | return ret; |