From: Trond Myklebust Date: Wed, 25 Mar 2015 20:40:07 +0000 (-0400) Subject: NFS: Block new writes while syncing data in nfs_getattr() X-Git-Tag: v4.1-rc1~6^2~17 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8c18d76bcba874e872410ca63c7e59b10aafa17d;p=karo-tx-linux.git NFS: Block new writes while syncing data in nfs_getattr() Signed-off-by: Trond Myklebust --- 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) 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; }