# This is a BitKeeper generated patch for the following project: # Project Name: Linux kernel tree # This patch format is intended for GNU patch command version 2.5 or higher. # This patch includes the following deltas: # ChangeSet 1.1353 -> 1.1357 # include/linux/init.h 1.5 -> 1.6 # fs/binfmt_elf.c 1.28 -> 1.30 # include/linux/compiler.h 1.1 -> 1.2 # include/linux/module.h 1.12 -> 1.13 # drivers/scsi/scsi_scan.c 1.34 -> 1.35 # # The following is the BitKeeper ChangeSet Log # -------------------------------------------- # 04/04/05 Joel.Becker@oracle.com 1.1354 # [PATCH] Add Xserve RAID LUN to SCSI whitelist # # Folks, # Apple's Xserver RAID array needs the sparse lun magic. Here's # the whitelist entry. # # Joel # -------------------------------------------- # 04/04/08 sfr@canb.auug.org.au 1.1355 # [PATCH] make 2.4 boot when built with gcc 3.4 # # Below is a back port of __attribute_used__ from 2.6 that is needed # (at least on PPC64 iSeries) so that a kernel built with gcc hammer branch # (or 3.4 ...) will actually boot. # -------------------------------------------- # 04/04/09 chrisw@osdl.org 1.1356 # [PATCH] fix load_elf_binary error path on unshare_files error # # Make sure to return proper retval on unshare_files() error in # load_elf_binary. Patch against 2.4.26-rc2. # # Error noted by Kirill Korotaev . # # ===== fs/binfmt_elf.c 1.28 vs edited ===== # -------------------------------------------- # 04/04/09 chrisw@osdl.org 1.1357 # [PATCH] fix another load_elf_binary error path # # Protect against cases where interpreter is NULL. Patch against 2.4.26-rc2. # # Error noted by Kirill Korotaev . # -------------------------------------------- # diff -Nru a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c --- a/drivers/scsi/scsi_scan.c Fri Apr 9 00:11:05 2004 +++ b/drivers/scsi/scsi_scan.c Fri Apr 9 00:11:05 2004 @@ -176,6 +176,7 @@ {"HP", "NetRAID-4M", "*", BLIST_FORCELUN}, {"ADAPTEC", "AACRAID", "*", BLIST_FORCELUN}, {"ADAPTEC", "Adaptec 5400S", "*", BLIST_FORCELUN}, + {"APPLE", "Xserve", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, {"COMPAQ", "MSA1000", "*", BLIST_SPARSELUN | BLIST_LARGELUN | BLIST_NOSTARTONADD}, {"COMPAQ", "MSA1000 VOLUME", "*", BLIST_SPARSELUN | BLIST_LARGELUN | BLIST_NOSTARTONADD}, {"COMPAQ", "HSV110", "*", BLIST_SPARSELUN | BLIST_LARGELUN | BLIST_NOSTARTONADD}, diff -Nru a/fs/binfmt_elf.c b/fs/binfmt_elf.c --- a/fs/binfmt_elf.c Fri Apr 9 00:11:05 2004 +++ b/fs/binfmt_elf.c Fri Apr 9 00:11:05 2004 @@ -479,7 +479,8 @@ goto out_free_ph; files = current->files; /* Refcounted so ok */ - if(unshare_files() < 0) + retval = unshare_files(); + if (retval < 0) goto out_free_ph; if (files == current->files) { put_files_struct(files); @@ -820,7 +821,8 @@ /* error cleanup */ out_free_dentry: allow_write_access(interpreter); - fput(interpreter); + if (interpreter) + fput(interpreter); out_free_interp: if (elf_interpreter) kfree(elf_interpreter); diff -Nru a/include/linux/compiler.h b/include/linux/compiler.h --- a/include/linux/compiler.h Fri Apr 9 00:11:05 2004 +++ b/include/linux/compiler.h Fri Apr 9 00:11:05 2004 @@ -13,4 +13,18 @@ #define likely(x) __builtin_expect((x),1) #define unlikely(x) __builtin_expect((x),0) +#if __GNUC__ > 3 +#define __attribute_used__ __attribute((__used__)) +#elif __GNUC__ == 3 +#if __GNUC_MINOR__ >= 3 +# define __attribute_used__ __attribute__((__used__)) +#else +# define __attribute_used__ __attribute__((__unused__)) +#endif /* __GNUC_MINOR__ >= 3 */ +#elif __GNUC__ == 2 +#define __attribute_used__ __attribute__((__unused__)) +#else +#define __attribute_used__ /* not implemented */ +#endif /* __GNUC__ */ + #endif /* __LINUX_COMPILER_H */ diff -Nru a/include/linux/init.h b/include/linux/init.h --- a/include/linux/init.h Fri Apr 9 00:11:05 2004 +++ b/include/linux/init.h Fri Apr 9 00:11:05 2004 @@ -2,6 +2,7 @@ #define _LINUX_INIT_H #include +#include /* These macros are used to mark some functions or * initialized data (doesn't apply to uninitialized data) @@ -51,7 +52,7 @@ extern initcall_t __initcall_start, __initcall_end; #define __initcall(fn) \ - static initcall_t __initcall_##fn __init_call = fn + static initcall_t __initcall_##fn __attribute_used__ __init_call = fn #define __exitcall(fn) \ static exitcall_t __exitcall_##fn __exit_call = fn @@ -67,7 +68,7 @@ #define __setup(str, fn) \ static char __setup_str_##fn[] __initdata = str; \ - static struct kernel_param __setup_##fn __attribute__((unused)) __initsetup = { __setup_str_##fn, fn } + static struct kernel_param __setup_##fn __attribute_used__ __initsetup = { __setup_str_##fn, fn } #endif /* __ASSEMBLY__ */ @@ -76,12 +77,12 @@ * or exit time. */ #define __init __attribute__ ((__section__ (".text.init"))) -#define __exit __attribute__ ((unused, __section__(".text.exit"))) +#define __exit __attribute_used__ __attribute__ (( __section__(".text.exit"))) #define __initdata __attribute__ ((__section__ (".data.init"))) -#define __exitdata __attribute__ ((unused, __section__ (".data.exit"))) -#define __initsetup __attribute__ ((unused,__section__ (".setup.init"))) -#define __init_call __attribute__ ((unused,__section__ (".initcall.init"))) -#define __exit_call __attribute__ ((unused,__section__ (".exitcall.exit"))) +#define __exitdata __attribute_used__ __attribute__ ((__section__ (".data.exit"))) +#define __initsetup __attribute_used__ __attribute__ ((__section__ (".setup.init"))) +#define __init_call __attribute_used__ __attribute__ ((__section__ (".initcall.init"))) +#define __exit_call __attribute_used__ __attribute__ ((__section__ (".exitcall.exit"))) /* For assembly routines */ #define __INIT .section ".text.init","ax" diff -Nru a/include/linux/module.h b/include/linux/module.h --- a/include/linux/module.h Fri Apr 9 00:11:05 2004 +++ b/include/linux/module.h Fri Apr 9 00:11:05 2004 @@ -254,9 +254,9 @@ */ #define MODULE_GENERIC_TABLE(gtype,name) \ static const unsigned long __module_##gtype##_size \ - __attribute__ ((unused)) = sizeof(struct gtype##_id); \ + __attribute_used__ = sizeof(struct gtype##_id); \ static const struct gtype##_id * __module_##gtype##_table \ - __attribute__ ((unused)) = name + __attribute_used__ = name /* * The following license idents are currently accepted as indicating free @@ -319,7 +319,7 @@ */ #define MODULE_GENERIC_TABLE(gtype,name) \ static const struct gtype##_id * __module_##gtype##_table \ - __attribute__ ((unused, __section__(".data.exit"))) = name + __attribute_used__ __attribute__ ((__section__(".data.exit"))) = name #ifndef __GENKSYMS__