diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-03-25 16:40:07 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@primarydata.com> | 2015-03-27 12:39:39 -0400 |
commit | 8c18d76bcba874e872410ca63c7e59b10aafa17d (patch) | |
tree | 4c33a178b6661ca365864219c468451ac6199c63 | |
parent | 5bb89b4702e22981445ae01af733a57d1cae2018 (diff) |
NFS: Block new writes while syncing data in nfs_getattr()
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
-rw-r--r-- | fs/nfs/inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index f1fc0e4c1c02..0c3be2658546 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -649,7 +649,9 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | |||
649 | trace_nfs_getattr_enter(inode); | 649 | trace_nfs_getattr_enter(inode); |
650 | /* Flush out writes to the server in order to update c/mtime. */ | 650 | /* Flush out writes to the server in order to update c/mtime. */ |
651 | if (S_ISREG(inode->i_mode)) { | 651 | if (S_ISREG(inode->i_mode)) { |
652 | mutex_lock(&inode->i_mutex); | ||
652 | err = nfs_sync_inode(inode); | 653 | err = nfs_sync_inode(inode); |
654 | mutex_unlock(&inode->i_mutex); | ||
653 | if (err) | 655 | if (err) |
654 | goto out; | 656 | goto out; |
655 | } | 657 | } |