Skip to content

Commit

Permalink
[PATCH] nfs: nfs_getattr() can't call nfs_sync_mapping_range() for no…
Browse files Browse the repository at this point in the history
…n-regular files

Looks like we need a check in nfs_getattr() for a regular file. It makes
no sense to call nfs_sync_mapping_range() on anything else. I think that
should fix your problem: it will stop the NFS client from interfering
with dirty pages on that inode's mapping.

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: Olof Johansson <olof@lixom.net>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Trond Myklebust authored and Linus Torvalds committed Mar 17, 2007
1 parent 89a0914 commit 6347073
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,8 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
int err;

/* Flush out writes to the server in order to update c/mtime */
nfs_sync_mapping_range(inode->i_mapping, 0, 0, FLUSH_NOCOMMIT);
if (S_ISREG(inode->i_mode))
nfs_sync_mapping_range(inode->i_mapping, 0, 0, FLUSH_NOCOMMIT);

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

0 comments on commit 6347073

Please sign in to comment.