Skip to content

Commit

Permalink
NFS: Block new writes while syncing data in nfs_getattr()
Browse files Browse the repository at this point in the history
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
  • Loading branch information
Trond Myklebust committed Mar 27, 2015
1 parent 5bb89b4 commit 8c18d76
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,9 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
trace_nfs_getattr_enter(inode);
/* Flush out writes to the server in order to update c/mtime. */
if (S_ISREG(inode->i_mode)) {
mutex_lock(&inode->i_mutex);
err = nfs_sync_inode(inode);
mutex_unlock(&inode->i_mutex);
if (err)
goto out;
}
Expand Down

0 comments on commit 8c18d76

Please sign in to comment.