Re: Kernel 2.6.20 does not work anymore with SCSI or SATA on oldOpteron / Xeon servers

From: Stefan Priebe
Date: Tue Mar 20 2007 - 09:28:51 EST


Hello!

With the sysrq i've found the function with is the problem:
inode.c => nfs_getattr => nfs_sync_mapping_range

I've also found the attached patch - which is not included in any stable release nor in 2.6.21.X but is public since 20.02.07

I think this is very important.

Stefan Priebe commit 090ad38f8ceea3cc048981e9fe9cc62ed43fee58
Author: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>
Date: Tue Feb 20 19:28:07 2007 -0500

NFS: nfs_getattr() can't call nfs_sync_mapping_range() for non-regular files

Signed-off-by: Trond Myklebust <Trond.Myklebust@xxxxxxxxxx>

diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
index af53c02..93d046c 100644
--- a/fs/nfs/inode.c
+++ b/fs/nfs/inode.c
@@ -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.