Bart Van Assche
0121fc8a55
ib_srpt: Update Testing.txt
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4661 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-21 12:02:53 +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
Vladislav Bolkhovitin
55a596b073
Fix missed locking
...
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4657 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-20 02:26:28 +00:00
Vladislav Bolkhovitin
5fe3432935
scst_get_unique_sess_name(): Handle out-of-memory properly
...
Return NULL instead of triggering a NULL pointer dereference if out
of memory. Detected by Coverity.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4656 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-20 02:20:24 +00:00
Vladislav Bolkhovitin
47db473269
Remove a superfluous pair of braces
...
Avoid that checkpatch v3.7 reports the following warning:
WARNING: braces {} are not necessary for any arm of this statement
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4655 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-20 02:17:23 +00:00
Bart Van Assche
0d0b4e5af1
nightly build: Add kernel 3.7
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4654 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-19 07:37:32 +00:00
Bart Van Assche
4b08a03293
nightly build: Update kernel versions
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4653 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-18 17:04:45 +00:00
Bart Van Assche
0fd03d44b1
srpt/Testing.txt: Limit to 80 columns
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4652 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-18 09:51:08 +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
Bart Van Assche
2a50de2e4e
iscsi-scst: Build fix for kernels 3.6.1..3.6.10
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4646 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-18 08:22:05 +00:00
Vladislav Bolkhovitin
299c407697
Update for kernel 3.7
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4645 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-17 23:09:58 +00:00
Vladislav Bolkhovitin
d178fa8da9
qla2x00t: Avoid reading uninitialized memory
...
Reported-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4644 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-13 21:28:10 +00:00
Vladislav Bolkhovitin
df9b760738
PR: Compute scope field correctly
...
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4643 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-13 21:08:29 +00:00
Vladislav Bolkhovitin
c7c0672b51
Fir corner case handling in vdisk_attach_tgt()
...
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
Reported-by: Sebastian Riemer <sebastian.riemer@profitbricks.com >
Tested-by: Sebastian Riemer <sebastian.riemer@profitbricks.com >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4642 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-13 21:06:17 +00:00
Vladislav Bolkhovitin
e9ce622422
scst, persistent reservations: Fix a locking error
...
Avoid that a command like sg_raw -r256 /dev/sda 5e 04 00 00 00 00 00 20 00 00
triggers the following error messages on a kernel with PROVE_LOCKING enabled:
=====================================
[ BUG: bad unlock balance detected! ]
3.7.0-rc5-debug+ #1 Tainted: G O
-------------------------------------
disk010_1/9985 is trying to release lock (&dev->dev_pr_mutex) at:
[<ffffffff814b742e>] mutex_unlock+0xe/0x10
but there are no more locks to release!
other info that might help us debug this:
no locks held by disk010_1/9985.
stack backtrace:
Pid: 9985, comm: disk010_1 Tainted: G O 3.7.0-rc5-debug+ #1
Call Trace:
[<ffffffff8109598e>] print_unlock_inbalance_bug+0xfe/0x110
[<ffffffff81098bc6>] lock_release+0x1f6/0x260
[<ffffffff814b734a>] __mutex_unlock_slowpath+0x9a/0x170
[<ffffffff814b742e>] mutex_unlock+0xe/0x10
[<ffffffffa02d7d0f>] scst_pr_write_unlock+0x4f/0xd0 [scst]
[<ffffffffa02db83c>] scst_persistent_reserve_in_local+0x2cc/0x470 [scst]
[<ffffffffa02d99bf>] scst_do_local_exec+0x15f/0x1c0 [scst]
[<ffffffffa02e35d0>] scst_exec_check_blocking+0xd0/0x2c0 [scst]
[<ffffffffa02e3955>] scst_exec_check_sn+0x195/0x2f0 [scst]
[<ffffffffa02e5249>] scst_process_active_cmd+0x549/0x780 [scst]
[<ffffffffa02e5509>] scst_do_job_active+0x89/0x1a0 [scst]
[<ffffffffa02e5883>] scst_cmd_thread+0x183/0x310 [scst]
[<ffffffff81063ccd>] kthread+0xed/0x100
[<ffffffff814c2aac>] ret_from_fork+0x7c/0xb0
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4641 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-12 00:09:11 +00:00
Vladislav Bolkhovitin
ed9ac5b9de
Cleanup
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4640 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-11 02:57:16 +00:00
Mark Buechler
e75a90ef5e
Fix 0-named groups. Patch by Alexey Obitotskiy, originally identified by Marcin Haba.
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4639 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-05 15:14:30 +00:00
Vladislav Bolkhovitin
0bf88c8f96
Let's do attributes creation in a generic way
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4638 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-04 01:43:22 +00:00
Vladislav Bolkhovitin
eb0fcbb1ef
Explicit confirmations and abort ISP attributes don't make sense on virtual targets
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4637 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-03 23:29:36 +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
b74ed85a0c
iscsi-scst: Fix recently introduced compiler warnings
...
Fix the following two compiler warnings:
chap.c: In function 'chap_rand':
chap.c:347:5: warning: implicit declaration of function 'read' [-Wimplicit-function-declaration]
chap.c:348:5: warning: implicit declaration of function 'close' [-Wimplicit-function-declaration]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4623 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-18 14:27:50 +00:00
Vladislav Bolkhovitin
b30651cda0
Cleanup
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4622 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-14 23:48:52 +00:00
Vladislav Bolkhovitin
b80d55ec5d
Cleanup
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4621 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-14 23:25:03 +00:00
Vladislav Bolkhovitin
e66752b4fc
Make scst_user debug statistics available only in the debug mode
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4620 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-14 21:20:17 +00:00
Bart Van Assche
652a2cf41f
nightly build: Convert bin/nightly from bash to POSIX shell syntax
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4619 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-14 10:42:27 +00:00
Bart Van Assche
dc816a4a16
srpt/Testing.txt: Minor updates
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4618 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-14 08:25:53 +00:00
Vladislav Bolkhovitin
b238320767
target_del(): don't exit on existing sessions
...
Target_del() might has not yet received all connections close events, so
it can still has alive sessions. Wait for them to disappear.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4617 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-13 20:55:51 +00:00
Vladislav Bolkhovitin
fb6219c8d7
LBA should be 64-bit
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4616 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-13 20:41:24 +00:00
Bart Van Assche
ff45bf36a6
scripts/blockdev-perftest: Speed up block device size determination
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4615 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-13 13:20:56 +00:00
Vladislav Bolkhovitin
e2155e10bf
scst: Clarify dev_pr_mutex source code comments
...
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4614 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-13 02:48:45 +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
Bart Van Assche
e838840e6b
scstadmin/Makefile: Use chkconfig on RHEL instead of the LSB scripts
...
chkconfig is installed by default while /usr/lib/lsb/install_initd and
/usr/lib/lsb/remove_initd are not installed by default.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4612 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-09 12:04:58 +00:00
Bart Van Assche
45e27bfa42
scstadmin/Makefile: Clean up whitespace usage
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4611 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-09 10:36:59 +00:00
Vladislav Bolkhovitin
dd4907ea62
scst_pres: Introduce kmemdup()
...
The scst_pr_add_registrant() implementation can be made a little more brief by
using kmemdup() instead of kmalloc() + memcpy().
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4610 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-09 02:11:59 +00:00
Bart Van Assche
413a68a53e
scstadmin, Ubuntu: Use update-rc.d instead of the LSB /usr/lib/lsb/remove_initd - the latter is not installed by default
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4609 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-08 14:25:37 +00:00
Bart Van Assche
37431aae60
/etc/init.d/scst: Wait up to 30s before giving up trying to unload a kernel module
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4608 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-08 14:23:13 +00:00
Bart Van Assche
d3dc18dacb
qla2x00t: Fix spelling in a source code comment
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4607 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-08 10:46:34 +00:00
Vladislav Bolkhovitin
54ffcc75c8
Fix incorrect check for TSIH wrap around
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4606 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-07 22:03:07 +00:00
Vladislav Bolkhovitin
16a97e10d1
Silences a compiler warning reported by Richard Sharpe <realrichardsharpe@gmail.com>
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4605 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-07 03:07:38 +00:00
Vladislav Bolkhovitin
e6bff8a950
Cleanup
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4604 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-06 21:31:51 +00:00
Bart Van Assche
edadea8fd0
ib_srpt: RHEL 5.3 build fix
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4603 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-05 08:53:35 +00:00
Bart Van Assche
544d61036c
scst/src/scst_lib.c: RHEL 5.3 build fix
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4602 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-05 08:40:55 +00:00
Bart Van Assche
e834050d35
scst.h, scst_debug.h, scst_pres.h: RHEL 5.3 build fix
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4601 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-05 08:37:20 +00:00
Bart Van Assche
2b428054e6
scst/include/scst_debug.h: RHEL 5 build fix
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4600 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-05 08:14:56 +00:00
Vladislav Bolkhovitin
7ecc784143
Add forgotten list_del() on session creation error path
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4569 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-03 02:08:40 +00:00
Vladislav Bolkhovitin
5cdfbd1817
Make CHAP random number generator stronger
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4568 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-03 02:03:15 +00:00
Vladislav Bolkhovitin
4cefa1b830
vdisk_fsync() fixes and cleanups
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4567 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-24 21:22:23 +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
Vladislav Bolkhovitin
6b29b72695
- Fix lost residual for allowed to mismatch data transfer direction commands
...
- Fix sending unneeded Control Mode Page MODE SENSE commands. Some devices
may not support this page, so extra calls only fill logs with pointless warnings
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4565 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-23 01:05:31 +00:00