Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

NFS: Block new writes while syncing data in nfs_getattr()

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>

+2
+2
fs/nfs/inode.c
··· 649 649 trace_nfs_getattr_enter(inode); 650 650 /* Flush out writes to the server in order to update c/mtime. */ 651 651 if (S_ISREG(inode->i_mode)) { 652 + mutex_lock(&inode->i_mutex); 652 653 err = nfs_sync_inode(inode); 654 + mutex_unlock(&inode->i_mutex); 653 655 if (err) 654 656 goto out; 655 657 }