Bart Van Assche
2125cb8400
fcst: Complain when refusing login
...
Log an error message when refusing login because a target port has not yet been enabled
such that fcst users have a way to find out what happened.
Also, make sure that ft_prli() returns a value in the range of the enumeration type
fc_els_spp_resp. Note: since the return value of ft_prli() is only compared against
FC_SPP_RESP_ACK in the current libfc implementation, this change doesn't affect the
behavior of fcst.
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4027 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-21 09:32:18 +00:00
Bart Van Assche
356f2339a7
fcst: add make 2debug / 2release / 2perf support
...
Make "make 2debug / 2release / 2perf support" work for fcst. Add -fno-inline
in debug mode. Remove unused defines. Remove a trailing tab.
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4026 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-21 09:30:19 +00:00
Bart Van Assche
19a0804026
fcst: Avoid that login triggers a crash
...
Fix the following crash triggered by FCoE initiator login:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000002
IP: [<ffffffffa04b282b>] ft_prli+0x4b/0x350 [fcst]
PGD 1a7ba4067 PUD 1a7ba3067 PMD 0
Oops: 0000 [#1 ] SMP
CPU 0
Modules linked in: netconsole configfs ib_srpt fcst scst_vdisk scst
crc32c libcrc32c fcoe libfcoe libfc scsi_transport_fc snd_pcm_oss
snd_mixer_oss snd_seq snd_seq_device af_packet rdma_ucm rdma_cm iw_cm
ib_addr ib_ipoib ib_cm ib_sa ib_uverbs ib_umad mlx4_ib ib_mad ib_core
microcode cpufreq_conservative cpufreq_userspace cpufreq_powersave
acpi_cpufreq mperf dm_mod snd_hda_codec_hdmi snd_hda_codec_analog
snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_timer snd intel_agp
mlx4_core sr_mod sg intel_gtt cdrom soundcore i2c_i801 agpgart
snd_page_alloc i2c_core pcspkr button uhci_hcd sd_mod crc_t10dif
ehci_hcd usbcore edd ext3 mbcache jbd fan ata_generic ata_piix
pata_marvell ahci libahci libata scsi_mod thermal processor
thermal_sys hwmon [last unloaded: scst]
Pid: 3562, comm: fcoethread/0 Not tainted 3.1.5-debug+ #1 System
manufacturer P5Q DELUXE/P5Q DELUXE
RIP: 0010:[<ffffffffa04b282b>] [<ffffffffa04b282b>] ft_prli+0x4b/0x350 [fcst]
RSP: 0018:ffff8801a6273b70 EFLAGS: 00010282
RAX: ffff8801a6273fd8 RBX: 0000000000000000 RCX: 0000000000000006
RDX: 0000000000000001 RSI: 2222222222222222 RDI: 2222222222222222
RBP: ffff8801a6273be0 R08: 2222222222222222 R09: 2222222222222222
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000004
R13: ffff8801a6291c7c R14: ffff8801a6290800 R15: ffff8801a6290848
FS: 0000000000000000(0000) GS:ffff8801bfc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000002 CR3: 00000001a7ba1000 CR4: 00000000000406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process fcoethread/0 (pid: 3562, threadinfo ffff8801a6272000, task
ffff8801b13ecce0)
Stack:
ffff8801a6273bc0 ffffffff812f7593 00000000000000c0 ffff8801b9002a00
0000000000000100 000000000000002c 0000000000000000 ffff8801ae1a4a18
ffff8801b1a1d600 ffff8801a6290800 ffff8801b1a1ce00 ffff8801ae1a4a18
Call Trace:
[<ffffffff812f7593>] ? __alloc_skb+0x83/0x170
[<ffffffffa03b95ec>] fc_rport_enter_prli+0xec/0x220 [libfc]
[<ffffffffa03ba531>] fc_rport_recv_req+0x541/0x1280 [libfc]
[<ffffffff81082e8d>] ? trace_hardirqs_on_caller+0x11d/0x1b0
[<ffffffff813d44ad>] ? mutex_lock_nested+0x26d/0x330
[<ffffffffa03b6c00>] ? fc_lport_recv_els_req+0x30/0x140 [libfc]
[<ffffffffa03b6c1f>] fc_lport_recv_els_req+0x4f/0x140 [libfc]
[<ffffffffa03b5f14>] fc_lport_recv_req+0x174/0x230 [libfc]
[<ffffffffa03b5dd1>] ? fc_lport_recv_req+0x31/0x230 [libfc]
[<ffffffff81082f2d>] ? trace_hardirqs_on+0xd/0x10
[<ffffffffa03b2f6c>] fc_exch_recv+0x63c/0xe50 [libfc]
[<ffffffffa03ce3b8>] fcoe_recv_frame+0x1d8/0x410 [fcoe]
[<ffffffff81082e8d>] ? trace_hardirqs_on_caller+0x11d/0x1b0
[<ffffffffa03ceaf8>] ? fcoe_percpu_receive_thread+0x68/0xf0 [fcoe]
[<ffffffff8104caf7>] ? local_bh_enable_ip+0x87/0xf0
[<ffffffffa03ceb00>] fcoe_percpu_receive_thread+0x70/0xf0 [fcoe]
[<ffffffffa03cea90>] ? fcoe_rcv+0x450/0x450 [fcoe]
[<ffffffff81069656>] kthread+0x96/0xa0
[<ffffffff813e0b74>] kernel_thread_helper+0x4/0x10
[<ffffffff813d6d9d>] ? retint_restore_args+0xe/0xe
[<ffffffff810695c0>] ? __init_kthread_worker+0x70/0x70
[<ffffffff813e0b70>] ? gs_change+0xb/0xb
Code: 90 f6 05 e8 2c 00 00 02 49 89 fe 48 89 d3 49 89 cd 0f 85 8e 02
00 00 31 f6 48 c7 c7 00 50 4b a0 41 bc 04 00 00 00 e8 15 1a f2 e0 <0f>
b6 43 02 a8 c0 75 65 8b 4b 0c 41 b4 08 0f c9 f6 c1 30 74 58
RIP [<ffffffffa04b282b>] ft_prli+0x4b/0x350 [fcst]
RSP <ffff8801a6273b70>
CR2: 0000000000000002
---[ end trace c06e7c64e9c18831 ]---
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
Reviewed-by: Yi Zou <yi.zou@intel.com >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4025 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-21 09:28:50 +00:00
Bart Van Assche
393fed29d2
ib_srpt: Log a message when closing a channel because of relogin
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4024 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-21 09:24:45 +00:00
Vladislav Bolkhovitin
6d8ca195f7
openSUSE 12.1 automatically transforms commands like
...
"/etc/init.d/scst start" into a systemd start command. Since that doesn't
work for the SCST init script, disable systemd wrapping.
See also bug #738281 "Upgrading from openSUSE 11.4 to openSUSE 12.1 breaks third-party
LSB-compliant System V style init scripts" in the Novell bugzilla database
(https://bugzilla.novell.com/show_bug.cgi?id=738281 ).
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4023 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-21 03:02:13 +00:00
Bart Van Assche
31403966b6
ib_srpt: Avoid that very rapidly successive logins from the same initiator cause a crash
...
Fixes this bug report:
BUG: unable to handle kernel NULL pointer dereference at 0000000000000518
IP: [<ffffffff81080112>] __lock_acquire+0x62/0x1d40
PGD 1b226f067 PUD 1b2241067 PMD 0
Oops: 0000 [#1 ] SMP
CPU 0
Modules linked in: ib_srpt scst_vdisk crc32c libcrc32c scst netconsole configfs snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device af_packet rdma_ucm rdma_cm iw_cm ib_addr ib_ipoib ib_cm ib_sa ib_uverbs ib_umad mlx4_ib ib_mad ib_core microcode cpufreq_co
nservative cpufreq_userspace cpufreq_powersave acpi_cpufreq mperf dm_mod snd_hda_codec_hdmi snd_hda_codec_analog snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_timer snd intel_agp sr_mod mlx4_core sg intel_gtt cdrom i2c_i801 agpgart soundcore i2c_co
re snd_page_alloc pcspkr button uhci_hcd ehci_hcd sd_mod crc_t10dif usbcore edd ext3 mbcache jbd fan ata_generic ata_piix pata_marvell ahci libahci libata scsi_mod thermal processor thermal_sys hwmon
Pid: 4, comm: kworker/0:0 Not tainted 3.1.5-debug+ #1 System manufacturer P5Q DELUXE/P5Q DELUXE
RIP: 0010:[<ffffffff81080112>] [<ffffffff81080112>] __lock_acquire+0x62/0x1d40
RSP: 0018:ffff8801b50c9950 EFLAGS: 00010046
RAX: 0000000000000046 RBX: 0000000000000518 RCX: 0000000000000001
RDX: 0000000000000001 RSI: 0000000000000000 RDI: 0000000000000518
RBP: ffff8801b50c9a40 R08: 0000000000000002 R09: 0000000000000001
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8801b50aae20
R13: 0000000000000000 R14: 0000000000000002 R15: 0000000000000000
FS: 0000000000000000(0000) GS:ffff8801bfc00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000518 CR3: 00000001b1a4d000 CR4: 00000000000406f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process kworker/0:0 (pid: 4, threadinfo ffff8801b50c8000, task ffff8801b50aae20)
Stack:
0000000000000006 0000000000000001 ffffffff8191ca20 ffff8801b50c99b8
ffffffff81082cae 0000000000000003 ffff8801b50aae20 0000000000000003
0000000000000002 0000000000000000 ffff8801b50c9aa0 0000000000000046
Call Trace:
[<ffffffff81082cae>] ? mark_held_locks+0x6e/0x130
[<ffffffff810823c5>] lock_acquire+0x95/0x130
[<ffffffff8103d4ee>] ? try_to_wake_up+0x2e/0x2b0
[<ffffffff813d618c>] ? _raw_spin_lock_irqsave+0x1c/0x60
[<ffffffff813d61bb>] _raw_spin_lock_irqsave+0x4b/0x60
[<ffffffff8103d4ee>] ? try_to_wake_up+0x2e/0x2b0
[<ffffffff8103d4ee>] try_to_wake_up+0x2e/0x2b0
[<ffffffff8103d7a5>] wake_up_process+0x15/0x20
[<ffffffffa0463fda>] srpt_set_ch_state_to_disc+0x5a/0x80 [ib_srpt]
[<ffffffffa0464016>] __srpt_close_ch+0x16/0xa0 [ib_srpt]
[<ffffffffa04698e6>] srpt_cm_req_recv+0x806/0xbe0 [ib_srpt]
[<ffffffffa046ac0d>] srpt_cm_handler+0x7d/0x160 [ib_srpt]
[<ffffffffa0315c85>] cm_process_work+0x25/0x110 [ib_cm]
[<ffffffffa031716c>] cm_req_handler+0x67c/0xa00 [ib_cm]
[<ffffffffa031761d>] cm_work_handler+0x12d/0x1480 [ib_cm]
[<ffffffff810629c8>] process_one_work+0x198/0x520
[<ffffffff81062959>] ? process_one_work+0x129/0x520
[<ffffffffa03174f0>] ? cm_req_handler+0xa00/0xa00 [ib_cm]
[<ffffffff810646aa>] worker_thread+0x16a/0x350
[<ffffffff81064540>] ? manage_workers+0x250/0x250
[<ffffffff81069656>] kthread+0x96/0xa0
[<ffffffff813e0b74>] kernel_thread_helper+0x4/0x10
[<ffffffff813d6d9d>] ? retint_restore_args+0xe/0xe
[<ffffffff810695c0>] ? __init_kthread_worker+0x70/0x70
[<ffffffff813e0b70>] ? gs_change+0xb/0xb
Code: 25 00 b6 00 00 4c 89 7d f8 85 c9 48 89 fb 45 0f 45 f0 41 89 f5 85 d2 0f 84 44 0d 00 00 8b 05 5a 3a 6f 00 85 c0 0f 84 c6 01 00 00
8b 03 ba 01 00 00 00 48 3d c0 75 7b 81 44 0f 44 f2 41 83 fd
RIP [<ffffffff81080112>] __lock_acquire+0x62/0x1d40
RSP <ffff8801b50c9950>
CR2: 0000000000000518
---[ end trace efbb413a57b805cb ]---
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4020 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-20 20:39:20 +00:00
Bart Van Assche
2f6a4f4210
ib_srpt: Make change log more detailed
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4018 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-20 15:35:55 +00:00
Vladislav Bolkhovitin
76dc7d207a
Improve release mode TM logging to simplify imvestigations
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4017 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-19 21:30:18 +00:00
Bart Van Assche
60d9c93a1d
ib_srpt: Add 2.2.0 release notes
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4015 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-19 19:36:50 +00:00
Bart Van Assche
885fd29a6c
Remove trailing spaces
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4014 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-19 17:41:56 +00:00
Bart Van Assche
c6e1c7ffdb
Kernel version updates
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4003 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-19 14:58:15 +00:00
Bart Van Assche
da14ec2aa4
Simplify two expressions
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4002 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-19 14:55:57 +00:00
Bart Van Assche
ca9799666a
nightly/bin/nightly: Add command-line option -a
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4001 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-19 14:24:11 +00:00
Bart Van Assche
a5c6ff869a
Make run-regression-tests work with older tar versions that do not support xz
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4000 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-19 14:23:33 +00:00
Bart Van Assche
14024e009d
Nightly build: kernel version updates
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3999 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-16 10:27:10 +00:00
Bart Van Assche
bad8f4498d
Nightly build: the directory structure on ftp.kernel.org has been modified once more. Update scripts/run-regression-tests accordingly
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3998 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-16 10:16:12 +00:00
Bart Van Assche
c8fc2dd821
/etc/init.d/scst: clarify comments
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3996 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-15 13:03:51 +00:00
Bart Van Assche
ccb249a8cd
Spelling fix: change one occurrence of "ratational" into "rotational".
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3991 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-15 10:33:27 +00:00
Bart Van Assche
4dbdee210d
Spelling fix: change one occurrence of "ratational" into "rotational".
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3990 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-15 10:32:24 +00:00
Bart Van Assche
64a9ec4768
Spelling fix: change one occurrence of "ritational" into "rotational".
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3989 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-15 10:31:26 +00:00
Bart Van Assche
0918f0f356
SVN_TAGS: Add 2.0/2.1/2.2 branch starting points
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3982 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-15 08:50:35 +00:00
Vladislav Bolkhovitin
5dea6c0aa6
Minor addition recommended by Daniel Fernandes <dfernandes1978@hotmail.com>
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3980 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-13 02:13:56 +00:00
Vladislav Bolkhovitin
e0138684a4
QLA HOWTO update from Bart Van Assche <bvanassche@acm.org>
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3966 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-10 03:54:47 +00:00
Vladislav Bolkhovitin
7872837b6b
Replace list_entry((a)->next, b, c) by list_first_entry(a, b, c).
...
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3965 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-10 03:50:24 +00:00
Vladislav Bolkhovitin
fda3b6b327
Minor logging improvement
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3964 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-08 23:49:52 +00:00
Vladislav Bolkhovitin
f173a9133c
Micro-optimize the page count computations in scst_mem.c by
...
rewriting these computations such that branch instructions are avoided.
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3963 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-08 00:06:24 +00:00
Vladislav Bolkhovitin
cd2d549a0b
Avoid converting back and forth between int and enum
...
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3962 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-08 00:00:06 +00:00
Vladislav Bolkhovitin
882d414719
Makes scst_vdisk build again on RHEL 5.x.
...
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3961 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-07 23:58:59 +00:00
Bart Van Assche
4250cf9446
qla2x_tgt: Remove trailing whitespace
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3960 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-07 17:31:08 +00:00
Vladislav Bolkhovitin
331cc5d28d
Web updates
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3959 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-07 03:07:45 +00:00
Vladislav Bolkhovitin
9ea7b8b4c9
We try to build FC SAN on Sun T2 server, FC HBA cards used are
...
QLE2560 and QLE2562, the OS is RHEL6.0 with kernel linux-2.6.32,
scst code version from svn is 3952.
As T2 (SPARC64) is big-endian, which may not be tested sufficently,
we had to fix some endian swap to make qla2x00t work good on it.
The first fix is in q24_build_ctio_pkt(), loop_id from prm->cmd, which
was generated by CPU, should be converted to little-endian when wrapped
in pkt, which will be used by HBA ASIC.
The second fix in qla2x_tgt_def.h, reorder the bit-order of structs'
member, is an attempt in despair, cannot explain why, but it just works!
Besides the programming skills, we cannot get QLogic FC HBA databook,
and have little acknowledge about the driver, the fixes may need to
be refined, so don't hold the comments :)
Signed-off-by: Linwen Deng <linwendeng@gmail.com >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3958 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-07 02:56:31 +00:00
Vladislav Bolkhovitin
63a6094cad
Eliminate the blockio / fileio / nullio if-statements in
...
vdisk_do_job() and the READ/WRITE functions called from that
function. Convert the opcode switch in vdisk_*do_job() to an
array with function pointers.
The function vdisk_exec_verify() only works for file I/O, so
rename it into fileio_exec_verify().
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3957 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-07 02:29:14 +00:00
Mark Buechler
c866c6f4b1
- Small directory check in _issueLip(). Not sure why this is needed.
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3956 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-06 19:41:33 +00:00
Bart Van Assche
3630f4ba6c
ib_srpt: Send a reject message with non-zero reason code if session creation fails
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3955 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-06 19:30:21 +00:00
Bart Van Assche
f9f163fd3e
Kernel version updates
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3954 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-06 19:11:50 +00:00
Bart Van Assche
c9f9f6d9b8
ib_srpt: Avoid that session registration failure causes trouble / send a reject if the transition to RTR fails.
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3953 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-06 19:08:14 +00:00
Vladislav Bolkhovitin
69d8c2fbd7
Change __attribute__((packed)) into __packed and
...
__attribute__((aligned(x))) into __aligned(x) in kernel code since
checkpatch complains about the former.
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3952 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-06 03:02:13 +00:00
Mark Buechler
1bbf50a530
- Warn only in issueLip() when -issue_lip is an argument.
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3951 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-05 19:39:59 +00:00
Vladislav Bolkhovitin
5cc78efff5
According to SPC-4 in the PERSISTENT RESERVE IN full status descriptor
...
the format of byte 13 is defined as follows:
- The most significant four bits are SCOPE field.
- The least significant four bits are the TYPE field.
Make sure that that byte is filled in according to the specification.
BSD-Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3950 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-02 02:46:33 +00:00
Vladislav Bolkhovitin
ae55aa9e36
The only two values passed into the last two arguments of blockio_exec_rw()
...
are 0 and 1. Change their argument type from int to bool.
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3949 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-02 02:42:21 +00:00
Vladislav Bolkhovitin
0af423256f
Micro-optimize the code for CDB parsing in several device handlers.
...
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3948 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-02 02:41:15 +00:00
Vladislav Bolkhovitin
4a3988e274
Use get_unaligned_be16() for reading the two bytes specifying the buffer length
...
to allow the compiler to generate better code for reading these two bytes.
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3947 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-02 02:39:43 +00:00
Vladislav Bolkhovitin
2dd1d93762
Remove a superfluous pair of braces since checkpatch complains about these.
...
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3946 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-02 02:26:29 +00:00
Vladislav Bolkhovitin
f8c3b26620
disk_work.result is set by disk_cmd_done() and read by disk_exec().
...
Since there is a complete_all() / wait_for_completion() pair between both
accesses the volatile keyword is not necessary here.
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3945 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-02 02:24:41 +00:00
Vladislav Bolkhovitin
152a2ad8c1
Avoid that the checkpatch.pl script as included in Linux kernel 3.1
...
complains about min((int)(a), (int)(b)) that should be changed into
min_t(int, (a), (b)).
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3944 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-02 02:14:59 +00:00
Vladislav Bolkhovitin
59019ae405
Use get/put_unaligned() instead of open coding these such that the
...
compiler can generate better code.
As an example, the get_unaligned_be24() function used in the
implementation of READ_6, WRITE_6 and VERIFY_6 together with
"& 0x1f0000" is inlined by the compiler and is translated as
follows on an x86_64 system (2031616 equals 0x1f0000):
movl 0(%r13), %r11d
bswapl %r11d
andl $2031616, %r11d
Also eliminate a conditional branch instruction from get_trans_len_1_256().
BSD-Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3943 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-01 03:36:15 +00:00
Vladislav Bolkhovitin
33891c34fa
In the function scst_mgmt_translate_lun() the variable tgt_dev is
...
used as a loop variable and is used inside that loop only.
Hence it is not necessary to initialize it to NULL.
BSD-Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3942 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-01 03:31:30 +00:00
Vladislav Bolkhovitin
295adebc0f
Use get/put_unaligned_be<n>(...) instead of
...
get/put_unaligned(cpu_to_be<n>(...)).
BSD-Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3941 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-01 03:28:39 +00:00
Vladislav Bolkhovitin
a2dcbab715
Fixes problem reported by Lev Vainblat <lev@zadarastorage.com>:
...
The access to the session sysfs during logout may lead to the kernel oops. In iscsi_unreg_sess_done() the iscsi_session is freed, so scst_sess->tgt_priv (that previously pointed to the iscsi_session) becomes stale. The session is still accessible in sysfs until scst_sess_sysfs_del() call, but accessing to the session via sysfs may return invalid values or crash the kernel:
$ cat /sys/kernel/scst_tgt/targets/iscsi/T1/sessions/iqn.2011-04.com.zadarastorage:316:vc-0/sid
10000123d0200
[ 178.769460] iscsi-scst[895] logout_exec[2718]: Logout received from initiator iqn.2011-04.com.zadarastorage:316:vc-0
[ 178.769482] iscsi-scst[897] cmnd_tx_end[2900]: Closing connection at initiator's iqn.2011-04.com.zadarastorage:316:vc-0 request
[ 178.769546] scst: TM fn 6
[ 178.769623] scst: TM fn 6 finished, status 0
[ 178.770075] scst[1645] scst_cmd_thread[4379]: Processing thread D10_0 (PID 1645) finished
[ 178.770111] scst[1646] scst_cmd_thread[4379]: Processing thread D10_1 (PID 1646) finished
[ 178.770131] scst[1647] scst_cmd_thread[4379]: Processing thread D10_2 (PID 1647) finished
[ 178.770150] scst[1648] scst_cmd_thread[4379]: Processing thread D10_3 (PID 1648) finished
[ 178.770168] scst[1649] scst_cmd_thread[4379]: Processing thread D10_4 (PID 1649) finished
[ 178.770186] scst[1650] scst_cmd_thread[4379]: Processing thread D10_5 (PID 1650) finished
[ 178.770204] scst[1651] scst_cmd_thread[4379]: Processing thread D10_6 (PID 1651) finished
[ 178.770223] scst[1652] scst_cmd_thread[4379]: Processing thread D10_7 (PID 1652) finished
$ cat /sys/kernel/scst_tgt/targets/iscsi/T1/sessions/iqn.2011-04.com.zadarastorage:316:vc-0/sid
0
$ echo 1> /sys/kernel/scst_tgt/targets/iscsi/T1/sessions/iqn.2011-04.com.zadarastorage:316:vc-0/force_close
[ 193.150420] iscsi-scst[1555] iscsi_sess_force_close[389]: Deleting session 0 with initiator (null) (ffff880078316000)
[ 193.150461] BUG: unable to handle kernel NULL pointer dereference at (null)
[ 193.150545] IP: [<ffffffffa034d034>] iscsi_sess_force_close+0xc4/0x170 [iscsi_scst]
[ 193.150628] PGD 78218067 PUD 79666067 PMD 0
[ 193.150678] Oops: 0000 [#1 ] SMP
[ 193.150716] last sysfs file: /sys/kernel/scst_tgt/targets/iscsi/T1/sessions/iqn.2011-04.com.zadarastorage:316:vc-0/force_close
[ 193.150824] CPU 0
[ 193.150844] Modules linked in: ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi dm_iostat scst_vdisk iscsi_scst scst libcrc32c nfsd psmouse exportfs serio_raw virtio_ball oon nfs lockd fscache nfs_acl auth_rpcgss i2c_piix4 sunrpc lp parport floppy raid10 raid456 async_pq async_xor xor async_memcpy async_raid6_recov ixgbevf raid6_pq async_tx raid1 raid0 multipath linear [last unloaded: scsi_transport_is csi]
[ 193.151359]
[ 193.151377] Pid: 1555, comm: bash Not tainted 2.6.38-8-server #42-Ubuntu Bochs Bochs
[ 193.151456] RIP: 0010:[<ffffffffa034d034>] [<ffffffffa034d034>] iscsi_sess_force_close+0xc4/0x170 [iscsi_scst]
[ 193.151556] RSP: 0018:ffff88007a247e28 EFLAGS: 00010287
[ 193.151604] RAX: 000000000000007f RBX: fffffffffffffe30 RCX: 000000000003ffff
[ 193.153372] RDX: 0000000000000000 RSI: 0000000000000086 RDI: 0000000000000246
[ 193.155115] RBP: ffff88007a247e68 R08: 0000000000000036 R09: 000000000000b874
[ 193.156878] R10: 0000000000000000 R11: 0000000000000001 R12: ffff8800783170a0
[ 193.158640] R13: ffff88007a247fd8 R14: ffff88007828c4a0 R15: ffff880078573600
[ 193.160112] FS: 00007f9d23092720(0000) GS:ffff88007fc00000(0000) knlGS:0000000000000000
[ 193.160112] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 193.160112] CR2: 0000000000000000 CR3: 00000000787e6000 CR4: 00000000000006f0
[ 193.160112] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 193.160112] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 193.160112] Process bash (pid: 1555, threadinfo ffff88007a246000, task ffff88007828c4a0)
[ 193.160112] Stack:
[ 193.160112] 0000000000000000 ffff880078316000 0000000000000000 0000000000000000
[ 193.160112] ffff880078316000 0000000000000001 ffff8800370ea5a0 ffffffffa02de9c0
[ 193.160112] ffff88007a247e88 ffffffffa034d138 ffff880078573620 ffff88007a247f48
[ 193.160112] Call Trace:
[ 193.160112] [<ffffffffa034d138>] iscsi_sess_force_close_store+0x58/0xd0 [iscsi_scst]
[ 193.160112] [<ffffffffa02bf31c>] scst_store+0x1c/0x20 [scst]
[ 193.160112] [<ffffffff811d35f1>] sysfs_write_file+0xd1/0x160
[ 193.160112] [<ffffffff811652e6>] vfs_write+0xc6/0x180
[ 193.160112] [<ffffffff81165601>] sys_write+0x51/0x90
[ 193.160112] [<ffffffff8100bfc2>] system_call_fastpath+0x16/0x1b
[ 193.160112] Code: 1f 84 00 00 00 00 00 f6 05 ea ef 00 00 08 75 68 48 89 df be 03 00 00 00 e8 ca d3 ff ff 48 8b 9b d0 01 00 00 48 81 eb d0 01 00 00 <48> 8b 83 d0 01 00 00 0f 18 08 48 8d 83 d0 01 00 00 4c 39 e0 75
[ 193.160112] RIP [<ffffffffa034d034>] iscsi_sess_force_close+0xc4/0x170 [iscsi_scst]
[ 193.160112] RSP <ffff88007a247e28>
[ 193.160112] CR2: 0000000000000000
[ 193.200380] ---[ end trace 1988466f0a8da036 ]---
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3940 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-11-29 22:00:23 +00:00
Vladislav Bolkhovitin
a309a526f0
Check error code of path_lookup() on pre-39 kernels. Suggested by Lev Vainblat <lev@zadarastorage.com>
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3939 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-11-23 02:53:09 +00:00