GFS1 + 2.6.18 patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Patch fixes GFS crashing on 2.6.18.6
If anyone will have problems with this patch, let me know.
Applied to the latest CVS STABLE sources.

--
Nickolay Vinogradov
Protei Research and Development Center
St.Petersburg, 194044, Russia
Tel.: +7 812 449 47 27

--- cluster_GFS1.orig/gfs-kernel/src/gfs/ops_fstype.c	2006-06-29 20:50:41.000000000 +0400
+++ cluster_GFS1.patched/gfs-kernel/src/gfs/ops_fstype.c	2007-02-05 14:30:03.529125388 +0300
@@ -20,6 +20,7 @@
 #include <linux/buffer_head.h>
 #include <linux/vmalloc.h>
 #include <linux/blkdev.h>
+#include <linux/version.h>
 
 #include "gfs.h"
 #include "daemon.h"
@@ -679,9 +680,15 @@
  * Returns: the new superblock
  */
 
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,17)
 struct super_block *
 gfs_get_sb(struct file_system_type *fs_type, int flags,
-	   const char *dev_name, void *data)
+				const char *dev_name, void *data)
+#else
+static int
+gfs_get_sb(struct file_system_type *fs_type, int flags,
+				const char *dev_name, void *data, struct vfsmount *mnt)
+#endif
 {
 	struct block_device *real, *diaper;
 	struct super_block *sb;
@@ -689,12 +696,20 @@
 
 	real = open_bdev_excl(dev_name, flags, fs_type);
 	if (IS_ERR(real))
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,17)
 		return (struct super_block *)real;
+#else
+		return real;
+#endif
 
 	diaper = gfs_diaper_get(real, flags);
 	if (IS_ERR(diaper)) {
 		close_bdev_excl(real);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,17)
 		return (struct super_block *)diaper;
+#else
+		return diaper;
+#endif
 	}
 
 	mutex_lock(&diaper->bd_mount_mutex);
@@ -725,7 +740,11 @@
 			sb->s_flags |= MS_ACTIVE;
 	}
 
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,17)
 	return sb;
+#else
+	return simple_set_mnt(mnt, sb);
+#endif
 
  out:
 	gfs_diaper_put(diaper);
--- cluster_GFS1.orig/gfs-kernel/src/gfs/ops_super.c	2006-02-16 01:49:19.000000000 +0300
+++ cluster_GFS1.patched/gfs-kernel/src/gfs/ops_super.c	2007-02-05 13:25:10.693313312 +0300
@@ -22,6 +22,7 @@
 #include <linux/statfs.h>
 #include <linux/seq_file.h>
 #include <linux/mount.h>
+#include <linux/version.h>
 
 #include "gfs.h"
 #include "dio.h"
@@ -275,9 +276,15 @@
  */
 
 static int
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,17)
 gfs_statfs(struct super_block *sb, struct kstatfs *buf)
 {
 	struct gfs_sbd *sdp = get_v2sdp(sb);
+#else
+gfs_statfs(struct dentry *dentry, struct kstatfs *buf)
+{
+	struct gfs_sbd *sdp = get_v2sdp(dentry->d_sb);
+#endif
 	struct gfs_stat_gfs sg;
 	int error;
 
--- cluster_GFS1.orig/gnbd-kernel/src/gnbd.c	2006-07-12 21:34:29.000000000 +0400
+++ cluster_GFS1.patched/gnbd-kernel/src/gnbd.c	2007-02-05 13:29:37.854009811 +0300
@@ -30,7 +30,11 @@
 #include <linux/buffer_head.h>
 #include <linux/miscdevice.h>
 #include <linux/moduleparam.h>
-#include <linux/devfs_fs_kernel.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,17)
+	#include <linux/devfs_fs_kernel.h>
+#endif
 
 #include <asm/uaccess.h>
 #include <asm/types.h>
@@ -843,10 +847,12 @@
 
 static struct miscdevice _gnbd_misc =
 {
-        .minor = MISC_DYNAMIC_MINOR,
-        .name  = "gnbd_ctl",
-        .devfs_name = "gnbd_ctl",
-        .fops = &_gnbd_ctl_fops
+	.minor = MISC_DYNAMIC_MINOR,
+	.name  = "gnbd_ctl",
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,17)
+	.devfs_name = "gnbd_ctl",
+#endif
+	.fops = &_gnbd_ctl_fops
 };
 
 /* FIXME -- I should probably do more here */
@@ -926,7 +932,9 @@
 	printk(KERN_INFO "gnbd: registered device at major %d\n", major_nr);
 	dprintk(DBG_INIT, "gnbd: debugflags=0x%x\n", debugflags);
 
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,17)
 	devfs_mk_dir("gnbd_minor");
+#endif
 	err = class_register(&gnbd_class);
 	if (err)
 		goto out_unregister;
@@ -982,7 +990,9 @@
 		disk->fops = &gnbd_fops;
 		disk->private_data = &gnbd_dev[i];
 		sprintf(disk->disk_name, "gnbd%d", i);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,17)
 		sprintf(disk->devfs_name, "gnbd_minor/%d", i);
+#endif
 		set_capacity(disk, 0);
 		add_disk(disk);
 		if(sysfs_create_link(&gnbd_dev[i].class_dev.kobj,
@@ -1036,7 +1046,9 @@
 			kfree(gnbd_dev[i].server_name);
 	}
 	class_unregister(&gnbd_class);
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,17)
 	devfs_remove("gnbd");
+#endif
 	unregister_blkdev(major_nr, "gnbd");
 	printk(KERN_INFO "gnbd: unregistered device at major %d\n", major_nr);
 }
--
Linux-cluster mailing list
Linux-cluster@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/linux-cluster

[Index of Archives]     [Corosync Cluster Engine]     [GFS]     [Linux Virtualization]     [Centos Virtualization]     [Centos]     [Linux RAID]     [Fedora Users]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite Camping]

  Powered by Linux