27 Jul, 2008

1 commit

  • The following commit causes ch_remove oops:

    commit 24b42566c3fcbb5a9011d1446783d0f5844ccd45
    Author: Greg Kroah-Hartman
    Date: Fri May 16 17:55:12 2008 -0700

    SCSI: fix race in device_create

    There is a race from when a device is created with device_create() and
    then the drvdata is set with a call to dev_set_drvdata() in which a
    sysfs file could be open, yet the drvdata will be NULL, causing all
    sorts of bad things to happen.

    This patch fixes the problem by using the new function,
    device_create_drvdata(). It fixes the problem in all of the scsi
    drivers that need it.

    Cc: Kay Sievers
    Cc: Doug Gilbert
    Cc: James E.J. Bottomley
    Signed-off-by: Greg Kroah-Hartman

    The problem is ch_probe stores ch's private data at a wrong place.

    We need to store it at scsi_device->sdev_gendev but the above patch
    stores it at device struct that device_create_drvdata returns. So we
    hit an oops when ch_remove accesses
    scsi_device->sdev_gendev->driver_data, which is NULL.

    Actually, there wasn't a race because ch doesn't create sysfs files
    with device struct that device_create returns. This patch puts back
    dev_set_drvdata() to set ch's private data properly.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     

15 Jul, 2008

1 commit


21 Jun, 2008

1 commit


21 May, 2008

1 commit

  • There is a race from when a device is created with device_create() and
    then the drvdata is set with a call to dev_set_drvdata() in which a
    sysfs file could be open, yet the drvdata will be NULL, causing all
    sorts of bad things to happen.

    This patch fixes the problem by using the new function,
    device_create_drvdata(). It fixes the problem in all of the scsi
    drivers that need it.

    Cc: Kay Sievers
    Cc: Doug Gilbert
    Cc: James E.J. Bottomley
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman
     

20 Apr, 2008

1 commit


08 Apr, 2008

1 commit

  • Replace the global err array with ch_err.
    drivers/scsi/ch.c:271:6: warning: symbol 'err' shadows an earlier one
    drivers/scsi/ch.c:116:3: originally declared here

    Replace the temporary cmd buffer with ch_err to avoid shadowing the cmd
    function parameter.
    drivers/scsi/ch.c:724:11: warning: symbol 'cmd' shadows an earlier one
    drivers/scsi/ch.c:596:20: originally declared here

    Signed-off-by: Harvey Harrison
    Signed-off-by: James Bottomley

    Harvey Harrison
     

25 Jan, 2008

2 commits

  • This moves ch_template and changer_fops structs to the end of file and
    removes forward declarations.

    This also removes some trailing whitespace.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     
  • ch_probe uses the total number of ch devices as minor.

    ch_probe:
    ch->minor = ch_devcount;
    ...
    ch_devcount++;

    Then ch_remove decreases ch_devcount:

    ch_remove:
    ch_devcount--;

    If you have two ch devices, sch0 and sch1, and remove sch0,
    ch_devcount is 1. Then if you add another ch device, ch_probe tries to
    create sch1. So you get a warning and fail to create sch1:

    Jan 24 16:01:05 nice kernel: sysfs: duplicate filename 'sch1' can not be created
    Jan 24 16:01:05 nice kernel: WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()
    Jan 24 16:01:05 nice kernel: Pid: 2571, comm: iscsid Not tainted 2.6.24-rc7-ga3d2c2e8-dirty #1
    Jan 24 16:01:05 nice kernel:
    Jan 24 16:01:05 nice kernel: Call Trace:
    Jan 24 16:01:05 nice kernel: [] sysfs_add_one+0x54/0xbd
    Jan 24 16:01:05 nice kernel: [] create_dir+0x4f/0x87
    Jan 24 16:01:05 nice kernel: [] sysfs_create_dir+0x35/0x4a
    Jan 24 16:01:05 nice kernel: [] kobject_get+0x12/0x17
    Jan 24 16:01:05 nice kernel: [] kobject_add+0xf3/0x1a6
    Jan 24 16:01:05 nice kernel: [] class_device_add+0xaa/0x39d
    Jan 24 16:01:05 nice kernel: [] class_device_create+0xcb/0xfa
    Jan 24 16:01:05 nice kernel: [] printk+0x4e/0x56
    Jan 24 16:01:05 nice kernel: [] sysfs_ilookup_test+0x0/0xf
    Jan 24 16:01:05 nice kernel: [] :ch:ch_probe+0xbe/0x61a

    (snip)

    This patch converts ch to use a standard minor number management way,
    idr like sg and bsg.

    Signed-off-by: FUJITA Tomonori
    Signed-off-by: James Bottomley

    FUJITA Tomonori
     

24 Jan, 2008

2 commits


06 May, 2007

1 commit


15 Feb, 2007

1 commit

  • After Al Viro (finally) succeeded in removing the sched.h #include in module.h
    recently, it makes sense again to remove other superfluous sched.h includes.
    There are quite a lot of files which include it but don't actually need
    anything defined in there. Presumably these includes were once needed for
    macros that used to live in sched.h, but moved to other header files in the
    course of cleaning it up.

    To ease the pain, this time I did not fiddle with any header files and only
    removed #includes from .c-files, which tend to cause less trouble.

    Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
    arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
    allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
    configs in arch/arm/configs on arm. I also checked that no new warnings were
    introduced by the patch (actually, some warnings are removed that were emitted
    by unnecessarily included header files).

    Signed-off-by: Tim Schmielau
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

13 Feb, 2007

1 commit

  • Many struct file_operations in the kernel can be "const". Marking them const
    moves these to the .rodata section, which avoids false sharing with potential
    dirty data. In addition it'll catch accidental writes at compile time to
    these shared resources.

    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

01 Jul, 2006

1 commit


12 Mar, 2006

1 commit

  • Add device-major aliases in drivers/scsi, allowing kmod autoload:

    MODULE_ALIAS_CHARDEV_MAJOR(SCSI_CHANGER_MAJOR)
    MODULE_ALIAS_CHARDEV_MAJOR(OSST_MAJOR)
    MODULE_ALIAS_CHARDEV_MAJOR(SCSI_TAPE_MAJOR)
    MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_CDROM_MAJOR)
    MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISKN_MAJOR)

    Signed-off-by: Andrew Morton
    Acked-by: Kai Makisara
    Signed-off-by: James Bottomley

    Rene Herman
     

13 Jan, 2006

1 commit


11 Jan, 2006

1 commit


14 Dec, 2005

1 commit


05 Nov, 2005

1 commit


29 Oct, 2005

2 commits


11 Sep, 2005

1 commit


10 Sep, 2005

1 commit


29 Aug, 2005

1 commit


30 Jul, 2005

1 commit


21 May, 2005

2 commits