Added a consistency check.
authorSapan Bhatia <sapanb@cs.princeton.edu>
Thu, 3 Apr 2008 20:46:17 +0000 (20:46 +0000)
committerSapan Bhatia <sapanb@cs.princeton.edu>
Thu, 3 Apr 2008 20:46:17 +0000 (20:46 +0000)
kernel-2.6.spec
linux-2.6-040-i_mutex-check.patch [new file with mode: 0644]

index bc69c88..ccf9fde 100644 (file)
@@ -141,6 +141,7 @@ Patch000: ftp://ftp.kernel.org/pub/linux/kernel/v2.6/patch-%{rpmversion}.bz2
 Patch010: linux-2.6-010-e1000e.patch
 Patch020: linux-2.6-020-build-id.patch
 Patch030: linux-2.6-030-netns.patch
+Patch040: linux-2.6-040-i_mutex-check.patch
 
 # These are patches picked up from Fedora/RHEL
 Patch100: linux-2.6-100-build-nonintconfig.patch
@@ -333,6 +334,7 @@ KERNEL_PREVIOUS=vanilla
 %if 0%{?with_netns}
 %ApplyPatch 30
 %endif
+%ApplyPatch 40
 
 %ApplyPatch 100
 
diff --git a/linux-2.6-040-i_mutex-check.patch b/linux-2.6-040-i_mutex-check.patch
new file mode 100644 (file)
index 0000000..3cfb78b
--- /dev/null
@@ -0,0 +1,19 @@
+diff -Nurb linux-2.6.22-20/fs/inode.c linux-2.6.22-40/fs/inode.c
+--- linux-2.6.22-20/fs/inode.c 2007-07-08 19:32:17.000000000 -0400
++++ linux-2.6.22-40/fs/inode.c 2008-04-03 16:41:53.000000000 -0400
+@@ -122,6 +122,7 @@
+               inode->i_fop = &empty_fops;
+               inode->i_nlink = 1;
+               atomic_set(&inode->i_writecount, 0);
++              mutex_init(&inode->i_mutex);
+               inode->i_size = 0;
+               inode->i_blocks = 0;
+               inode->i_bytes = 0;
+@@ -1102,6 +1103,7 @@
+       if (op && op->drop_inode)
+               drop = op->drop_inode;
++      BUG_ON(atomic_read(&inode->i_mutex.count)!=1);
+       drop(inode);
+ }