Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 79609
b: refs/heads/master
c: 28c494c
h: refs/heads/master
i:
  79607: f6385b8
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Jan 30, 2008
1 parent ac3e538 commit 3a633b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 464ad6b1ade186b53a1dae863361853326b85694
refs/heads/master: 28c494c5c8d425e15b7b82571e4df6d6bc34594d
13 changes: 11 additions & 2 deletions trunk/fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,9 +461,18 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
int need_atime = NFS_I(inode)->cache_validity & NFS_INO_INVALID_ATIME;
int err;

/* Flush out writes to the server in order to update c/mtime */
if (S_ISREG(inode->i_mode))
/*
* Flush out writes to the server in order to update c/mtime.
*
* Hold the i_mutex to suspend application writes temporarily;
* this prevents long-running writing applications from blocking
* nfs_wb_nocommit.
*/
if (S_ISREG(inode->i_mode)) {
mutex_lock(&inode->i_mutex);
nfs_wb_nocommit(inode);
mutex_unlock(&inode->i_mutex);
}

/*
* We may force a getattr if the user cares about atime.
Expand Down

0 comments on commit 3a633b2

Please sign in to comment.