提交 63470738 编写于 作者: T Trond Myklebust 提交者: Linus Torvalds

[PATCH] nfs: nfs_getattr() can't call nfs_sync_mapping_range() for non-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: NTrond Myklebust <Trond.Myklebust@netapp.com>
Acked-by: NOlof Johansson <olof@lixom.net>
Cc: <stable@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 89a09141
...@@ -429,7 +429,8 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) ...@@ -429,7 +429,8 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat)
int err; int err;
/* Flush out writes to the server in order to update c/mtime */ /* 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. * We may force a getattr if the user cares about atime.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册