Bart Van Assche
292f72e16d
scst_local: Fix unique per session sas address
...
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5960 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-07 09:20:06 +00:00
Bart Van Assche
9cd602de2f
Update for kernel 3.18
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5955 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 13:10:41 +00:00
Bart Van Assche
2fb7c084d7
Add kernel 3.17 build infrastructure
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5883 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-11-26 08:05:09 +00:00
Bart Van Assche
daa3c9a075
scst_local: Restore support for detecting LUN 16383 via a sequential scan
...
Reported-by: Sebastian Herbszt <herbszt@gmx.de >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5820 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-09-30 11:07:38 +00:00
Bart Van Assche
173fdd5f20
scst_local: Set max_id to 1
...
The value 0 is not valid for the max_id member of struct Scsi_Host.
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5786 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-09-09 11:27:27 +00:00
Bart Van Assche
2452405735
scst_local: Change max_lun into SCST_MAX_LUN (16383)
...
Today SCST does not support LUN numbers >= 16384. Additionally,
there is a bug in older Linux initiator systems that prevents
proper handling of LUN numbers >= 2**32. See also Hannes Reinecke,
scsi_scan: Fixup scsilun_to_int(), June 25, 2014 (commit ID
d9e5d6183715e691b37afd3785c311d05cd1338d). Hence set max_lun to
16383.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5785 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-09-09 11:09:20 +00:00
Bart Van Assche
12430f9b46
nightly build: Add kernel 3.16 nightly build infrastructure
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5719 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-08-20 06:55:04 +00:00
Bart Van Assche
2ab81dfa2e
scst_local: Avoid that session deletion triggers a kernel warning
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5631 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-28 20:15:45 +00:00
Bart Van Assche
e902f79ecf
kernel module installation: Skip "depmod" when building an RPM
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5612 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-19 12:48:25 +00:00
Bart Van Assche
1fdd3d9a8d
nightly build: Add kernel 3.15 build infrastructure
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5611 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-19 07:09:53 +00:00
Vladislav Bolkhovitin
14f4e35b64
scst_local: Add close_session() callback function
...
This is useful for triggering the session reassignment code via
the scst_local driver.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5601 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-13 22:31:42 +00:00
Vladislav Bolkhovitin
523fe73096
Forgotten versions updated
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5597 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-13 05:03:17 +00:00
Vladislav Bolkhovitin
a2feffdcfe
scst_local: Support LUN numbers >= 16384
...
Add support for 32-bit LUN numbers. As soon as the patches that add
64-bit LUN support are upstream this patch will also make 64-bit
LUN support available in scst_local.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5588 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-11 21:00:16 +00:00
Bart Van Assche
2b2b47bb85
nightly build: Add kernel 3.14 build infrastructure
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5433 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-18 05:50:04 +00:00
Vladislav Bolkhovitin
eae78fb98c
scst_local: Remove two superfluous tests
...
The to_scst_lcl_sess() macro is based on container_of() and hence never
returns NULL. Hence remove the two tests that compare the result of that
macro against NULL.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5385 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-26 03:20:04 +00:00
Bart Van Assche
93b4c863dc
scst_local: Add newline to sysfs output
...
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de >
[bvanassche: Reduced source code line length to 80 columns]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5308 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-24 07:39:45 +00:00
Bart Van Assche
7d89372c53
Makefiles: respect DESTDIR when specified
...
Not all SCST components handle DESTDIR properly, or at all.
In particular:
* INSTALL_MOD_PATH should account for DESTDIR when 'make modules_install'
is invoked, so the kernel make infrastructure deploys the modules
and runs depmod against the proper directory tree.
* depmods must include a '-b' option to reference the proper directory tree.
* Drop special ISCSI_DESTDIR.
Signed-off-by: Steven J. Magnani <steve@digidescorp.com >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5289 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-18 08:40:36 +00:00
Bart Van Assche
79b8ce942e
Makefiles: calculate KVER properly
...
When deriving the kernel version (KVER) from KDIR, the file
$(KDIR)/include/config/kernel.release should be preferred over
'make kernelversion'.
For example, the Ubuntu 3.2.0-23-generic kernel has a kernel.release
file containing '3.2.0-23-generic', but 'make kernelversion' returns
3.2.14. Since the modules are stored under /lib/modules/3.2.0-23-generic,
the value in kernel.release is the correct one to use.
Also:
- Evaluate KVER only once
- All depmod commands must include KVER
Signed-off-by: Steven J. Magnani <steve@digidescorp.com >
[bvanassche: Split long lines / removed trailing whitespace]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5286 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-14 15:52:10 +00:00
Bart Van Assche
e07a91e8a0
Makefiles: remove redundant 'depmod' invocations
...
Running 'make modules_install' already triggers invocation of depmod,
hence leave it out from those Makefiles that use 'make modules_install'.
Signed-off-by: Steven J. Magnani <steve@digidescorp.com >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5283 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-14 13:05:55 +00:00
Bart Van Assche
cf699a6d95
scst_local: Fix a kernel oops for kernel versions < 2.6.37
...
Avoid that scst_local triggers "BUG: unable to handle kernel NULL
pointer dereference" on kernel versions before 2.6.37. This patch
fixes a regression introduced via patch "scst_local: Avoid
deadlock during module removal with kernel 3.6" (trunk r4566).
Reported-by: Sebastian Herbszt <herbszt@gmx.de >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5264 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-06 12:46:51 +00:00
Bart Van Assche
7f1c22cbee
nightly build: Add kernel 3.13 build infrastructure
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5251 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-30 09:16:27 +00:00
Vladislav Bolkhovitin
00851a7501
Merge of adding iSER web page and copyright updates from the iSER branch
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5241 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 05:17:26 +00:00
Bart Van Assche
f5a8248cb7
nightly build: Add kernel 3.12 build infrastructure
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5164 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-12-19 08:07:15 +00:00
Vladislav Bolkhovitin
81349d12a7
scst: Kernel >= 3.10 procfs build fix
...
The following procfs-related changes have been included in kernel 3.10:
- The PDE() macro has been removed from <linux/proc_fs.h>.
- The create_proc_entry() function has been removed.
- The proc_info field has been removed from struct scsi_host_template.
Unbreak the procfs build for kernel versions >= 3.10
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5148 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-12-18 05:58:09 +00:00
Vladislav Bolkhovitin
1e4010ce25
Cleanup
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5082 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-31 03:48:59 +00:00
Bart Van Assche
dad77aead4
nightly build: Add kernel 3.11 build infrastructure
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5006 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-09-28 16:04:47 +00:00
Bart Van Assche
89e96c6495
nightly build: Add kernel 3.10 support infrastructure
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4919 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-07-22 18:35:37 +00:00
Vladislav Bolkhovitin
29ff2f8c23
Cleanup: spin_is_locked() makes no sense on UP systems
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4885 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-28 03:59:57 +00:00
Bart Van Assche
11fdb1bf29
nightly build: Add kernel 3.9 build infrastructure
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4855 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-18 16:04:24 +00:00
Vladislav Bolkhovitin
0339bb8905
This change causes "make -C <dir> clean" to work. Also, use SUBDIRS=...
...
instead of M=... because of consistency with the rest of the Makefile.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4829 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-29 01:19:24 +00:00
Vladislav Bolkhovitin
e4fb5201e9
RHEL 5 does not support queue_flag_set_unlocked(). Hence disable the
...
queue_flag_set_unlocked() call on RHEL 5.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4828 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-29 01:18:09 +00:00
Vladislav Bolkhovitin
2cadcc2c64
Cache alignment review
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4809 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-23 01:38:31 +00:00
Vladislav Bolkhovitin
82d055041c
Improve automatic queue depth adjustment in scst_local for older kernels
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4800 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-16 02:02:55 +00:00
Vladislav Bolkhovitin
3a84cb7baf
Automatic queue depth adjustment in scst_local
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4798 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-16 01:10:43 +00:00
Vladislav Bolkhovitin
369863f015
Allow install SCST in any location
...
Currently the install location of SCST is pretty much hard coded into
the Makefiles to be /usr/local.
I am custom building a system for ZFS & SCST and I want to install in
/usr instead of /usr/local.
Currently I am doing a “find . -name Makefile -exec sed -i 's:/usr/local:/usr:g'
{} \;” to accommodate this.
This patch fixes it.
From Sietse van Zanen <sietse@wizdom.nu >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4791 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-08 21:25:45 +00:00
Vladislav Bolkhovitin
b9c0b9d92d
Another micro-optimization: cache align all fast path structures
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4785 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-04 23:51:16 +00:00
Bart Van Assche
52f0d63ee6
nightly build: Add kernel 3.8 support files
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4769 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-23 13:47:51 +00:00
Vladislav Bolkhovitin
10ca1d2f20
Copyrights updated
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4767 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-20 02:05:29 +00:00
Vladislav Bolkhovitin
bd7c893f04
Multiple makefiles: autodetect SCST include directory
...
It is cumbersome to change SCST_INC_DIR and SCST_DIR in each Makefile
before and after a release. Hence modify the Makefiles such that these
paths are detected automatically.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4740 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-16 00:12:38 +00:00
Vladislav Bolkhovitin
c6d247254c
scst_local: Remove a superfluous include path
...
Target drivers must not include header files from the SCST source
code directory. Hence remove -I$(SCST_DIR) from the compiler flags.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4739 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-16 00:08:44 +00:00
Vladislav Bolkhovitin
e7e9101efd
Automate release archive generation
...
This patch makes it easier to generate the release archives that
can be downloaded from http://scst.sourceforge.net/downloads.html .
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4679 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-04 00:29:30 +00:00
Vladislav Bolkhovitin
1f600fcc91
scst_local: Fix bug in error path
...
device_unregister() invokes scst_local_release_adapter() and hence unregisters
the session. Avoid that it is attempted a second time to unregister the
session which would result in a crash.
[3656]: scst: scst_unregister_target:680:Target local for template scst_local unregistered successfully
[3656]: scst: scst_unregister_target_template:457:Target template scst_local unregistered successfully
[3655]: scst_unregister_session:6795:Unregistering session ffff8800071a0000 (wait 0)
general protection fault: 0000 [#1 ] SMP
Modules linked in: iscsi_scst(O) scst_vdisk(O) scst(O) ntfs vfat msdos fat ext3 jbd ext2 brd netconsole configfs isofs ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi joydev hid_generic binfmt_misc usbhid hid intel_agp psmouse intel_gtt processor agpgart microcode i2c_piix4 button lp parport ext4 mbcache jbd2 floppy ata_piix zlib_deflate libcrc32c [last unloaded: scst_local]
CPU 1
Pid: 3655, comm: scsi_id Tainted: G O 3.6.5-debug+ #1 Bochs Bochs
RIP: 0010:[<ffffffffa0221a74>] [<ffffffffa0221a74>] scst_pre_rx_mgmt_cmd+0x64/0x210 [scst]
RSP: 0018:ffff88000304d598 EFLAGS: 00010246
RAX: 6b6b6b6b6b6b6b6b RBX: 0000000000000001 RCX: 0000000000000000
RDX: 0000000000000001 RSI: 000000000000000a RDI: ffff8800071a0000
RBP: ffff88000304d5c8 R08: 0000000000000002 R09: 0000000000000000
R10: 000000000000c81d R11: 0000000000000000 R12: ffff8800071a0000
R13: 000000000000000a R14: 0000000000000000 R15: ffff880000000000
FS: 00007fb6fe8c6700(0000) GS:ffff88003e000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00007f2169286bd0 CR3: 000000001cd26000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process scsi_id (pid: 3655, threadinfo ffff88000304c000, task ffff88003d9a0000)
Stack:
0000000000000000 0000000000000282 ffff88000304d650 0000000000000000
ffff8800071a0000 dead4ead00000000 ffff88000304d638 ffffffffa0221fdf
0000000000000004 0000000000000000 ffff88000304d5f8 ffffffffa025d6a3
Call Trace:
[<ffffffffa0221fdf>] scst_rx_mgmt_fn+0x7f/0x3a0 [scst]
[<ffffffffa025d6a3>] ? spin_unlock_irqrestore.constprop.0+0x13/0x20 [scst]
[<ffffffffa025d825>] ? debug_print_with_prefix+0x165/0x1f0 [scst]
[<ffffffffa022acaa>] scst_rx_mgmt_fn_lun.constprop.34+0x4a/0x60 [scst]
[<ffffffffa022adf1>] scst_unregister_session+0x131/0x320 [scst]
[<ffffffff812bfce7>] ? device_release+0x27/0xa0
[<ffffffff8120450b>] ? kobject_release+0x8b/0x1d0
[<ffffffff8120438c>] ? kobject_put+0x2c/0x60
[<ffffffff812bfa97>] ? put_device+0x17/0x20
[<ffffffff812de820>] ? scsi_host_dev_release+0xc0/0xe0
[<ffffffff812bfce7>] ? device_release+0x27/0xa0
[<ffffffff8120450b>] ? kobject_release+0x8b/0x1d0
[<ffffffff8120438c>] ? kobject_put+0x2c/0x60
[<ffffffff812bfa97>] ? put_device+0x17/0x20
[<ffffffff812e7102>] ? scsi_target_dev_release+0x22/0x30
[<ffffffff812bfce7>] ? device_release+0x27/0xa0
[<ffffffff8120450b>] ? kobject_release+0x8b/0x1d0
[<ffffffff8120438c>] ? kobject_put+0x2c/0x60
[<ffffffff812bfa97>] ? put_device+0x17/0x20
[<ffffffff812ea858>] ? scsi_device_dev_release_usercontext+0x108/0x120
[<ffffffff812ea750>] ? scsi_device_cls_release+0x20/0x20
[<ffffffff8105a996>] ? execute_in_process_context+0x86/0xa0
[<ffffffff812ea72c>] ? scsi_device_dev_release+0x1c/0x20
[<ffffffff812bfce7>] ? device_release+0x27/0xa0
[<ffffffff8120450b>] ? kobject_release+0x8b/0x1d0
[<ffffffff8120438c>] ? kobject_put+0x2c/0x60
[<ffffffff812bfa97>] ? put_device+0x17/0x20
[<ffffffff812dc534>] ? scsi_device_put+0x44/0x60
[<ffffffff812f685d>] ? scsi_cd_put+0x4d/0x70
[<ffffffff812f69b0>] ? sr_block_open+0xd0/0x120
[<ffffffff81184389>] ? __blkdev_get+0xe9/0x4a0
[<ffffffff81183bb4>] ? bd_acquire+0x24/0xf0
[<ffffffff81184a90>] ? blkdev_get+0x350/0x350
[<ffffffff81184793>] ? blkdev_get+0x53/0x350
[<ffffffff81156a72>] ? complete_walk+0x52/0x140
[<ffffffff81184a90>] ? blkdev_get+0x350/0x350
[<ffffffff814ac49b>] ? _raw_spin_unlock+0x2b/0x50
[<ffffffff81184a90>] ? blkdev_get+0x350/0x350
[<ffffffff81184afc>] ? blkdev_open+0x6c/0x90
[<ffffffff81148fb6>] ? do_dentry_open.isra.19+0x216/0x2a0
[<ffffffff81149062>] ? finish_open+0x22/0x40
[<ffffffff8115a62e>] ? do_last+0x72e/0xe20
[<ffffffff811572d8>] ? inode_permission+0x18/0x50
[<ffffffff8115737b>] ? link_path_walk+0x6b/0x930
[<ffffffff8115add6>] ? path_openat+0xb6/0x4a0
[<ffffffff81097c9d>] ? trace_hardirqs_on+0xd/0x10
[<ffffffff8115b5d2>] ? do_filp_open+0x42/0xa0
[<ffffffff814ac49b>] ? _raw_spin_unlock+0x2b/0x50
[<ffffffff81168802>] ? alloc_fd+0xd2/0x120
[<ffffffff8114a150>] ? do_sys_open+0x100/0x1e0
[<ffffffff8114a251>] ? sys_open+0x21/0x30
[<ffffffff814b5029>] ? system_call_fastpath+0x16/0x1b
Code: 00 00 65 48 8b 04 25 80 ba 00 00 8b b0 94 01 00 00 48 c7 c2 a0 b8 26 a0 31 c0 48 c7 c7 45 e0 27 a0 e8 23 15 28 e1 49 8b 44 24 08 <48> 8b 40 30 48 83 78 50 00 0f 84 52 01 00 00 83 fb 01 19 ff 81
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4658 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-20 02:32:25 +00:00
Bart Van Assche
12313bf114
nightly build: Add kernel 3.7 patches
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4647 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-18 08:54:50 +00:00
Vladislav Bolkhovitin
010dd8b7ec
scst_local: Rework scst_local_get_initiator_port_transport_id() to make it easier to read and to verify
...
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4636 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-29 01:29:49 +00:00
Vladislav Bolkhovitin
486a3bcd34
scst_local: Remove superfluous casts
...
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4635 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-29 01:25:59 +00:00
Bart Van Assche
a88ccc6231
scst_local, RHEL 5: Avoid that AEN handling triggers a deadlock during device removal
...
Signed-off-by: Richard Sharpe <realrichardsharpe@gmail.com >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4613 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-12 12:37:19 +00:00
Vladislav Bolkhovitin
fab0164c55
scst_local: Avoid deadlock during module removal with kernel 3.6
...
Since kernel 3.6 a SYNCHRONIZE CACHE command is sent to SCSI disks
during the scsi_remove_host() call. That command is sent after command
processing has been suspended in SCST and hence causes a deadlock.
Avoid this deadlock by failing all commands issued after
scst_unregister_target() has been invoked.
The output of echo w >/proc/sysrq-trigger just after module removal of
scst_local started is as follows:
SysRq : Show Blocked State
task PC stack pid father
kworker/2:1 D ffff88003d08cf40 0 37 2 0x00000000
ffff88003d0bd830 0000000000000046 ffffffff814a849e ffff88003d08cf40
ffff88003d08cf40 ffff88003d0bdfd8 ffff88003d0bdfd8 ffff88003d0bdfd8
ffff88003d9a3b70 ffff88003d08cf40 0000000000000282 ffff88003d0bd860
Call Trace:
[<ffffffff814a849e>] ? schedule_timeout+0x12e/0x230
[<ffffffff814aabc9>] schedule+0x29/0x70
[<ffffffff814a84a3>] schedule_timeout+0x133/0x230
[<ffffffff8104cc00>] ? __internal_add_timer+0x140/0x140
[<ffffffff814aaa72>] wait_for_common+0x122/0x170
[<ffffffff81074050>] ? try_to_wake_up+0x2c0/0x2c0
[<ffffffff814aab73>] wait_for_completion_timeout+0x13/0x20
[<ffffffff811edc2b>] blk_execute_rq+0x17b/0x200
[<ffffffff814aa993>] ? wait_for_common+0x43/0x170
[<ffffffff81180a51>] ? bio_phys_segments+0x21/0x30
[<ffffffff811e8cf0>] ? blk_rq_bio_prep+0x30/0xb0
[<ffffffff812e46ee>] scsi_execute+0xee/0x180
[<ffffffff812e58ed>] scsi_execute_req+0xbd/0x130
[<ffffffff812f55c0>] sr_check_events+0xc0/0x2d0
[<ffffffff81076218>] ? sched_clock_cpu+0xa8/0x110
[<ffffffff8131e1cc>] cdrom_check_events+0x1c/0x40
[<ffffffff812f5a39>] sr_block_check_events+0x19/0x20
[<ffffffff811f0e32>] disk_events_workfn+0x62/0x160
[<ffffffff8105affe>] process_one_work+0x1ae/0x620
[<ffffffff8105af9d>] ? process_one_work+0x14d/0x620
[<ffffffff811f0dd0>] ? __disk_unblock_events+0x130/0x130
[<ffffffff8105ce97>] worker_thread+0x187/0x4e0
[<ffffffff8105cd10>] ? manage_workers+0x320/0x320
[<ffffffff81062a07>] kthread+0xb7/0xc0
[<ffffffff81097b35>] ? trace_hardirqs_on_caller+0x105/0x190
[<ffffffff814b5d04>] kernel_thread_helper+0x4/0x10
[<ffffffff814ac870>] ? retint_restore_args+0x13/0x13
[<ffffffff81062950>] ? flush_kthread_work+0x1e0/0x1e0
[<ffffffff814b5d00>] ? gs_change+0x13/0x13
rmmod D ffff88001d46a7a0 0 10456 10437 0x00000004
ffff8800393cd7a8 0000000000000046 ffffffff814a849e ffff88001d46a7a0
ffff88001d46a7a0 ffff8800393cdfd8 ffff8800393cdfd8 ffff8800393cdfd8
ffffffff81a13420 ffff88001d46a7a0 0000000000000282 ffff8800393cd7d8
Call Trace:
[<ffffffff814a849e>] ? schedule_timeout+0x12e/0x230
[<ffffffff814aabc9>] schedule+0x29/0x70
[<ffffffff814a84a3>] schedule_timeout+0x133/0x230
[<ffffffff8104cc00>] ? __internal_add_timer+0x140/0x140
[<ffffffff814aaa72>] wait_for_common+0x122/0x170
[<ffffffff81074050>] ? try_to_wake_up+0x2c0/0x2c0
[<ffffffff814aab73>] wait_for_completion_timeout+0x13/0x20
[<ffffffff811edc2b>] blk_execute_rq+0x17b/0x200
[<ffffffff814aa993>] ? wait_for_common+0x43/0x170
[<ffffffff81063000>] ? __init_waitqueue_head+0x60/0x60
[<ffffffff812e46ee>] scsi_execute+0xee/0x180
[<ffffffff812e58ed>] scsi_execute_req+0xbd/0x130
[<ffffffff812f07a8>] sd_sync_cache+0x98/0x120
[<ffffffff812f0a40>] sd_shutdown+0xd0/0x150
[<ffffffff812f0b3c>] sd_remove+0x7c/0xc0
[<ffffffff812c3e6c>] __device_release_driver+0x7c/0xf0
[<ffffffff812c3f0e>] device_release_driver+0x2e/0x40
[<ffffffff812c380f>] bus_remove_device+0xff/0x170
[<ffffffff812c099d>] device_del+0x12d/0x1c0
[<ffffffff812eae1d>] __scsi_remove_device+0x10d/0x120
[<ffffffff812e97ef>] scsi_forget_host+0x6f/0x80
[<ffffffff812deb8a>] scsi_remove_host+0x7a/0x130
[<ffffffffa0287bea>] scst_local_driver_remove+0x5a/0x120 [scst_local]
[<ffffffff812c3e6c>] __device_release_driver+0x7c/0xf0
[<ffffffff812c3f0e>] device_release_driver+0x2e/0x40
[<ffffffff812c380f>] bus_remove_device+0xff/0x170
[<ffffffff812c099d>] device_del+0x12d/0x1c0
[<ffffffffa028ae21>] ? scst_local_exit+0x6b/0x24a [scst_local]
[<ffffffff812c0a52>] device_unregister+0x22/0x60
[<ffffffffa0287649>] scst_local_remove_adapter+0x59/0xd0 [scst_local]
[<ffffffffa02880ab>] __scst_local_remove_target+0x7b/0x130 [scst_local]
[<ffffffffa028ae3a>] scst_local_exit+0x84/0x24a [scst_local]
[<ffffffff810a2d26>] sys_delete_module+0x1a6/0x2b0
[<ffffffff814ac855>] ? retint_swapgs+0x13/0x1b
[<ffffffff8120ebfe>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<ffffffff814b4b29>] system_call_fastpath+0x16/0x1b
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4566 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-23 01:08:47 +00:00
Bart Van Assche
b2567396f8
nightly build: Add kernel 3.6 support patches
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4539 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-02 08:17:58 +00:00
Vladislav Bolkhovitin
d2d0c488aa
scst_local_add_target(): Also set *out_tgt upon failure
...
Although the callers of scst_local_add_target() do not use the
value of *out_tgt if scst_local_add_target() reports that it failed,
set *out_tgt in that case to avoid that sparse reports the following
(false positive) warning:
scst_local/scst_local.c:1807: warning: 'tgt' may be used uninitialized in this function
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4534 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-29 22:33:20 +00:00
Vladislav Bolkhovitin
8ce28aaba2
Avoid that enabling a target too quickly triggers a crash
...
The sysfs attributes of a target can be accessed before scst_tgt.tgt_priv
has been set. Avoid that such an access triggers a crash.
Symptom:
BUG: unable to handle kernel NULL pointer dereference at 000000000000004c
IP: [<ffffffffa1345848>] iscsi_is_target_enabled+0x8/0x20 [iscsi_scst]
PGD 150a4c067 PUD 13cacb067 PMD 0
Oops: 0000 [#1 ] SMP
CPU 1
Modules linked in: zfs(P) iscsi_scst(O) scst_vdisk(O) scst(O) zcommon(P) znvpair(P) zavl(P) zunicode(P) spl(O) [last unloaded: zfs]
Pid: 3974, comm: scst_uid1864 Tainted: P O 3.2.23-zfsiscsi-std-ipv6-64 #3 Supermicro X6DVA/X6DVA
RIP: 0010:[<ffffffffa1345848>] [<ffffffffa1345848>] iscsi_is_target_enabled+0x8/0x20 [iscsi_scst]
RSP: 0018:ffff88015071ddc0 EFLAGS: 00010282
RAX: 0000000000000000 RBX: ffff880181fdaa00 RCX: ffff88012d41f380
RDX: ffff88015071c010 RSI: 0000000000000000 RDI: ffff880181fdaa00
RBP: ffff88015071ddc0 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffa134a608
R13: 0000000000000000 R14: 0000000000000129 R15: ffffffffa134a4c0
FS: 0000000000000000(0000) GS:ffff88019fc80000(0000)
knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 000000000000004c CR3: 0000000151927000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process scst_uid1864 (pid: 3974, threadinfo ffff88015071c000, task ffff880194d57500)
Stack:
ffff88015071de10 ffffffffa12ee89a 00000000fffffffc 01ff88015071de98
ffff88015071de80 ffff8801932a48d8 00000000fffffffc ffff88015071de98
ffff88015071de80 ffff880194d57500 ffff88015071de30 ffffffffa12f582e
Call Trace:
[<ffffffffa12ee89a>] __scst_is_relative_target_port_id_unique+0x6a/0xc0 [scst]
[<ffffffffa12f582e>] gen_relative_target_port_id+0x6e/0xd0 [scst]
[<ffffffffa12fdb8a>] scst_tgt_enable_store_work_fn+0x3a/0xe0 [scst]
[<ffffffffa12f9397>] sysfs_work_thread_fn+0xc7/0x2e0 [scst]
[<ffffffffa12f92d0>] ? scst_tgtt_release+0x20/0x20 [scst]
[<ffffffffa12f92d0>] ? scst_tgtt_release+0x20/0x20 [scst]
[<ffffffff810b44f6>] kthread+0x96/0xa0
[<ffffffff81b8ed74>] kernel_thread_helper+0x4/0x10
[<ffffffff810b4460>] ? kthread_worker_fn+0x180/0x180
[<ffffffff81b8ed70>] ? gs_change+0xb/0xb
Code: 42 c8 74 0f 39 78 48 75 ea c9 c3 0f 1f 84 00 00 00 00 00 31 c0 c9 c3 66 66 66 2e 0f 1f 84 00 00 00 00 00 48 8b 47 48 55 48 89 e5 <0f> b6 40 4c c9 83 e0 01 c3 66 66 66 66 66 66 2e 0f 1f 84 00 00
RIP [<ffffffffa1345848>] iscsi_is_target_enabled+0x8/0x20 [iscsi_scst]
RSP <ffff88015071ddc0>
CR2: 000000000000004c
---[ end trace 6311d4069703be07 ]---
Reported-by: Etienne Dechamps <e-t172@akegroup.org >
Signed-off-by: Bart Van Assche <bvanassche@acm.org > with some modifications
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4515 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-12 22:13:43 +00:00