rpms/kernel/devel linux-2.6-NFSD-locking-fix.patch, NONE, 1.1 kernel-2.6.spec, 1.1697, 1.1698

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Sun Nov 20 20:32:54 UTC 2005


Author: davej

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv13872

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-NFSD-locking-fix.patch 
Log Message:
* Sun Nov 20 2005 Dave Jones <davej at redhat.com>
- Fix bad locking in NFS (#173364)


linux-2.6-NFSD-locking-fix.patch:
 inode.c |   26 ++++++++++++--------------
 1 files changed, 12 insertions(+), 14 deletions(-)

--- NEW FILE linux-2.6-NFSD-locking-fix.patch ---
--- linux-2.6.14/fs/nfs/inode.c.orig	2005-11-16 12:04:36.464685000 -0500
+++ linux-2.6.14/fs/nfs/inode.c	2005-11-18 06:09:40.543264000 -0500
@@ -643,14 +643,11 @@ static int nfs_show_options(struct seq_f
 /*
  * Invalidate the local caches
  */
-void
-nfs_zap_caches(struct inode *inode)
+static void nfs_zap_caches_locked(struct inode *inode)
 {
 	struct nfs_inode *nfsi = NFS_I(inode);
 	int mode = inode->i_mode;
 
-	spin_lock(&inode->i_lock);
-
 	NFS_ATTRTIMEO(inode) = NFS_MINATTRTIMEO(inode);
 	NFS_ATTRTIMEO_UPDATE(inode) = jiffies;
 
@@ -659,7 +656,12 @@ nfs_zap_caches(struct inode *inode)
 		nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE;
 	else
 		nfsi->cache_validity |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_ACCESS|NFS_INO_INVALID_ACL|NFS_INO_REVAL_PAGECACHE;
+}
 
+void nfs_zap_caches(struct inode *inode)
+{
+	spin_lock(&inode->i_lock);
+	nfs_zap_caches_locked(inode);
 	spin_unlock(&inode->i_lock);
 }
 
@@ -676,16 +678,13 @@ static void nfs_zap_acl_cache(struct ino
 }
 
 /*
- * Invalidate, but do not unhash, the inode
+ * Invalidate, but do not unhash, the inode.
+ * NB: must be called with inode->i_lock held!
  */
-static void
-nfs_invalidate_inode(struct inode *inode)
+static void nfs_invalidate_inode(struct inode *inode)
 {
-	umode_t save_mode = inode->i_mode;
-
-	make_bad_inode(inode);
-	inode->i_mode = save_mode;
-	nfs_zap_caches(inode);
+	set_bit(NFS_INO_STALE, &NFS_FLAGS(inode));
+	nfs_zap_caches_locked(inode);
 }
 
 struct nfs_find_desc {
@@ -1528,14 +1527,13 @@ static int nfs_update_inode(struct inode
 	printk(KERN_DEBUG "%s: inode %ld mode changed, %07o to %07o\n",
 			__FUNCTION__, inode->i_ino, inode->i_mode, fattr->mode);
 #endif
+ out_err:
 	/*
 	 * No need to worry about unhashing the dentry, as the
 	 * lookup validation will know that the inode is bad.
 	 * (But we fall through to invalidate the caches.)
 	 */
 	nfs_invalidate_inode(inode);
- out_err:
-	set_bit(NFS_INO_STALE, &NFS_FLAGS(inode));
 	return -ESTALE;
 }
 


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.1697
retrieving revision 1.1698
diff -u -r1.1697 -r1.1698
--- kernel-2.6.spec	20 Nov 2005 05:53:04 -0000	1.1697
+++ kernel-2.6.spec	20 Nov 2005 20:32:34 -0000	1.1698
@@ -302,6 +302,7 @@
 # NFS bits.
 Patch1200: linux-2.6-NFSD-non-null-getxattr.patch
 Patch1201: linux-2.6-NFSD-ctlbits.patch
+Patch1202: linux-2.6-NFSD-locking-fix.patch
 
 # NIC driver updates
 Patch1301: linux-2.6-net-sundance-ip100A.patch
@@ -726,6 +727,8 @@
 %patch1200 -p1
 # kNFSD: fixed '-p port' arg to rpc.nfsd and enables the defining proto versions and transports
 %patch1201 -p1
+# Fix bad locking.
+%patch1202 -p1
 
 # NIC driver fixes.
 # New PCI ID for sundance driver.
@@ -1289,6 +1292,9 @@
 %endif
 
 %changelog
+* Sun Nov 20 2005 Dave Jones <davej at redhat.com>
+- Fix bad locking in NFS (#173364)
+
 * Sat Nov 19 2005 Dave Jones <davej at redhat.com>
 - 2.6.15-rc2
 




More information about the fedora-cvs-commits mailing list