[ewg] [PATCH OFED-1.4.1] NFSRDMA: RHEL5.1 and RHEL5.2 fixes for bug 1596

Jon Mason jon at opengridcomputing.com
Mon May 18 13:38:07 PDT 2009


openibd cannot be stopped if NFS is running due to a dependency to code
added to ib_core.  This dependency code does not need to be added to
ib_core and can be added to the NFS module to remove the need for
ib_core.  By modifying it in this way, openibd can be stopped without
issue.

The patch below fixes the issue for RHEL5.1 and RHEL5.2

Signed-Off-By: Jon Mason <jon at opengridcomputing.com>
---

diff --git a/kernel_patches/backport/2.6.18-EL5.1/rnfs_fs.patch b/kernel_patches/backport/2.6.18-EL5.1/rnfs_fs.patch
index a7687ad..09b3076 100644
--- a/kernel_patches/backport/2.6.18-EL5.1/rnfs_fs.patch
+++ b/kernel_patches/backport/2.6.18-EL5.1/rnfs_fs.patch
@@ -1,51 +1,3 @@
-diff --git a/drivers/infiniband/core/Makefile b/drivers/infiniband/core/Makefile
-index 03acfd6..992e4aa 100644
---- a/drivers/infiniband/core/Makefile
-+++ b/drivers/infiniband/core/Makefile
-@@ -31,4 +31,4 @@ ib_ucm-y :=			ucm.o
- 
- ib_uverbs-y :=			uverbs_main.o uverbs_cmd.o uverbs_marshall.o
- 
--ib_core-y +=			genalloc.o
-+ib_core-y +=			genalloc.o namespace.o writeback.o
-diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
-index 8ea4d01..5d49041 100644
---- a/drivers/infiniband/core/device.c
-+++ b/drivers/infiniband/core/device.c
-@@ -39,7 +39,7 @@
- #include <linux/init.h>
- #include <linux/mutex.h>
- #include <linux/workqueue.h>
--
-+#include <linux/mount.h>
- #include "core_priv.h"
- 
- MODULE_AUTHOR("Roland Dreier");
-@@ -735,6 +735,10 @@ static int __init ib_core_init(void)
- 		dma_map_sg_hp_wa = 1;
- #endif
- 
-+	ret = init_mnt_writers();
-+	if (ret)
-+		printk(KERN_WARNING "Couldn't init mnt_writers\n");
-+
- 	ret = ib_sysfs_setup();
- 	if (ret)
- 		printk(KERN_WARNING "Couldn't create InfiniBand device class\n");
-diff --git a/drivers/infiniband/core/namespace.c b/drivers/infiniband/core/namespace.c
-new file mode 100644
-index 0000000..de57f8b
---- /dev/null
-+++ b/drivers/infiniband/core/namespace.c
-@@ -0,0 +1 @@
-+#include "src/namespace.c"
-diff --git a/drivers/infiniband/core/writeback.c b/drivers/infiniband/core/writeback.c
-new file mode 100644
-index 0000000..b838ead
---- /dev/null
-+++ b/drivers/infiniband/core/writeback.c
-@@ -0,0 +1 @@
-+#include "src/writeback.c"
 diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
 index cc91227..262397b 100644
 --- a/fs/exportfs/expfs.c
