mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 02:50:43 +00:00
NFS: Block new writes while syncing data in nfs_getattr()
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
5bb89b4702
commit
8c18d76bcb
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue