From 980d932e20c48fddca61029aca8c4df8891f828e Mon Sep 17 00:00:00 2001 From: johann Date: Fri, 3 Aug 2007 19:47:37 +0000 Subject: [PATCH] Branch HEAD b=12755 i=johann i=shadow Severity : normal Frequency : when using more than 256 SCSI disks on a single server Bugzilla : 12755 Description: Kernel BUG: sd_iostats_bump: unexpected disk index Details : a kernel BUG is hit when using more than 256 SCSI disks. --- lustre/ChangeLog | 6 +++ .../patches/sd_iostats-2.6-rhel4.patch | 52 +++++++++++++--------- 2 files changed, 37 insertions(+), 21 deletions(-) diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 6cca06f..36e3ac52 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -11,6 +11,12 @@ tbd Cluster File Systems, Inc. * Recommended e2fsprogs version: 1.39.cfs8 * Note that reiserfs quotas are disabled on SLES 10 in this kernel. +Severity : normal +Frequency : when using more than 256 SCSI disks on a single server +Bugzilla : 12755 +Description: Kernel BUG: sd_iostats_bump: unexpected disk index +Details : a kernel BUG is hit when using more than 256 SCSI disks. + 2007-08-10 Cluster File Systems, Inc. * version 1.6.1 * Support for kernels: diff --git a/lustre/kernel_patches/patches/sd_iostats-2.6-rhel4.patch b/lustre/kernel_patches/patches/sd_iostats-2.6-rhel4.patch index 4e06c09..91e4df2 100644 --- a/lustre/kernel_patches/patches/sd_iostats-2.6-rhel4.patch +++ b/lustre/kernel_patches/patches/sd_iostats-2.6-rhel4.patch @@ -1,9 +1,7 @@ -Index: linux-2.6.9-5.0.3.EL/drivers/scsi/Kconfig -=================================================================== -Index: linux+rhel4+chaos/drivers/scsi/Kconfig +Index: linux-2.6.9/drivers/scsi/Kconfig =================================================================== ---- linux+rhel4+chaos.orig/drivers/scsi/Kconfig -+++ linux+rhel4+chaos/drivers/scsi/Kconfig +--- linux-2.6.9.orig/drivers/scsi/Kconfig 2007-08-02 09:26:17.000000000 +0200 ++++ linux-2.6.9/drivers/scsi/Kconfig 2007-08-02 09:26:21.000000000 +0200 @@ -61,6 +61,14 @@ config SCSI_DUMP help SCSI dump support @@ -19,10 +17,10 @@ Index: linux+rhel4+chaos/drivers/scsi/Kconfig config CHR_DEV_ST tristate "SCSI tape support" depends on SCSI -Index: linux+rhel4+chaos/drivers/scsi/sd.c +Index: linux-2.6.9/drivers/scsi/sd.c =================================================================== ---- linux+rhel4+chaos.orig/drivers/scsi/sd.c -+++ linux+rhel4+chaos/drivers/scsi/sd.c +--- linux-2.6.9.orig/drivers/scsi/sd.c 2007-08-02 09:26:17.000000000 +0200 ++++ linux-2.6.9/drivers/scsi/sd.c 2007-08-02 09:29:31.000000000 +0200 @@ -63,6 +63,38 @@ #include "scsi_logging.h" @@ -62,15 +60,27 @@ Index: linux+rhel4+chaos/drivers/scsi/sd.c /* * More than enough for everybody ;) The huge number of majors * is a leftover from 16bit dev_t days, we don't really need that -@@ -76,6 +108,7 @@ +@@ -71,10 +103,18 @@ + #define SD_MAJORS 16 + + /* +- * This is limited by the naming scheme enforced in sd_probe, ++ * SD_MAX_DISKS is limited by the naming scheme enforced in sd_probe, + * add another character to it if you really need more disks. ++ * ++ * SD_STATS must not be less than SD_MAX_DISKS and, is limited by 131072/8 ++ * for sd_iostats kmalloc (see kmalloc_sizes.h) */ ++#if (defined(CONFIG_SD_IOSTATS) && defined(CONFIG_PROC_FS)) ++#define SD_STATS 16384 ++#define SD_MAX_DISKS SD_STATS ++#else #define SD_MAX_DISKS (((26 * 26) + 26 + 1) * 26) ++#endif -+#define SD_STATS 256 /* * Time out in seconds for disks and Magneto-opticals (which are slower). - */ -@@ -278,6 +311,9 @@ static int sd_init_command(struct scsi_c +@@ -278,6 +318,9 @@ static int sd_init_command(struct scsi_c SCSI_LOG_HLQUEUE(2, printk("%s : block=%llu\n", disk->disk_name, (unsigned long long)block)); @@ -80,7 +90,7 @@ Index: linux+rhel4+chaos/drivers/scsi/sd.c /* * If we have a 1K hardware sectorsize, prevent access to single * 512 byte sectors. In theory we could handle this - in fact -@@ -474,6 +510,7 @@ static int sd_open(struct inode *inode, +@@ -474,6 +517,7 @@ static int sd_open(struct inode *inode, scsi_set_medium_removal(sdev, SCSI_REMOVAL_PREVENT); } @@ -88,7 +98,7 @@ Index: linux+rhel4+chaos/drivers/scsi/sd.c return 0; error_out: -@@ -500,8 +537,20 @@ static int sd_release(struct inode *inod +@@ -500,8 +544,20 @@ static int sd_release(struct inode *inod SCSI_LOG_HLQUEUE(3, printk("sd_release: disk=%s\n", disk->disk_name)); @@ -111,7 +121,7 @@ Index: linux+rhel4+chaos/drivers/scsi/sd.c scsi_set_medium_removal(sdev, SCSI_REMOVAL_ALLOW); } -@@ -1575,6 +1624,342 @@ static void sd_shutdown(struct device *d +@@ -1575,6 +1631,342 @@ static void sd_shutdown(struct device *d sd_sync_cache(sdp); } @@ -454,7 +464,7 @@ Index: linux+rhel4+chaos/drivers/scsi/sd.c /** * init_sd - entry point for this driver (both when built in or when * a module). -@@ -1584,6 +1969,7 @@ static void sd_shutdown(struct device *d +@@ -1584,6 +1976,7 @@ static void sd_shutdown(struct device *d static int __init init_sd(void) { int majors = 0, i; @@ -462,7 +472,7 @@ Index: linux+rhel4+chaos/drivers/scsi/sd.c SCSI_LOG_HLQUEUE(3, printk("init_sd: sd driver entry point\n")); -@@ -1594,7 +1980,10 @@ static int __init init_sd(void) +@@ -1594,7 +1987,10 @@ static int __init init_sd(void) if (!majors) return -ENODEV; @@ -474,7 +484,7 @@ Index: linux+rhel4+chaos/drivers/scsi/sd.c } /** -@@ -1608,6 +1997,7 @@ static void __exit exit_sd(void) +@@ -1608,6 +2004,7 @@ static void __exit exit_sd(void) SCSI_LOG_HLQUEUE(3, printk("exit_sd: exiting sd driver\n")); @@ -482,10 +492,10 @@ Index: linux+rhel4+chaos/drivers/scsi/sd.c scsi_unregister_driver(&sd_template.gendrv); for (i = 0; i < SD_MAJORS; i++) unregister_blkdev(sd_major(i), "sd"); -Index: linux+rhel4+chaos/drivers/scsi/scsi_proc.c +Index: linux-2.6.9/drivers/scsi/scsi_proc.c =================================================================== ---- linux+rhel4+chaos.orig/drivers/scsi/scsi_proc.c -+++ linux+rhel4+chaos/drivers/scsi/scsi_proc.c +--- linux-2.6.9.orig/drivers/scsi/scsi_proc.c 2007-08-02 09:26:17.000000000 +0200 ++++ linux-2.6.9/drivers/scsi/scsi_proc.c 2007-08-02 09:26:21.000000000 +0200 @@ -38,7 +38,8 @@ /* 4K page size, but our output routines, use some slack for overruns */ #define PROC_BLOCK_SIZE (3*1024) -- 1.8.3.1