@@ -308,6 +260,34 @@ index 198b4e5..2109091 100644
  }
  
  /**
+diff --git a/fs/nfs/Makefile b/fs/nfs/Makefile
+index ac6170c..78eca38 100644
+--- a/fs/nfs/Makefile
++++ b/fs/nfs/Makefile
+@@ -6,7 +6,8 @@ obj-$(CONFIG_NFS_FS) += nfs.o
+ 
+ nfs-y 			:= client.o dir.o file.o getroot.o inode.o super.o nfs2xdr.o \
+ 			   direct.o pagelist.o proc.o read.o symlink.o unlink.o \
+-			   write.o namespace.o mount_clnt.o
++			   write.o namespace.o mount_clnt.o backport-namespace.o \
++			   backport-writeback.o
+ nfs-$(CONFIG_ROOT_NFS)	+= nfsroot.o
+ nfs-$(CONFIG_NFS_V3)	+= nfs3proc.o nfs3xdr.o
+ nfs-$(CONFIG_NFS_V3_ACL)	+= nfs3acl.o
+diff --git a/fs/nfs/backport-namespace.c b/fs/nfs/backport-namespace.c
+new file mode 100644
+index 0000000..de57f8b
+--- /dev/null
++++ b/fs/nfs/backport-namespace.c
+@@ -0,0 +1 @@
++#include "src/namespace.c"
+diff --git a/fs/nfs/backport-writeback.c b/fs/nfs/backport-writeback.c
+new file mode 100644
+index 0000000..b838ead
+--- /dev/null
++++ b/fs/nfs/backport-writeback.c
+@@ -0,0 +1 @@
++#include "src/writeback.c"
 diff --git a/fs/nfs/client.c b/fs/nfs/client.c
 index 5ee23e7..afbb834 100644
 --- a/fs/nfs/client.c
@@ -895,7 +875,7 @@ index 86147b0..148aebe 100644
  	struct idmap_msg im_in, *im = &idmap->idmap_im;
  	struct idmap_hashtable *h;
 diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
-index 52daefa..6a5b54c 100644
+index 52daefa..8e2b88a 100644
 --- a/fs/nfs/inode.c
 +++ b/fs/nfs/inode.c
 @@ -612,7 +612,7 @@ static void put_nfs_open_context_sync(struct nfs_open_context *ctx)
@@ -934,6 +914,17 @@ index 52daefa..6a5b54c 100644
  {
  	struct nfs_inode *nfsi = (struct nfs_inode *) foo;
  
+@@ -1314,6 +1314,10 @@ static int __init init_nfs_fs(void)
+ {
+ 	int err;
+ 
++	err = init_mnt_writers();
++	if (err)
++		goto out6;
++
+ 	err = nfsiod_start();
+ 	if (err)
+ 		goto out6;
 diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
 index 66df08d..1e11b1d 100644
 --- a/fs/nfs/namespace.c
diff --git a/kernel_patches/backport/2.6.18-EL5.2/rnfs_fs.patch b/kernel_patches/backport/2.6.18-EL5.2/rnfs_fs.patch
index 1d6512f..3afaa68 100644
--- a/kernel_patches/backport/2.6.18-EL5.2/rnfs_fs.patch
+++ b/kernel_patches/backport/2.6.18-EL5.2/rnfs_fs.patch
@@ -1,42 +1,3 @@
-diff --git a/drivers/infiniband/core/Makefile b/drivers/infiniband/core/Makefile
-index 03acfd6..fcbe857 100644
---- a/drivers/infiniband/core/Makefile
-+++ b/drivers/infiniband/core/Makefile
-@@ -31,4 +31,4 @@ ib_ucm-y :=			ucm.o
- 
- ib_uverbs-y :=			uverbs_main.o uverbs_cmd.o uverbs_marshall.o
- 
--ib_core-y +=			genalloc.o
-+ib_core-y +=			genalloc.o namespace.o writeback.o
-diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
-index 7edc1b5..4e222ed 100644
---- a/drivers/infiniband/core/device.c
-+++ b/drivers/infiniband/core/device.c
-@@ -727,6 +727,10 @@ static int __init ib_core_init(void)
- 		dma_map_sg_hp_wa = 1;
- #endif
- 
-+	ret = init_mnt_writers();
-+	if (ret)
-+		printk(KERN_WARNING "Couldn't init mnt_writers\n");
-+
- 	ret = ib_sysfs_setup();
- 	if (ret)
- 		printk(KERN_WARNING "Couldn't create InfiniBand device class\n");
-diff --git a/drivers/infiniband/core/namespace.c b/drivers/infiniband/core/namespace.c
-new file mode 100644
-index 0000000..de57f8b
---- /dev/null
-+++ b/drivers/infiniband/core/namespace.c
-@@ -0,0 +1 @@
-+#include "src/namespace.c"
-diff --git a/drivers/infiniband/core/writeback.c b/drivers/infiniband/core/writeback.c
-new file mode 100644
-index 0000000..b838ead
---- /dev/null
-+++ b/drivers/infiniband/core/writeback.c
-@@ -0,0 +1 @@
-+#include "src/writeback.c"
 diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
 index cc91227..262397b 100644
 --- a/fs/exportfs/expfs.c
@@ -227,6 +188,34 @@ index 198b4e5..2109091 100644
  }
  
  /**
+diff --git a/fs/nfs/Makefile b/fs/nfs/Makefile
+index ac6170c..78eca38 100644
+--- a/fs/nfs/Makefile
++++ b/fs/nfs/Makefile
+@@ -6,7 +6,8 @@ obj-$(CONFIG_NFS_FS) += nfs.o
+ 
+ nfs-y 			:= client.o dir.o file.o getroot.o inode.o super.o nfs2xdr.o \
+ 			   direct.o pagelist.o proc.o read.o symlink.o unlink.o \
+-			   write.o namespace.o mount_clnt.o
++			   write.o namespace.o mount_clnt.o backport-namespace.o \
++			   backport-writeback.o
+ nfs-$(CONFIG_ROOT_NFS)	+= nfsroot.o
+ nfs-$(CONFIG_NFS_V3)	+= nfs3proc.o nfs3xdr.o
+ nfs-$(CONFIG_NFS_V3_ACL)	+= nfs3acl.o
+diff --git a/fs/nfs/backport-namespace.c b/fs/nfs/backport-namespace.c
+new file mode 100644
+index 0000000..de57f8b
+--- /dev/null
++++ b/fs/nfs/backport-namespace.c
+@@ -0,0 +1 @@
++#include "src/namespace.c"
+diff --git a/fs/nfs/backport-writeback.c b/fs/nfs/backport-writeback.c
+new file mode 100644
+index 0000000..b838ead
+--- /dev/null
++++ b/fs/nfs/backport-writeback.c
+@@ -0,0 +1 @@
++#include "src/writeback.c"
 diff --git a/fs/nfs/client.c b/fs/nfs/client.c
 index 5ee23e7..afbb834 100644
 --- a/fs/nfs/client.c
@@ -814,7 +803,7 @@ index 86147b0..148aebe 100644
  	struct idmap_msg im_in, *im = &idmap->idmap_im;
  	struct idmap_hashtable *h;
 diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
-index 52daefa..6a5b54c 100644
+index 52daefa..8e2b88a 100644
 --- a/fs/nfs/inode.c
 +++ b/fs/nfs/inode.c
 @@ -612,7 +612,7 @@ static void put_nfs_open_context_sync(struct nfs_open_context *ctx)
@@ -853,6 +842,17 @@ index 52daefa..6a5b54c 100644
  {
  	struct nfs_inode *nfsi = (struct nfs_inode *) foo;
  
+@@ -1314,6 +1314,10 @@ static int __init init_nfs_fs(void)
+ {
+ 	int err;
+ 
++	err = init_mnt_writers();
++	if (err)
++		goto out6;
++
+ 	err = nfsiod_start();
+ 	if (err)
+ 		goto out6;
 diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c
 index 66df08d..1e11b1d 100644
 --- a/fs/nfs/namespace.c



More information about the ewg mailing list