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 -0700SCSI: 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-HartmanThe 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
15 Jul, 2008
1 commit
21 Jun, 2008
1 commit
-
Add lock_kernel() calls to ch_open(), though the existing locking looks
adequate.Signed-off-by: Jonathan Corbet
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
20 Apr, 2008
1 commit
-
It's big, but there doesn't seem to be a way to split it up smaller...
Signed-off-by: Tony Jones
Signed-off-by: Kay Sievers
Cc: Roland Dreier
Cc: Sean Hefty
Cc: Hal Rosenstock
Cc: James Bottomley
Signed-off-by: Greg Kroah-Hartman
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 hereReplace 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 hereSigned-off-by: Harvey Harrison
Signed-off-by: James Bottomley
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 -
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
24 Jan, 2008
2 commits
-
When class_device_create fails, ch_probe needs to fail too.
Signed-off-by: FUJITA Tomonori
Signed-off-by: James Bottomley -
As of now, compat_ioctl already runs without the BKL, whereas ioctl runs
with the BKL. This patch first converts changer_fops to use a .unlocked_ioctl
member. It applies the same locking rationale than ch_ioctl_compat() uses
to ch_ioctl().Signed-off-by: Mathieu Segaud
Reviewed-by: Matthew Wilcox
Signed-off-by: James Bottomley
06 May, 2007
1 commit
-
Replacing kmalloc/memset combination with kzalloc.
Signed-off-by: vignesh babu
Signed-off-by: James Bottomley
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
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
01 Jul, 2006
1 commit
-
Signed-off-by: Jörn Engel
Signed-off-by: Adrian Bunk
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
13 Jan, 2006
1 commit
-
the scsi layer is using semaphores in a mutex way, this patch converts
these into using mutexes insteadSigned-off-by: Arjan van de Ven
Signed-off-by: James Bottomley
11 Jan, 2006
1 commit
-
These days ioctl32.h is only used for communication of fs/compat.c and
fs/compat_ioctl.c and doesn't contain anything of interest to drivers.Remove inclusion in various drivers.
Signed-off-by: Christoph Hellwig
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
14 Dec, 2005
1 commit
-
patch below marks a few scsi core datastructures as const, so that they end up
in the .rodata section and don't cacheline share with things that get dirtiedSigned-off-by: Arjan van de Ven
Signed-off-by: James Bottomley
05 Nov, 2005
1 commit
-
Conflicts in dec_esp.c (Thanks Bacchus), scsi_transport_iscsi.c and
scsi_transport_fc.hSigned-off-by: James Bottomley
29 Oct, 2005
2 commits
-
Rejections fixed up and
Signed-off-by: James Bottomley -
The previous patch adding the ability to nest struct class_device
changed the paramaters to the call class_device_create(). This patch
fixes up all in-kernel users of the function.Signed-off-by: Greg Kroah-Hartman
11 Sep, 2005
1 commit
-
Signed-off-by: Al Viro
Signed-off-by: Linus Torvalds
10 Sep, 2005
1 commit
-
This converts the final 20 DEFINE_SPINLOCK holdouts. (another 580 places
are already using DEFINE_SPINLOCK). Build tested on x86.Signed-off-by: Ingo Molnar
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
29 Aug, 2005
1 commit
-
I also tinkered with it's sense recognition routines to make them take
scsi_sense_hdr structures instead of raw sense data.Signed-off-by: James Bottomley
30 Jul, 2005
1 commit
-
It seems very unlikely that this driver will go into any stable kernel
before devfs will be removed.Signed-off-by: Adrian Bunk
Cc: James Bottomley
Signed-off-by: Andrew Morton
Signed-off-by: James Bottomley
21 May, 2005
2 commits
-
Here is a incremental patch which switches the driver over to
the new non-simple functions. Compile-tested.Signed-off-by: Gerd Knorr
Signed-off-by: James Bottomley -
This patch adds a device driver for scsi media changer devices.
Signed-off-by: Gerd Knorr
Signed-off-by: James Bottomley