Merge branch 'svn-trunk'

This commit is contained in:
Bart Van Assche
2018-10-13 21:14:42 -07:00
31 changed files with 534 additions and 3490 deletions
+46 -46
View File
@@ -107,7 +107,7 @@ For example, this will cause problems in the following situation:
7. scst_send_to_midlev returns with SCST_CMD_STATE_RES_NEED_THREAD
8. Now, the scst_process_active_cmd will try to reschedule command 0x8000100
which is already destroyed at this point !
Can anyone on the list confirm my guess? Or, this situation should never
happen because of some other condition which I may have missed? Right
now I can't think of any of simple methods to work around the issue,
@@ -124,104 +124,104 @@ I have two machines (SCST targets) with the following parameters:
- Linux 2.6.21.3, running in 64 bit mode with 16G RAM
- SCST trunk version
On the client side there is a Solaris 10 U3 machine, with the same (chip
On the client side there is a Solaris 10 U3 machine, with the same (chip
wise) Qlogic controller.
There is an FC switch between the three machines, and each of the
targets are zoned to the client's port in a one-by-one manner, so HBA
There is an FC switch between the three machines, and each of the
targets are zoned to the client's port in a one-by-one manner, so HBA
port 1 sees only target 1 and port 2 sees only target 2.
The targets are configured with two large sparse files on XFS (8 TB
The targets are configured with two large sparse files on XFS (8 TB
each, with dd if=/dev/zero of=file bs=1M count=0 seek=8388608).
In Solaris I do various tests with SVM (Sun's built in volume manager)
In Solaris I do various tests with SVM (Sun's built in volume manager)
and multiterabyte UFS. Occasionally, there are some strange write
errors, where the volume manager drops its volumes and without a VM, a
simple UFS fs write can fail too.
I see various errors logged by the kernel (Solaris'), these are some
I see various errors logged by the kernel (Solaris'), these are some
examples, both with and without SVM:
Jun 21 10:42:14 solaris fctl: [ID 517869 kern.warning] WARNING:
Jun 21 10:42:14 solaris fctl: [ID 517869 kern.warning] WARNING:
fp(1)::GPN_ID for D_ID=621200 failed
Jun 21 10:42:14 solaris fctl: [ID 517869 kern.warning] WARNING:
fp(1)::N_x Port with D_ID=621200, PWWN=210000e08b944419 disappeared from
Jun 21 10:42:14 solaris fctl: [ID 517869 kern.warning] WARNING:
fp(1)::N_x Port with D_ID=621200, PWWN=210000e08b944419 disappeared from
fabric
Jun 21 10:42:53 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 10:42:53 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 10:42:53 solaris SCSI transport failed: reason
Jun 21 10:42:53 solaris SCSI transport failed: reason
'tran_err': retrying command
Jun 21 10:43:06 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 10:43:06 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 10:43:06 solaris SCSI transport failed: reason 'timeout':
Jun 21 10:43:06 solaris SCSI transport failed: reason 'timeout':
retrying command
Jun 21 10:43:13 solaris scsi: [ID 107833 kern.notice] Device is gone
Jun 21 10:43:13 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 10:43:13 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 10:43:13 solaris transport rejected fatal error
Jun 21 10:43:13 solaris md_stripe: [ID 641072 kern.warning] WARNING: md:
Jun 21 10:43:13 solaris md_stripe: [ID 641072 kern.warning] WARNING: md:
d10: write error on /dev/dsk/c2t210000E08B944419d0s6
Jun 21 10:43:13 solaris last message repeated 9 times
Jun 21 10:43:13 solaris scsi: [ID 243001 kern.info]
Jun 21 10:43:13 solaris scsi: [ID 243001 kern.info]
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0 (fcp1):
Jun 21 10:43:13 solaris offlining lun=0 (trace=0), target=621200
Jun 21 10:43:13 solaris offlining lun=0 (trace=0), target=621200
(trace=2800004)
Jun 21 10:43:13 solaris ufs: [ID 702911 kern.warning] WARNING: Error
Jun 21 10:43:13 solaris ufs: [ID 702911 kern.warning] WARNING: Error
writing master during ufs log roll
Jun 21 10:43:13 solaris ufs: [ID 127457 kern.warning] WARNING: ufs log
Jun 21 10:43:13 solaris ufs: [ID 127457 kern.warning] WARNING: ufs log
for /mnt changed state to Error
Jun 21 10:43:13 solaris ufs: [ID 616219 kern.warning] WARNING: Please
Jun 21 10:43:13 solaris ufs: [ID 616219 kern.warning] WARNING: Please
umount(1M) /mnt and run fsck(1M)
Jun 21 11:08:55 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:08:55 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:08:55 solaris offline or reservation conflict
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris offline or reservation conflict
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris offline or reservation conflict
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris i/o to invalid geometry
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris offline or reservation conflict
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris i/o to invalid geometry
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris offline or reservation conflict
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris i/o to invalid geometry
Jun 21 11:09:43 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:43 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:43 solaris offline or reservation conflict
Jun 21 11:09:43 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:43 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:43 solaris SYNCHRONIZE CACHE command failed (5)
I don't see anything in the dmesg on the target side.
After these errors SCST seems to be dead. I can't unload its modules and
After these errors SCST seems to be dead. I can't unload its modules and
can't communicate it via /proc.
A simple cat vdisk just waits and waits.
Could you please help? What should I set/collect/send in this case to
Could you please help? What should I set/collect/send in this case to
help resolving this issue?
======================================================================
+3 -3
View File
@@ -308,7 +308,7 @@ emulex_install:
emulex_uninstall:
cd $(EMULEX_DIR) && $(MAKE) uninstall
emulex_clean:
emulex_clean:
cd $(EMULEX_DIR) && $(MAKE) clean
emulex_extraclean:
@@ -323,7 +323,7 @@ lsi_install:
lsi_uninstall:
cd $(LSI_DIR) && $(MAKE) uninstall
lsi_clean:
lsi_clean:
cd $(LSI_DIR) && $(MAKE) clean
lsi_extraclean:
@@ -368,7 +368,7 @@ usr_install:
usr_uninstall:
cd $(USR_DIR) && $(MAKE) uninstall
usr_clean:
usr_clean:
cd $(USR_DIR) && $(MAKE) clean
usr_extraclean:
+4 -4
View File
@@ -4,12 +4,12 @@
#
# Copyright (C) 2006 - 2008 Jacky Feng <jfeng@marvell.com>
# Copyright (C) 2011 - 2018 Bart Van Assche <bvanassche@acm.org>
#
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation, version 2
# of the License.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@@ -20,8 +20,8 @@
# all (the default) : make all
# clean : clean files
# extraclean : clean + clean dependencies
# install : install
# uninstall : uninstall
# install : install
# uninstall : uninstall
#
# Notes :
# - install and uninstall must be made as root
+46 -46
View File
@@ -107,7 +107,7 @@ For example, this will cause problems in the following situation:
7. scst_send_to_midlev returns with SCST_CMD_STATE_RES_NEED_THREAD
8. Now, the scst_process_active_cmd will try to reschedule command 0x8000100
which is already destroyed at this point !
Can anyone on the list confirm my guess? Or, this situation should never
happen because of some other condition which I may have missed? Right
now I can't think of any of simple methods to work around the issue,
@@ -124,104 +124,104 @@ I have two machines (SCST targets) with the following parameters:
- Linux 2.6.21.3, running in 64 bit mode with 16G RAM
- SCST trunk version
On the client side there is a Solaris 10 U3 machine, with the same (chip
On the client side there is a Solaris 10 U3 machine, with the same (chip
wise) Qlogic controller.
There is an FC switch between the three machines, and each of the
targets are zoned to the client's port in a one-by-one manner, so HBA
There is an FC switch between the three machines, and each of the
targets are zoned to the client's port in a one-by-one manner, so HBA
port 1 sees only target 1 and port 2 sees only target 2.
The targets are configured with two large sparse files on XFS (8 TB
The targets are configured with two large sparse files on XFS (8 TB
each, with dd if=/dev/zero of=file bs=1M count=0 seek=8388608).
In Solaris I do various tests with SVM (Sun's built in volume manager)
In Solaris I do various tests with SVM (Sun's built in volume manager)
and multiterabyte UFS. Occasionally, there are some strange write
errors, where the volume manager drops its volumes and without a VM, a
simple UFS fs write can fail too.
I see various errors logged by the kernel (Solaris'), these are some
I see various errors logged by the kernel (Solaris'), these are some
examples, both with and without SVM:
Jun 21 10:42:14 solaris fctl: [ID 517869 kern.warning] WARNING:
Jun 21 10:42:14 solaris fctl: [ID 517869 kern.warning] WARNING:
fp(1)::GPN_ID for D_ID=621200 failed
Jun 21 10:42:14 solaris fctl: [ID 517869 kern.warning] WARNING:
fp(1)::N_x Port with D_ID=621200, PWWN=210000e08b944419 disappeared from
Jun 21 10:42:14 solaris fctl: [ID 517869 kern.warning] WARNING:
fp(1)::N_x Port with D_ID=621200, PWWN=210000e08b944419 disappeared from
fabric
Jun 21 10:42:53 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 10:42:53 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 10:42:53 solaris SCSI transport failed: reason
Jun 21 10:42:53 solaris SCSI transport failed: reason
'tran_err': retrying command
Jun 21 10:43:06 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 10:43:06 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 10:43:06 solaris SCSI transport failed: reason 'timeout':
Jun 21 10:43:06 solaris SCSI transport failed: reason 'timeout':
retrying command
Jun 21 10:43:13 solaris scsi: [ID 107833 kern.notice] Device is gone
Jun 21 10:43:13 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 10:43:13 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 10:43:13 solaris transport rejected fatal error
Jun 21 10:43:13 solaris md_stripe: [ID 641072 kern.warning] WARNING: md:
Jun 21 10:43:13 solaris md_stripe: [ID 641072 kern.warning] WARNING: md:
d10: write error on /dev/dsk/c2t210000E08B944419d0s6
Jun 21 10:43:13 solaris last message repeated 9 times
Jun 21 10:43:13 solaris scsi: [ID 243001 kern.info]
Jun 21 10:43:13 solaris scsi: [ID 243001 kern.info]
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0 (fcp1):
Jun 21 10:43:13 solaris offlining lun=0 (trace=0), target=621200
Jun 21 10:43:13 solaris offlining lun=0 (trace=0), target=621200
(trace=2800004)
Jun 21 10:43:13 solaris ufs: [ID 702911 kern.warning] WARNING: Error
Jun 21 10:43:13 solaris ufs: [ID 702911 kern.warning] WARNING: Error
writing master during ufs log roll
Jun 21 10:43:13 solaris ufs: [ID 127457 kern.warning] WARNING: ufs log
Jun 21 10:43:13 solaris ufs: [ID 127457 kern.warning] WARNING: ufs log
for /mnt changed state to Error
Jun 21 10:43:13 solaris ufs: [ID 616219 kern.warning] WARNING: Please
Jun 21 10:43:13 solaris ufs: [ID 616219 kern.warning] WARNING: Please
umount(1M) /mnt and run fsck(1M)
Jun 21 11:08:55 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:08:55 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:08:55 solaris offline or reservation conflict
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris offline or reservation conflict
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris offline or reservation conflict
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris i/o to invalid geometry
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris offline or reservation conflict
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris i/o to invalid geometry
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris offline or reservation conflict
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:41 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:41 solaris i/o to invalid geometry
Jun 21 11:09:43 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:43 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:43 solaris offline or reservation conflict
Jun 21 11:09:43 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
Jun 21 11:09:43 solaris scsi: [ID 107833 kern.warning] WARNING:
/pci@1,0/pci1022,7450@a/pcie11,105@1,1/fp@0,0/disk@w210000e08b944419,0
(sd1):
Jun 21 11:09:43 solaris SYNCHRONIZE CACHE command failed (5)
I don't see anything in the dmesg on the target side.
After these errors SCST seems to be dead. I can't unload its modules and
After these errors SCST seems to be dead. I can't unload its modules and
can't communicate it via /proc.
A simple cat vdisk just waits and waits.
Could you please help? What should I set/collect/send in this case to
Could you please help? What should I set/collect/send in this case to
help resolving this issue?
======================================================================
+2 -2
View File
@@ -981,7 +981,7 @@ Background information about zero-copy data sending
As explained above the most efficient operation of the iSCSI-SCST target
driver is achieved when the following two conditions are met:
* Data is sent from target to initiator in a zero-copy fashion.
* Data buffers are cached for reuse (by the so-called sgv pool).
* Data buffers are cached for reuse (by the so-called sgv pool).
Unfortunately the zero-copy API in the Linux kernel (proto.sendpage() /
tcp_sendpage()) does not yet support completion notifications. Hence the
put_page_callback patch which adds completion notification support to
@@ -999,7 +999,7 @@ Notes:
pool to allocate a data buffer.
* Zero-copy sending is only possible with network interface drivers that
support scatter/gather and checksumming (NETIF_F_SG and NETIF_F_ALL_CSUM
respectively).
respectively).
References:
[1] James Bottomley, Linux Kernel Mailing List, December 2008,
+1 -1
View File
@@ -7,7 +7,7 @@
same structure. This architecture decision derived from IET and makes
the code a lot less readable, maintainable and effective as well as more
errors prone, so it must be corrected.
- Code beautifying, i.e. make it be written in the same nice looking style.
Particularly, all functions and variables names should share the same style.
+2 -2
View File
@@ -36,11 +36,11 @@ a) Latest development version
cd /root
svn checkout svn://svn.code.sf.net/p/scst/svn/trunk scst
b) Specific branch (3.0 used in example)
b) Specific branch (3.0 used in example)
cd /root
svn checkout svn://svn.code.sf.net/p/scst/svn/branches/3.0.x scst
2. Build SCST
! Important: SCST 3.1.x and trunk: Gentoo Hardened kernels uses
+1 -1
View File
@@ -398,7 +398,7 @@ Device (host:ch:id:lun or name) Device handler
LUN masking
-----------
SCST defines security groups. For each group, you can add LUNs.
SCST defines security groups. For each group, you can add LUNs.
If you want to have all LUNs available for all targets, just add them to
the "Default" group:
+1 -1
View File
@@ -137,7 +137,7 @@ iscsi-scst-adm \- iSCSI SCST Target Administration Utility.
\&\fBiscsi-scst-adm \-\-op [operation] \-\-tid=[id] [\-\-sid [id]] [\-\-params [key=value,...]]\fR
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
iscsi-scst-adm is used to monitor and modify in real-time the iSCSI SCST Target
iscsi-scst-adm is used to monitor and modify in real-time the iSCSI SCST Target
targets.
.SH "USAGE"
.IX Header "USAGE"
+1 -1
View File
@@ -56,7 +56,7 @@ Specify running user id, default is current uid.
.SH FILES
.I /etc/iscsi-scstd.conf
.RS
The system wide configuration file. See
The system wide configuration file. See
.BR iscsi-scstd.conf (5)
for further details.
.RE
+40 -40
View File
@@ -1,6 +1,6 @@
.\" Process this file with
.\" groff -man -Tascii iscsi-scstd.conf.5
.\"
.\"
.TH "ISCSI_SCSTD.CONF" "5" "May 2007" "A. Lehmann, M. Zhang and A. Redlich" "File formats"
.SH "NAME"
/etc/iscsi-scstd.conf \- configuration for iSCSI SCST Target Daemon
@@ -15,12 +15,12 @@ Only lines starting with `#' are ignored. Putting '#' in the middle of a line is
.P
The "Yes" and "No" for parameter values are case sensitive. The parameter names are case insensitive.
.P
The file consists of a global part and zero or more "Target" stanzas. Everything until the first target definition belongs to the global configuration.
The file consists of a global part and zero or more "Target" stanzas. Everything until the first target definition belongs to the global configuration.
Here is an example:
IncomingUser joe secret
.br
.br
OutgoingUser jack secret2
Target iqn.2007\-05.com.example:storage.disk2.sys1.xyz
@@ -46,11 +46,11 @@ Target iqn.2007\-05.com.example:storage.disk2.sys1.xyz
Stanzas start with the word "Target" and the target name. This name must be a globally unique name, as defined by the iSCSI standard : the "iSCSI Qualified Name". The daemon brings the targets up in the order listed.
.SH "GLOBAL OPTIONS"
Global Options are case sensitive.
.TP
.TP
.B [IncomingUser <username> <password>]
The
The
.I <username>
and
and
.I <password>
used during discovery sessions to authenticate iSCSI initiators. Several of those can be specified for discovery. If no
.B IncomingUser
@@ -60,13 +60,13 @@ HINT: RFC 3720 requires
.I <password>
to be 12 characters long. This is enforced e.g. by MS Initiator.
.RE
.TP
.TP
.B [OutgoingUser <username> <password>]
The
The
.I <username>
and
and
.I <password>
used during discovery sessions to authenticate the target to initiators. Only one outgoing
used during discovery sessions to authenticate the target to initiators. Only one outgoing
.I <username>/<password>
combination may be specified.
.RS
@@ -74,16 +74,16 @@ HINT: RFC 3720 requires
.I <password>
to be 12 characters long. This is enforced e.g. by MS Initiator.
.RE
.TP
.TP
.B Target iqn.<yyyy\-mm>.<tld.domain.some.host>[:<identifier>]
A target definition and the target name. The targets name (the
.B iSCSI Qualified Name
) must be a globally unique name (as defined by the iSCSI standard) and has to start with
.I iqn
followed by a single dot. The EUI\-64 form is not supported.
followed by a single dot. The EUI\-64 form is not supported.
.I <yyyy\-mm>
is the date (year and month) at which the domain is valid. This has to be followed by a single dot and the reversed domain name.
The optional
The optional
.I <identifier>
\- which is freely selectable \- has to be separated by a single colon. For further details please check the iSCSI spec.
@@ -92,7 +92,7 @@ Here is an example:
Target iqn.2007\-05.com.example.host:storage.disk2.sys1.xyz
.SH "TARGET OPTIONS"
Target options are also case sensitive.
.TP
.TP
.B [IncomingUser <username> <password>]
The
.I <username>
@@ -102,55 +102,55 @@ used to authenticate the iSCSI initiators to this target. It may be different fr
.B IncomingUser
Option, connections are allowed without authentication. A
.I <password>
has to be provided, if there is a
has to be provided, if there is a
.I <username>
given. Specifying several different
.B IncomingUser
accounts is supported.
.TP
.TP
.B [OutgoingUser <username> <password>]
The
.I <username>
and
.I <password>
used to authenticate this iSCSI target to initiators. Only one
.B
.B
OutgoingUser
per target is supported. It may be different from the username and password in section GLOBAL OPTIONS, which is used for discovery. A
.I <password>
has to be provided, if there is a
has to be provided, if there is a
.I <username>
given.
.TP
.TP
.B [Alias <aliasname>]
This assigns an optional
This assigns an optional
.I <aliasname>
to the target.
.TP
.TP
.B [HeaderDigest <CRC32C|None>]
Optional. If set to "CRC32C" and the initiator is configured accordingly, the integrity of an iSCSI PDU's header segments will be protected by a CRC32C checksum. The default is "None". Note that header digests are not supported during discovery sessions.
.TP
.TP
.B [DataDigest <CRC32C|None>]
Optional. If set to "CRC32C" and the initiator is configured accordingly, the integrity of an iSCSI PDU's data segment will be protected by a CRC32C checksum. The default is "None". Note that data digests are not supported during discovery sessions.
.TP
.TP
.B [MaxConnections <value>]
Optional. The number of connections within a session. Has to be set to "1" (in words: one), which is also the default since MC/S is not supported.
.TP
.TP
.B [InitialR2T <Yes|No>]
Optional. If set to "Yes", the initiator has to wait for the target to solicit SCSI data before sending it. Setting it to "No" (default) allows the initiator to send a burst of
.B FirstBurstLength
bytes unsolicited right after and/or (depending on the setting of
.B ImmediateData
) together with the command. Thus setting it to "No" may improve performance.
.TP
.TP
.B [ImmediateData <Yes|No>]
Optional. This allows the initiator to append unsolicited data to a command. To achieve better performance, this should be set to "Yes". Which is the default.
.TP
.TP
.B [MaxRecvDataSegmentLength <value>]
Optional. Sets the maximum data segment length that can be received. The
Optional. Sets the maximum data segment length that can be received. The
.I <value>
should be set to multiples of PAGE_SIZE. Configuring too large values may lead to problems allocating sufficient memory, which in turn may lead to SCSI commands timing out at the initiator host. The default value is the highes possible for current platform (1 or 2 MB).
.TP
.TP
.B [MaxXmitDataSegmentLength <value>]
Optional. Sets the maximum data segment length that can be sent. The
.I <value>
@@ -158,15 +158,15 @@ actually used is the minimum of
.B MaxXmitDataSegmentLength
and the
.B MaxRecvDataSegmentLength
announced by the initiator. The
announced by the initiator. The
.I <value>
should be set to multiples of PAGE_SIZE. Configuring too large values may lead to problems allocating sufficient memory, which in turn may lead to SCSI commands timing out at the initiator host. The default value is the highes possible for current platform (1 or 2 MB).
.TP
.TP
.B [MaxBurstLength <value>]
Optional. Sets the maximum amount of either unsolicited or solicited data the initiator may send in a single burst. Any amount of data exceeding this value must be explicitly solicited by the target. The
Optional. Sets the maximum amount of either unsolicited or solicited data the initiator may send in a single burst. Any amount of data exceeding this value must be explicitly solicited by the target. The
.I <value>
should be set to multiples of PAGE_SIZE. Configuring too large values may lead to problems allocating sufficient memory, which in turn may lead to SCSI commands timing out at the initiator host. The default value is the highes possible for current platform (1 or 2 MB).
.TP
.TP
.B [FirstBurstLength <value>]
Optional. Sets the amount of unsolicited data the initiator may transmit in the first burst of a transfer either with and/or right after the command, depending on the settings of
.B InitialR2T
@@ -175,27 +175,27 @@ and
.
.I <value>
should be set to multiples of PAGE_SIZE. Configuring too large values may lead to problems allocating sufficient memory, which in turn may lead to SCSI commands timing out at the initiator host. The default value is the highes possible for current platform (1 or 2 MB).
.TP
.TP
.B [DefaultTime2Wait <value>]
Currently not supported.
.TP
.TP
.B [DefaultTime2Retain <value>]
Currently not supported.
.TP
.TP
.B [MaxOutstandingR2T <value>]
Optional. Controls the maximum number of data transfers the target may request at once, each of up to
.B MaxBurstLength
bytes. The default is 20.
.TP
.TP
.B [DataPDUInOrder <Yes|No>]
Optional. Has to be set to "Yes" \- which is also the default.
.TP
.TP
.B [DataSequenceInOrder <Yes|No>]
Optional. Has to be set to "Yes" \- which is also the default.
.TP
.TP
.B [ErrorRecoveryLevel <value>]
Optional. Has to be set to "0" (in words: zero), which is also the default.
.TP
.TP
.B [QueuedCommands <value>]
Optional. This parameter defines a window of commands an initiator may send and that will be buffered by the target. Depending on your hardware and your (expected) workload, the
.I value
@@ -204,7 +204,7 @@ may be carefully adjusted. The default value of 32 should be sufficient for most
Currently (as of 0.4.11) not all iSCSI target parameters are used. Header and data digests are not supported during discovery sessions.
.SH "SEE ALSO"
.B iscsi-scstd (8)
.TP
.TP
You should have a look at
.B RFC 3720
for all the glory details.
+2 -2
View File
@@ -1,9 +1,9 @@
# The semantics are:
# * By default, every initiator can see and connect to all targets.
#
#
# * Deny for some or every initiator access to one or all targets,
# by adding a line to this file.
#
#
# * Then allow some named initiators access to selected targets,
# by adding lines to initiators.allow
#
+2 -2
View File
@@ -340,7 +340,7 @@ static int add_conn(void __user *ptr)
session = session_lookup(target, info.sid);
if (!session) {
PRINT_ERROR("Session %lld not found",
(unsigned long long int)info.tid);
(unsigned long long)info.tid);
err = -ENOENT;
goto out_unlock;
}
@@ -384,7 +384,7 @@ static int del_conn(void __user *ptr)
session = session_lookup(target, info.sid);
if (!session) {
PRINT_ERROR("Session %llx not found",
(unsigned long long int)info.sid);
(unsigned long long)info.sid);
err = -ENOENT;
goto out_unlock;
}
+5 -5
View File
@@ -606,7 +606,7 @@ static void conn_rsp_timer_fn(struct timer_list *timer)
"%s (SID %llx), closing connection %p",
iscsi_get_timeout(cmnd)/HZ,
conn->session->initiator_name,
(unsigned long long int) conn->session->sid,
(unsigned long long)conn->session->sid,
conn);
/*
* We must call mark_conn_closed() outside of
@@ -837,13 +837,13 @@ static int conn_setup_sock(struct iscsi_conn *conn)
mm_segment_t oldfs;
struct iscsi_session *session = conn->session;
TRACE_DBG("%llx", (unsigned long long int)session->sid);
TRACE_DBG("%llx", (unsigned long long)session->sid);
conn->sock = SOCKET_I(file_inode(conn->file));
if (conn->sock->ops->sendpage == NULL) {
PRINT_ERROR("Socket for sid %llx doesn't support sendpage()",
(unsigned long long int)session->sid);
(unsigned long long)session->sid);
res = -EINVAL;
goto out;
}
@@ -882,7 +882,7 @@ void conn_free(struct iscsi_conn *conn)
TRACE_ENTRY();
TRACE(TRACE_MGMT, "Freeing conn %p (sess=%p, %#Lx %u, initiator %s)",
conn, session, (unsigned long long int)session->sid, conn->cid,
conn, session, (unsigned long long)session->sid, conn->cid,
session->scst_sess->initiator_name);
lockdep_assert_held(&conn->target->target_mutex);
@@ -1000,7 +1000,7 @@ int iscsi_conn_alloc(struct iscsi_session *session,
}
TRACE(TRACE_MGMT, "Creating connection %p for sid %#Lx, cid %u "
"(initiator %s)", conn, (unsigned long long int)session->sid,
"(initiator %s)", conn, (unsigned long long)session->sid,
info->cid, session->scst_sess->initiator_name);
conn->transport = t;
+3 -3
View File
@@ -1375,7 +1375,7 @@ retry:
res = scst_writev(file, iop, count, &off);
set_fs(oldfs);
TRACE_WRITE("sid %#Lx, cid %u, res %d, iov_len %zd",
(unsigned long long int)conn->session->sid,
(unsigned long long)conn->session->sid,
conn->cid, res, iop->iov_len);
if (unlikely(res <= 0)) {
if (res == -EAGAIN) {
@@ -1507,7 +1507,7 @@ retry2:
"index %lu, offset %u, size %u, cmd %p, "
"page %p)", (sendpage != sock_no_sendpage) ?
"sendpage" : "sock_no_sendpage",
(unsigned long long int)conn->session->sid,
(unsigned long long)conn->session->sid,
conn->cid, res, page->index,
offset, size, write_cmnd, page);
if (unlikely(res <= 0)) {
@@ -1593,7 +1593,7 @@ out_err:
{
#endif
PRINT_ERROR("error %d at sid:cid %#Lx:%u, cmnd %p", res,
(unsigned long long int)conn->session->sid,
(unsigned long long)conn->session->sid,
conn->cid, conn->write_cmnd);
}
if (ref_cmd_to_parent &&
+3 -3
View File
@@ -382,7 +382,7 @@ int __del_session(struct iscsi_target *target, u64 sid)
if (!list_empty(&session->conn_list)) {
PRINT_ERROR("%llx still have connections",
(unsigned long long int)session->sid);
(unsigned long long)session->sid);
return -EBUSY;
}
@@ -399,7 +399,7 @@ void iscsi_sess_force_close(struct iscsi_session *sess)
lockdep_assert_held(&sess->target->target_mutex);
PRINT_INFO("Force closing session %llx with initiator %s (%p)",
(unsigned long long int)sess->sid, sess->initiator_name, sess);
(unsigned long long)sess->sid, sess->initiator_name, sess);
list_for_each_entry(conn, &sess->conn_list, conn_list_entry) {
TRACE(TRACE_MGMT, "Force closing connection %p", conn);
@@ -423,7 +423,7 @@ static void iscsi_session_info_show(struct seq_file *seq,
list_for_each_entry(session, &target->session_list,
session_list_entry) {
seq_printf(seq, "\tsid:%llx initiator:%s (reinstating %s)\n",
(unsigned long long int)session->sid,
(unsigned long long)session->sid,
session->initiator_name,
session->sess_reinstating ? "yes" : "no");
conn_info_show(seq, session);
+6 -6
View File
@@ -2631,8 +2631,8 @@ static void q2t_load_cont_data_segments(struct q2t_prm *prm)
*dword_ptr++ = cpu_to_le32(sg_dma_len(prm->sg));
TRACE_SG("S/G Segment Cont. phys_addr=%llx:%llx, len=%d",
(unsigned long long int)pci_dma_hi32(dma_addr),
(unsigned long long int)pci_dma_lo32(dma_addr),
(unsigned long long)pci_dma_hi32(dma_addr),
(unsigned long long)pci_dma_lo32(dma_addr),
(int)sg_dma_len(prm->sg));
/* prm->sg might be last here */
@@ -2693,8 +2693,8 @@ static void q2x_load_data_segments(struct q2t_prm *prm)
*dword_ptr++ = cpu_to_le32(sg_dma_len(prm->sg));
TRACE_SG("S/G Segment phys_addr=%llx:%llx, len=%d",
(unsigned long long int)pci_dma_hi32(dma_addr),
(unsigned long long int)pci_dma_lo32(dma_addr),
(unsigned long long)pci_dma_hi32(dma_addr),
(unsigned long long)pci_dma_lo32(dma_addr),
(int)sg_dma_len(prm->sg));
/* prm->sg might be last here */
@@ -2755,8 +2755,8 @@ static void q24_load_data_segments(struct q2t_prm *prm)
*dword_ptr++ = cpu_to_le32(sg_dma_len(prm->sg));
TRACE_SG("S/G Segment phys_addr=%llx:%llx, len=%d",
(unsigned long long int)pci_dma_hi32(dma_addr),
(unsigned long long int)pci_dma_lo32(dma_addr),
(unsigned long long)pci_dma_hi32(dma_addr),
(unsigned long long)pci_dma_lo32(dma_addr),
(int)sg_dma_len(prm->sg));
/* prm->sg might be last here */
+2 -2
View File
@@ -25,14 +25,14 @@ qla2x00_dfs_fce_show(struct seq_file *s, void *unused)
seq_printf(s, "FCE Trace Buffer\n");
seq_printf(s, "In Pointer = %llx\n\n", (unsigned long long)ha->fce_wr);
seq_printf(s, "Base = %llx\n\n", (unsigned long long) ha->fce_dma);
seq_printf(s, "Base = %llx\n\n", (unsigned long long)ha->fce_dma);
seq_printf(s, "FCE Enable Registers\n");
seq_printf(s, "%08x %08x %08x %08x %08x %08x\n",
ha->fce_mb[0], ha->fce_mb[2], ha->fce_mb[3], ha->fce_mb[4],
ha->fce_mb[5], ha->fce_mb[6]);
fce = (uint32_t *) ha->fce;
fce_start = (unsigned long long) ha->fce_dma;
fce_start = (unsigned long long)ha->fce_dma;
for (cnt = 0; cnt < fce_calc_size(ha->fce_bufs) / 4; cnt++) {
if (cnt % 8 == 0)
seq_printf(s, "\n%llx: ",
+3
View File
@@ -0,0 +1,3 @@
#!/bin/bash
../linux-kernel/scripts/checkpatch.pl -f --show-types --ignore SPDX_LICENSE_TAG,LINUX_VERSION_CODE $(list-source-files | grep -vE 'fcst/linux-patches|patch$|pdf$|png$|ibmvstgt/') | sed 's/^#[0-9]*: FILE: \(.*\):/\1:1:/'
+10 -6
View File
@@ -114,7 +114,7 @@ log message: "tgt_dev for LUN 0 not found, command to unexisting LU?"
It is highly recommended to use scstadmin utility for configuring
devices and security groups.
The flow of SCST initialization should be as the following:
The flow of SCST initialization should be as follows:
1. Load of SCST modules with necessary module parameters, if needed.
@@ -1102,9 +1102,13 @@ cache. The following parameters possible for vdisk_fileio:
- read_only - read only. Default is 0.
- o_direct - disables both read and write caching. This mode isn't
currently fully implemented, you should use user space fileio_tgt
program in O_DIRECT mode instead (see below).
- async - submit I/O asynchronously to the device handler. This mode
allows concurrent processing of SCSI commands even when using only
a single SCST command thread.
- o_direct - disables both read and write caching if asynchronous
I/O is used. This mode bypasses the page cache and hence improves
performance.
- nv_cache - enables "non-volatile cache" mode. In this mode it is
assumed that the target has a GOOD UPS with ability to cleanly
@@ -1139,8 +1143,8 @@ cache. The following parameters possible for vdisk_fileio:
- rotational - if set, this device reported as rotational. Otherwise,
it is reported as non-rotational (SSD, etc.)
- zero_copy - if set, then this device uses zero copy access to the
page cache. At the moment, only read side zero copy is implemented.
- zero_copy - ignored. For zero-copy I/O, set the async flag and
possibly also the o_direct flag and use Linux kernel v4.10 or later.
- dif_mode - specifies which T10-PI, or DIF, mode this device will use.
See SCSI standards from more info about T10-PI. Available DIF modes
-2703
View File
File diff suppressed because it is too large Load Diff
+19
View File
@@ -327,6 +327,25 @@ static inline int vfs_fsync_backport(struct file *file, int datasync)
#define vfs_fsync vfs_fsync_backport
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) && \
LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
/*
* See also commit bb7462b6fd64 ("vfs: use helpers for calling
* f_op->{read,write}_iter()").
*/
static inline ssize_t call_read_iter(struct file *file, struct kiocb *kio,
struct iov_iter *iter)
{
return file->f_op->read_iter(kio, iter);
}
static inline ssize_t call_write_iter(struct file *file, struct kiocb *kio,
struct iov_iter *iter)
{
return file->f_op->write_iter(kio, iter);
}
#endif
/* <linux/kernel.h> */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19)
+1 -1
View File
@@ -155,7 +155,7 @@ INSTALL_DIR_H := $(DESTDIR)$(PREFIX)/include/scst
enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi)
EXTRA_CFLAGS += -I$(SCST_INC_DIR) $(call enable-Wextra,-Wextra \
-Wno-unused-parameter -Wno-missing-field-initializers) \
-Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare) \
$(shell [ -n "${CONFIG_SCST_NO_DLM}" ] && echo -DCONFIG_SCST_NO_DLM)
#EXTRA_CFLAGS += -DCONFIG_SCST_STRICT_SERIALIZING
+1 -1
View File
@@ -75,7 +75,7 @@ endif
enable-Wextra = $(shell uname_r="$$(uname -r)"; if [ "$${uname_r%.el5}" = "$${uname_r}" ]; then echo "$(1)"; fi)
EXTRA_CFLAGS += -I$(SUBDIRS) -I$(SCST_INC_DIR) $(call enable-Wextra,-Wextra \
-Wno-unused-parameter -Wno-missing-field-initializers)
-Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare)
EXTRA_CFLAGS += -DCONFIG_SCST_EXTRACHECKS
+3 -3
View File
@@ -1427,7 +1427,7 @@ out_process:
out_inval:
PRINT_ERROR("Invalid parse_reply parameters (LUN %lld, op %s, cmd %p)",
(unsigned long long int)cmd->lun, scst_get_opcode_name(cmd), cmd);
(unsigned long long)cmd->lun, scst_get_opcode_name(cmd), cmd);
PRINT_BUFFER("Invalid parse_reply", reply, sizeof(*reply));
scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_hardw_error));
res = -EINVAL;
@@ -1875,7 +1875,7 @@ out:
out_inval:
PRINT_ERROR("Invalid exec_reply parameters (LUN %lld, op %s, cmd %p)",
(unsigned long long int)cmd->lun, scst_get_opcode_name(cmd), cmd);
(unsigned long long)cmd->lun, scst_get_opcode_name(cmd), cmd);
PRINT_BUFFER("Invalid exec_reply", reply, sizeof(*reply));
out_intern_fail:
@@ -2353,7 +2353,7 @@ static int dev_user_reply_get_cmd(struct file *file, void __user *arg)
goto out;
}
TRACE_DBG("ureply %lld (dev %s)", (unsigned long long int)ureply,
TRACE_DBG("ureply %lld (dev %s)", (unsigned long long)ureply,
dev->name);
if (ureply != 0) {
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -321,7 +321,7 @@ int scst_event_queue_lun_not_found(const struct scst_cmd *cmd)
if (event_entry == NULL) {
PRINT_ERROR("Unable to allocate event (size %d). LUN not found "
"event is lost (LUN %lld, initiator %s, target %s)!",
event_entry_len, (unsigned long long int)cmd->lun,
event_entry_len, (unsigned long long)cmd->lun,
cmd->sess->initiator_name, cmd->tgt->tgt_name);
res = -ENOMEM;
goto out;
+11 -11
View File
@@ -3317,7 +3317,7 @@ static bool __scst_adjust_sg(struct scst_cmd *cmd, struct scatterlist *sg,
TRACE_DBG_FLAG(TRACE_SG_OP|TRACE_MEMORY|TRACE_DEBUG,
"cmd %p (tag %llu), sg %p, sg_cnt %d, "
"adjust_len %d, i %d, sg[j].length %d, left %d",
cmd, (unsigned long long int)cmd->tag,
cmd, (unsigned long long)cmd->tag,
sg, *sg_cnt, adjust_len, i,
sgi->length, left);
@@ -5389,7 +5389,7 @@ static int scst_alloc_add_tgt_dev(struct scst_session *sess,
scst_sgv_pool_use_dma(tgt_dev);
TRACE_MGMT_DBG("Device %s on SCST lun=%lld",
dev->virt_name, (unsigned long long int)tgt_dev->lun);
dev->virt_name, (unsigned long long)tgt_dev->lun);
spin_lock_init(&tgt_dev->tgt_dev_lock);
INIT_LIST_HEAD(&tgt_dev->UA_list);
@@ -7462,7 +7462,7 @@ void scst_free_cmd(struct scst_cmd *cmd)
TRACE_ENTRY();
TRACE_DBG("Freeing cmd %p (tag %llu)",
cmd, (unsigned long long int)cmd->tag);
cmd, (unsigned long long)cmd->tag);
if (unlikely(test_bit(SCST_CMD_ABORTED, &cmd->cmd_flags)))
TRACE_MGMT_DBG("Freeing aborted cmd %p", cmd);
@@ -7505,7 +7505,7 @@ void scst_free_cmd(struct scst_cmd *cmd)
&cmd->cmd_flags);
TRACE_SN("Out of SN cmd %p (tag %llu, sn %d), "
"destroy=%d", cmd,
(unsigned long long int)cmd->tag,
(unsigned long long)cmd->tag,
cmd->sn, destroy);
}
}
@@ -13193,7 +13193,7 @@ static void scst_free_all_UA(struct scst_tgt_dev *tgt_dev)
list_for_each_entry_safe(UA_entry, t,
&tgt_dev->UA_list, UA_list_entry) {
TRACE_MGMT_DBG("Clearing UA for tgt_dev LUN %lld",
(unsigned long long int)tgt_dev->lun);
(unsigned long long)tgt_dev->lun);
list_del(&UA_entry->UA_list_entry);
mempool_free(UA_entry, scst_ua_mempool);
}
@@ -13294,7 +13294,7 @@ restart:
* !! destroyed! !!
*/
TRACE_SN("cmd %p (tag %llu) with skipped sn %d found",
cmd, (unsigned long long int)cmd->tag, cmd->sn);
cmd, (unsigned long long)cmd->tag, cmd->sn);
order_data->def_cmd_count--;
list_del(&cmd->deferred_cmd_list_entry);
spin_unlock_irq(&order_data->sn_lock);
@@ -13394,12 +13394,12 @@ bool __scst_check_blocked_dev(struct scst_cmd *cmd)
if (dev->block_count > 0) {
TRACE_BLOCK("Delaying cmd %p due to blocking "
"(tag %llu, op %s, dev %s)", cmd,
(unsigned long long int)cmd->tag,
(unsigned long long)cmd->tag,
scst_get_opcode_name(cmd), dev->virt_name);
goto out_block;
} else if ((cmd->op_flags & SCST_STRICTLY_SERIALIZED) == SCST_STRICTLY_SERIALIZED) {
TRACE_BLOCK("Strictly serialized cmd %p (tag %llu, op %s, dev %s)",
cmd, (unsigned long long int)cmd->tag,
cmd, (unsigned long long)cmd->tag,
scst_get_opcode_name(cmd), dev->virt_name);
if ((cmd->cdb[0] == MAINTENANCE_OUT) &&
@@ -13432,7 +13432,7 @@ bool __scst_check_blocked_dev(struct scst_cmd *cmd)
} else if ((dev->dev_double_ua_possible) ||
((cmd->op_flags & SCST_SERIALIZED) != 0)) {
TRACE_BLOCK("cmd %p (tag %llu, op %s): blocking further cmds "
"on dev %s due to %s", cmd, (unsigned long long int)cmd->tag,
"on dev %s due to %s", cmd, (unsigned long long)cmd->tag,
scst_get_opcode_name(cmd), dev->virt_name,
dev->dev_double_ua_possible ? "possible double reset UA" :
"serialized cmd");
@@ -13963,13 +13963,13 @@ void scst_xmit_process_aborted_cmd(struct scst_cmd *cmd)
if (test_bit(SCST_CMD_DEVICE_TAS, &cmd->cmd_flags)) {
TRACE_MGMT_DBG("Flag ABORTED OTHER set for cmd %p "
"(tag %llu), returning TASK ABORTED ", cmd,
(unsigned long long int)cmd->tag);
(unsigned long long)cmd->tag);
scst_set_cmd_error_status(cmd, SAM_STAT_TASK_ABORTED);
} else {
TRACE_MGMT_DBG("Flag ABORTED OTHER set for cmd %p "
"(tag %llu), aborting without delivery or "
"notification",
cmd, (unsigned long long int)cmd->tag);
cmd, (unsigned long long)cmd->tag);
/*
* There is no need to check/requeue possible UA,
* because, if it exists, it will be delivered
+1 -1
View File
@@ -2199,7 +2199,7 @@ static int scst_groups_devices_show(struct seq_file *seq, void *v)
list_for_each_entry(acg_dev, &acg->acg_dev_list, acg_dev_list_entry) {
seq_printf(seq, "%-60s%-13lld%s\n",
acg_dev->dev->virt_name,
(unsigned long long int)acg_dev->lun,
(unsigned long long)acg_dev->lun,
acg_dev->acg_dev_rd_only ? "RO" : "");
}
mutex_unlock(&scst_mutex);
+38 -38
View File
@@ -514,7 +514,7 @@ void __scst_check_unblock_dev(struct scst_cmd *cmd)
if (unlikely(cmd->unblock_dev)) {
TRACE_BLOCK("cmd %p (tag %llu): unblocking dev %s", cmd,
(unsigned long long int)cmd->tag, dev->virt_name);
(unsigned long long)cmd->tag, dev->virt_name);
cmd->unblock_dev = 0;
scst_unblock_dev(dev);
} else if (unlikely(dev->strictly_serialized_cmd_waiting)) {
@@ -796,9 +796,9 @@ void scst_cmd_init_done(struct scst_cmd *cmd,
TRACE_DBG("Preferred context: %d (cmd %p)", pref_context, cmd);
TRACE(TRACE_SCSI, "NEW CDB: len %d, lun %lld, initiator %s, "
"target %s, queue_type %x, tag %llu (cmd %p, sess %p)",
cmd->cdb_len, (unsigned long long int)cmd->lun,
cmd->cdb_len, (unsigned long long)cmd->lun,
cmd->sess->initiator_name, cmd->tgt->tgt_name, cmd->queue_type,
(unsigned long long int)cmd->tag, cmd, sess);
(unsigned long long)cmd->tag, cmd, sess);
PRINT_BUFF_FLAG(TRACE_SCSI, "CDB", cmd->cdb, cmd->cdb_len);
#ifdef CONFIG_SCST_EXTRACHECKS
@@ -1653,7 +1653,7 @@ void scst_restart_cmd(struct scst_cmd *cmd, int status,
TRACE_DBG("Preferred context: %d", pref_context);
TRACE_DBG("tag=%llu, status=%#x",
(unsigned long long int)scst_cmd_get_tag(cmd),
(unsigned long long)scst_cmd_get_tag(cmd),
status);
#ifdef CONFIG_SCST_EXTRACHECKS
@@ -2760,7 +2760,7 @@ static int scst_reserve_local(struct scst_cmd *cmd)
if ((cmd->cdb[0] == RESERVE_10) && (cmd->cdb[2] & SCST_RES_3RDPTY)) {
PRINT_ERROR("RESERVE_10: 3rdPty RESERVE not implemented "
"(lun=%lld)", (unsigned long long int)cmd->lun);
"(lun=%lld)", (unsigned long long)cmd->lun);
scst_set_invalid_field_in_cdb(cmd, 2,
SCST_INVAL_FIELD_BIT_OFFS_VALID | 4);
goto out_done;
@@ -3435,7 +3435,7 @@ static int scst_do_real_exec(struct scst_cmd *cmd)
if (unlikely(scsi_dev == NULL)) {
PRINT_ERROR("Command for virtual device must be "
"processed by device handler (LUN %lld)!",
(unsigned long long int)cmd->lun);
(unsigned long long)cmd->lun);
goto out_error;
}
@@ -4150,7 +4150,7 @@ next:
(cmd->cdb[0] == MODE_SELECT_10) ||
(cmd->cdb[0] == LOG_SELECT))) {
TRACE(TRACE_SCSI, "MODE/LOG SELECT succeeded (LUN %lld)",
(unsigned long long int)cmd->lun);
(unsigned long long)cmd->lun);
scst_set_cmd_state(cmd, SCST_CMD_STATE_MODE_SELECT_CHECKS);
goto out;
}
@@ -4163,7 +4163,7 @@ next:
SCST_SENSE_ASCx_VALID,
0, 0x2a, 0x01)) {
TRACE(TRACE_SCSI, "MODE PARAMETERS CHANGED UA (lun "
"%lld)", (unsigned long long int)cmd->lun);
"%lld)", (unsigned long long)cmd->lun);
scst_set_cmd_state(cmd, SCST_CMD_STATE_MODE_SELECT_CHECKS);
goto out;
}
@@ -4201,7 +4201,7 @@ static int scst_mode_select_checks(struct scst_cmd *cmd)
TRACE(TRACE_SCSI, "MODE/LOG SELECT succeeded, "
"setting the SELECT UA (lun=%lld)",
(unsigned long long int)cmd->lun);
(unsigned long long)cmd->lun);
spin_lock_bh(&dev->dev_lock);
if (cmd->cdb[0] == LOG_SELECT) {
@@ -4248,7 +4248,7 @@ static int scst_mode_select_checks(struct scst_cmd *cmd)
TRACE(TRACE_SCSI, "Possible parameters changed UA %x "
"(LUN %lld): getting new parameters", cmd->sense[12],
(unsigned long long int)cmd->lun);
(unsigned long long)cmd->lun);
scst_obtain_device_parameters(cmd->dev, NULL);
} else
@@ -4453,7 +4453,7 @@ again:
if (unlikely(test_bit(SCST_CMD_NO_RESP, &cmd->cmd_flags))) {
EXTRACHECKS_BUG_ON(!test_bit(SCST_CMD_ABORTED, &cmd->cmd_flags));
TRACE_MGMT_DBG("Flag NO_RESP set for cmd %p (tag %llu), "
"skipping", cmd, (unsigned long long int)cmd->tag);
"skipping", cmd, (unsigned long long)cmd->tag);
scst_set_cmd_state(cmd, SCST_CMD_STATE_FINISHED);
goto out_same;
}
@@ -4988,7 +4988,7 @@ static int scst_translate_lun(struct scst_cmd *cmd)
if (likely(!test_bit(SCST_FLAG_SUSPENDED, &scst_flags))) {
TRACE_DBG("Finding tgt_dev for cmd %p (lun %lld)", cmd,
(unsigned long long int)cmd->lun);
(unsigned long long)cmd->lun);
res = -1;
rcu_read_lock();
@@ -5009,7 +5009,7 @@ static int scst_translate_lun(struct scst_cmd *cmd)
} else {
PRINT_INFO("Dev handler for device %lld is NULL, "
"the device will not be visible remotely",
(unsigned long long int)cmd->lun);
(unsigned long long)cmd->lun);
nul_dev = true;
}
}
@@ -5018,7 +5018,7 @@ static int scst_translate_lun(struct scst_cmd *cmd)
TRACE(TRACE_MINOR,
"tgt_dev for LUN %lld not found, command to "
"unexisting LU (initiator %s, target %s)?",
(unsigned long long int)cmd->lun,
(unsigned long long)cmd->lun,
cmd->sess->initiator_name, cmd->tgt->tgt_name);
scst_event_queue_lun_not_found(cmd);
}
@@ -5241,7 +5241,7 @@ restart:
}
} else {
TRACE_MGMT_DBG("Aborting not inited cmd %p (tag %llu)",
cmd, (unsigned long long int)cmd->tag);
cmd, (unsigned long long)cmd->tag);
scst_set_cmd_abnormal_done_state(cmd);
}
@@ -5465,7 +5465,7 @@ void scst_process_active_cmd(struct scst_cmd *cmd, bool atomic)
res = SCST_CMD_STATE_RES_CONT_NEXT;
TRACE_MGMT_DBG("Skipping cmd %p (tag %llu), "
"because of TM DBG delay", cmd,
(unsigned long long int)cmd->tag);
(unsigned long long)cmd->tag);
break;
}
res = scst_exec_check_sn(&cmd);
@@ -5851,7 +5851,7 @@ static int scst_mgmt_translate_lun(struct scst_mgmt_cmd *mcmd)
TRACE_ENTRY();
TRACE_DBG("Finding tgt_dev for mgmt cmd %p (lun %lld)", mcmd,
(unsigned long long int)mcmd->lun);
(unsigned long long)mcmd->lun);
res = scst_get_mgmt(mcmd);
if (unlikely(res != 0))
@@ -5885,7 +5885,7 @@ void scst_done_cmd_mgmt(struct scst_cmd *cmd)
TRACE_ENTRY();
TRACE_MGMT_DBG("cmd %p done (tag %llu)",
cmd, (unsigned long long int)cmd->tag);
cmd, (unsigned long long)cmd->tag);
spin_lock_irqsave(&scst_mcmd_lock, flags);
@@ -6041,7 +6041,7 @@ void scst_finish_cmd_mgmt(struct scst_cmd *cmd)
TRACE_ENTRY();
TRACE(TRACE_MGMT, "Aborted cmd %p finished (tag %llu, ref %d)", cmd,
(unsigned long long int)cmd->tag, atomic_read(&cmd->cmd_ref));
(unsigned long long)cmd->tag, atomic_read(&cmd->cmd_ref));
spin_lock_irqsave(&scst_mcmd_lock, flags);
@@ -6145,7 +6145,7 @@ void scst_abort_cmd(struct scst_cmd *cmd, struct scst_mgmt_cmd *mcmd,
EXTRACHECKS_BUG_ON(!mcmd);
TRACE(TRACE_SCSI|TRACE_MGMT_DEBUG, "Aborting cmd %p (tag %llu, op %s)",
cmd, (unsigned long long int)cmd->tag, scst_get_opcode_name(cmd));
cmd, (unsigned long long)cmd->tag, scst_get_opcode_name(cmd));
/* To protect from concurrent aborts */
spin_lock_irqsave(&other_ini_lock, flags);
@@ -6230,7 +6230,7 @@ void scst_abort_cmd(struct scst_cmd *cmd, struct scst_mgmt_cmd *mcmd,
if (cmd->sent_for_exec && !cmd->done) {
TRACE_MGMT_DBG("cmd %p (tag %llu) is being executed",
cmd, (unsigned long long int)cmd->tag);
cmd, (unsigned long long)cmd->tag);
mstb->done_counted = 1;
mcmd->cmd_done_wait_count++;
}
@@ -6258,7 +6258,7 @@ void scst_abort_cmd(struct scst_cmd *cmd, struct scst_mgmt_cmd *mcmd,
"deferring ABORT (cmd_done_wait_count %d, "
"cmd_finish_wait_count %d, internal %d, mcmd "
"fn %d (mcmd %p), initiator %s, target %s)",
cmd, (unsigned long long int)cmd->tag,
cmd, (unsigned long long)cmd->tag,
cmd->sn, scst_get_cmd_state_name(state_name,
sizeof(state_name), cmd->state),
scst_get_opcode_name(cmd),
@@ -6497,7 +6497,7 @@ static int scst_abort_task_set(struct scst_mgmt_cmd *mcmd)
struct scst_tgt_dev *tgt_dev = mcmd->mcmd_tgt_dev;
TRACE(TRACE_MGMT, "Aborting task set (lun=%lld, mcmd=%p)",
(unsigned long long int)tgt_dev->lun, mcmd);
(unsigned long long)tgt_dev->lun, mcmd);
__scst_abort_task_set(mcmd, tgt_dev);
@@ -6547,7 +6547,7 @@ static bool scst_is_cmd_belongs_to_dev(struct scst_cmd *cmd,
TRACE_ENTRY();
TRACE_DBG("Finding match for dev %s and cmd %p (lun %lld)",
dev->virt_name, cmd, (unsigned long long int)cmd->lun);
dev->virt_name, cmd, (unsigned long long)cmd->lun);
rcu_read_lock();
tgt_dev = scst_lookup_tgt_dev(cmd->sess, cmd->lun);
@@ -6569,7 +6569,7 @@ static int scst_clear_task_set(struct scst_mgmt_cmd *mcmd)
TRACE_ENTRY();
TRACE(TRACE_MGMT, "Clearing task set (lun=%lld, mcmd=%p)",
(unsigned long long int)mcmd->lun, mcmd);
(unsigned long long)mcmd->lun, mcmd);
#if 0 /* we are SAM-3 */
/*
@@ -6686,7 +6686,7 @@ static int scst_mgmt_cmd_init(struct scst_mgmt_cmd *mcmd)
if (cmd == NULL) {
TRACE_MGMT_DBG("ABORT TASK: command "
"for tag %llu not found",
(unsigned long long int)mcmd->tag);
(unsigned long long)mcmd->tag);
scst_mgmt_cmd_set_status(mcmd, SCST_MGMT_STATUS_TASK_NOT_EXIST);
spin_unlock_irq(&sess->sess_list_lock);
res = scst_set_mcmd_next_state(mcmd);
@@ -6698,7 +6698,7 @@ static int scst_mgmt_cmd_init(struct scst_mgmt_cmd *mcmd)
mcmd->cpu_cmd_counter = scst_get();
spin_unlock_irq(&sess->sess_list_lock);
TRACE_DBG("Cmd to abort %p for tag %llu found (tgt_dev %p)",
cmd, (unsigned long long int)mcmd->tag, tgt_dev);
cmd, (unsigned long long)mcmd->tag, tgt_dev);
mcmd->cmd_to_abort = cmd;
sBUG_ON(mcmd->mcmd_tgt_dev != NULL);
mcmd->mcmd_tgt_dev = tgt_dev;
@@ -6740,7 +6740,7 @@ static int scst_mgmt_cmd_init(struct scst_mgmt_cmd *mcmd)
mcmd->state = SCST_MCMD_STATE_EXEC;
else if (rc < 0) {
PRINT_ERROR("Corresponding device for LUN %lld not "
"found", (unsigned long long int)mcmd->lun);
"found", (unsigned long long)mcmd->lun);
scst_mgmt_cmd_set_status(mcmd, SCST_MGMT_STATUS_LUN_NOT_EXIST);
res = scst_set_mcmd_next_state(mcmd);
} else
@@ -6881,7 +6881,7 @@ static int scst_lun_reset(struct scst_mgmt_cmd *mcmd)
TRACE_ENTRY();
TRACE(TRACE_MGMT, "Resetting LUN %lld (mcmd %p)",
(unsigned long long int)tgt_dev->lun, mcmd);
(unsigned long long)tgt_dev->lun, mcmd);
mcmd->needs_unblocking = 1;
@@ -7103,21 +7103,21 @@ static int scst_abort_task(struct scst_mgmt_cmd *mcmd)
TRACE_MGMT_DBG("Aborting task (cmd %p, sn %d, set %d, tag %llu, "
"queue_type %x)", cmd, cmd->sn, cmd->sn_set,
(unsigned long long int)mcmd->tag, cmd->queue_type);
(unsigned long long)mcmd->tag, cmd->queue_type);
if (mcmd->lun_set && (mcmd->lun != cmd->lun)) {
PRINT_ERROR("ABORT TASK: LUN mismatch: mcmd LUN %llx, "
"cmd LUN %llx, cmd tag %llu",
(unsigned long long int)mcmd->lun,
(unsigned long long int)cmd->lun,
(unsigned long long int)mcmd->tag);
(unsigned long long)mcmd->lun,
(unsigned long long)cmd->lun,
(unsigned long long)mcmd->tag);
scst_mgmt_cmd_set_status(mcmd, SCST_MGMT_STATUS_REJECTED);
} else if (mcmd->cmd_sn_set &&
(scst_sn_before(mcmd->cmd_sn, cmd->tgt_sn) ||
(mcmd->cmd_sn == cmd->tgt_sn))) {
PRINT_ERROR("ABORT TASK: SN mismatch: mcmd SN %x, "
"cmd SN %x, cmd tag %llu", mcmd->cmd_sn,
cmd->tgt_sn, (unsigned long long int)mcmd->tag);
cmd->tgt_sn, (unsigned long long)mcmd->tag);
scst_mgmt_cmd_set_status(mcmd, SCST_MGMT_STATUS_REJECTED);
} else {
spin_lock_irq(&cmd->sess->sess_list_lock);
@@ -7208,7 +7208,7 @@ static int scst_clear_aca_mcmd(struct scst_mgmt_cmd *mcmd)
TRACE(TRACE_MGMT, "CLEAR ACA (dev %s, lun=%lld, mcmd %p, tgt_dev %p)",
mcmd_tgt_dev->dev->virt_name,
(unsigned long long int)mcmd_tgt_dev->lun, mcmd, mcmd_tgt_dev);
(unsigned long long)mcmd_tgt_dev->lun, mcmd, mcmd_tgt_dev);
spin_lock_irq(&order_data->sn_lock);
@@ -7812,9 +7812,9 @@ int scst_rx_mgmt_fn(struct scst_session *sess,
TRACE_MGMT_DBG("sess=%p, tag_set %d, tag %lld, lun_set %d, "
"lun=%lld, cmd_sn_set %d, cmd_sn %d, priv %p", sess,
params->tag_set,
(unsigned long long int)params->tag,
(unsigned long long)params->tag,
params->lun_set,
(unsigned long long int)mcmd->lun,
(unsigned long long)mcmd->lun,
params->cmd_sn_set,
params->cmd_sn,
params->tgt_priv);
@@ -8555,7 +8555,7 @@ static struct scst_cmd *__scst_find_cmd_by_tag(struct scst_session *sess,
/* ToDo: hash list */
TRACE_DBG("%s (sess=%p, tag=%llu)", "Searching in sess cmd list",
sess, (unsigned long long int)tag);
sess, (unsigned long long)tag);
list_for_each_entry(cmd, &sess->sess_cmd_list,
sess_cmd_list_entry) {
+60 -55
View File
@@ -799,7 +799,7 @@ out_up:
#endif /* CONFIG_SCST_PROC */
static int scst_local_abort(struct scsi_cmnd *SCpnt)
static int scst_local_abort(struct scsi_cmnd *scmd)
{
struct scst_local_sess *sess;
int ret;
@@ -807,10 +807,11 @@ static int scst_local_abort(struct scsi_cmnd *SCpnt)
TRACE_ENTRY();
sess = to_scst_lcl_sess(scsi_get_device(SCpnt->device->host));
sess = to_scst_lcl_sess(scsi_get_device(scmd->device->host));
ret = scst_rx_mgmt_fn_tag(sess->scst_sess, SCST_ABORT_TASK, SCpnt->tag,
false, &dev_reset_completion);
ret = scst_rx_mgmt_fn_tag(sess->scst_sess, SCST_ABORT_TASK,
blk_mq_unique_tag(scmd->request),
false, &dev_reset_completion);
/* Now wait for the completion ... */
wait_for_completion_interruptible(&dev_reset_completion);
@@ -824,7 +825,7 @@ static int scst_local_abort(struct scsi_cmnd *SCpnt)
return ret;
}
static int scst_local_device_reset(struct scsi_cmnd *SCpnt)
static int scst_local_device_reset(struct scsi_cmnd *scmd)
{
struct scst_local_sess *sess;
struct scsi_lun lun;
@@ -833,9 +834,9 @@ static int scst_local_device_reset(struct scsi_cmnd *SCpnt)
TRACE_ENTRY();
sess = to_scst_lcl_sess(scsi_get_device(SCpnt->device->host));
sess = to_scst_lcl_sess(scsi_get_device(scmd->device->host));
int_to_scsilun(SCpnt->device->lun, &lun);
int_to_scsilun(scmd->device->lun, &lun);
ret = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_LUN_RESET,
lun.scsi_lun, sizeof(lun), false,
@@ -854,7 +855,7 @@ static int scst_local_device_reset(struct scsi_cmnd *SCpnt)
}
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 25))
static int scst_local_target_reset(struct scsi_cmnd *SCpnt)
static int scst_local_target_reset(struct scsi_cmnd *scmd)
{
struct scst_local_sess *sess;
struct scsi_lun lun;
@@ -863,9 +864,9 @@ static int scst_local_target_reset(struct scsi_cmnd *SCpnt)
TRACE_ENTRY();
sess = to_scst_lcl_sess(scsi_get_device(SCpnt->device->host));
sess = to_scst_lcl_sess(scsi_get_device(scmd->device->host));
int_to_scsilun(SCpnt->device->lun, &lun);
int_to_scsilun(scmd->device->lun, &lun);
ret = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_TARGET_RESET,
lun.scsi_lun, sizeof(lun), false,
@@ -936,9 +937,9 @@ static int scst_local_send_resp(struct scsi_cmnd *cmnd,
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
static int scst_local_queuecommand(struct Scsi_Host *host,
struct scsi_cmnd *SCpnt)
struct scsi_cmnd *scmd)
#else
static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt,
static int scst_local_queuecommand_lck(struct scsi_cmnd *scmd,
void (*done)(struct scsi_cmnd *))
__acquires(&h->host_lock)
__releases(&h->host_lock)
@@ -956,26 +957,26 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt,
TRACE_ENTRY();
TRACE_DBG("lun %lld, cmd: 0x%02X", (u64)SCpnt->device->lun,
SCpnt->cmnd[0]);
TRACE_DBG("lun %lld, cmd: 0x%02X", (u64)scmd->device->lun,
scmd->cmnd[0]);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 37)
/*
* We save a pointer to the done routine in SCpnt->scsi_done and
* We save a pointer to the done routine in scmd->scsi_done and
* we save that as tgt specific stuff below.
*/
SCpnt->scsi_done = done;
scmd->scsi_done = done;
#endif
sess = to_scst_lcl_sess(scsi_get_device(SCpnt->device->host));
sess = to_scst_lcl_sess(scsi_get_device(scmd->device->host));
if (sess->unregistering) {
SCpnt->result = DID_BAD_TARGET << 16;
SCpnt->scsi_done(SCpnt);
scmd->result = DID_BAD_TARGET << 16;
scmd->scsi_done(scmd);
return 0;
}
scsi_set_resid(SCpnt, 0);
scsi_set_resid(scmd, 0);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25))
/*
@@ -988,7 +989,7 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt,
sizeof(*tgt_specific));
return SCSI_MLQUEUE_HOST_BUSY;
}
tgt_specific->cmnd = SCpnt;
tgt_specific->cmnd = scmd;
tgt_specific->done = done;
#endif
@@ -1000,22 +1001,22 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt,
* get into mem alloc deadlock when mounting file systems over
* our devices.
*/
int_to_scsilun(SCpnt->device->lun, &lun);
int_to_scsilun(scmd->device->lun, &lun);
scst_cmd = scst_rx_cmd(sess->scst_sess, lun.scsi_lun, sizeof(lun),
SCpnt->cmnd, SCpnt->cmd_len, true);
scmd->cmnd, scmd->cmd_len, true);
if (!scst_cmd) {
PRINT_ERROR("%s", "scst_rx_cmd() failed");
return SCSI_MLQUEUE_HOST_BUSY;
}
scst_cmd_set_tag(scst_cmd, SCpnt->tag);
scst_cmd_set_tag(scst_cmd, blk_mq_unique_tag(scmd->request));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
if (SCpnt->device->tagged_supported && SCpnt->device->simple_tags)
if (scmd->device->tagged_supported && scmd->device->simple_tags)
scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_SIMPLE);
else
scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_UNTAGGED);
#else
switch (scsi_get_tag_type(SCpnt->device)) {
switch (scsi_get_tag_type(scmd->device)) {
case MSG_SIMPLE_TAG:
scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_SIMPLE);
break;
@@ -1038,9 +1039,9 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt,
* to one. We use scsi_sg_count to isolate us from the changes from
* version to version
*/
if (scsi_sg_count(SCpnt)) {
sgl = scsi_sglist(SCpnt);
sgl_count = scsi_sg_count(SCpnt);
if (scsi_sg_count(scmd)) {
sgl = scsi_sglist(scmd);
sgl_count = scsi_sg_count(scmd);
} else {
/*
* Build a one-element scatter list out of the buffer
@@ -1050,11 +1051,11 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt,
* We use the sglist and bufflen function/macros to isolate
* us from kernel version differences.
*/
if (scsi_sglist(SCpnt)) {
sg_init_one(&(tgt_specific->sgl),
scsi_sglist(SCpnt),
scsi_bufflen(SCpnt));
sgl = &(tgt_specific->sgl);
if (scsi_sglist(scmd)) {
sg_init_one(&tgt_specific->sgl,
scsi_sglist(scmd),
scsi_bufflen(scmd));
sgl = &tgt_specific->sgl;
sgl_count = 1;
} else {
sgl = NULL;
@@ -1062,30 +1063,30 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt,
}
}
#else
sgl = scsi_sglist(SCpnt);
sgl_count = scsi_sg_count(SCpnt);
sgl = scsi_sglist(scmd);
sgl_count = scsi_sg_count(scmd);
#endif
if (scsi_bidi_cmnd(SCpnt)) {
if (scsi_bidi_cmnd(scmd)) {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 24)
/* Some of these symbols are only defined after 2.6.24 */
dir = SCST_DATA_BIDI;
scst_cmd_set_expected(scst_cmd, dir, scsi_bufflen(SCpnt));
scst_cmd_set_expected(scst_cmd, dir, scsi_bufflen(scmd));
scst_cmd_set_expected_out_transfer_len(scst_cmd,
scsi_in(SCpnt)->length);
scsi_in(scmd)->length);
scst_cmd_set_noio_mem_alloc(scst_cmd);
scst_cmd_set_tgt_sg(scst_cmd, scsi_in(SCpnt)->table.sgl,
scsi_in(SCpnt)->table.nents);
scst_cmd_set_tgt_sg(scst_cmd, scsi_in(scmd)->table.sgl,
scsi_in(scmd)->table.nents);
scst_cmd_set_tgt_out_sg(scst_cmd, sgl, sgl_count);
#endif
} else if (SCpnt->sc_data_direction == DMA_TO_DEVICE) {
} else if (scmd->sc_data_direction == DMA_TO_DEVICE) {
dir = SCST_DATA_WRITE;
scst_cmd_set_expected(scst_cmd, dir, scsi_bufflen(SCpnt));
scst_cmd_set_expected(scst_cmd, dir, scsi_bufflen(scmd));
scst_cmd_set_noio_mem_alloc(scst_cmd);
scst_cmd_set_tgt_sg(scst_cmd, sgl, sgl_count);
} else if (SCpnt->sc_data_direction == DMA_FROM_DEVICE) {
} else if (scmd->sc_data_direction == DMA_FROM_DEVICE) {
dir = SCST_DATA_READ;
scst_cmd_set_expected(scst_cmd, dir, scsi_bufflen(SCpnt));
scst_cmd_set_expected(scst_cmd, dir, scsi_bufflen(scmd));
scst_cmd_set_noio_mem_alloc(scst_cmd);
scst_cmd_set_tgt_sg(scst_cmd, sgl, sgl_count);
} else {
@@ -1097,7 +1098,7 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25))
scst_cmd_set_tgt_priv(scst_cmd, tgt_specific);
#else
scst_cmd_set_tgt_priv(scst_cmd, SCpnt);
scst_cmd_set_tgt_priv(scst_cmd, scmd);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
@@ -1108,7 +1109,7 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *SCpnt,
* real effect.
*/
#ifdef CONFIG_SMP
if (spin_is_locked(SCpnt->device->host->host_lock))
if (spin_is_locked(scmd->device->host->host_lock))
scst_cmd_init_done(scst_cmd, SCST_CONTEXT_THREAD);
else
#endif
@@ -1452,7 +1453,7 @@ static int scst_local_targ_xmit_response(struct scst_cmd *scst_cmd)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25))
struct scst_local_tgt_specific *tgt_specific;
#endif
struct scsi_cmnd *SCpnt = NULL;
struct scsi_cmnd *scmd = NULL;
void (*done)(struct scsi_cmnd *);
TRACE_ENTRY();
@@ -1469,11 +1470,11 @@ static int scst_local_targ_xmit_response(struct scst_cmd *scst_cmd)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25))
tgt_specific = scst_cmd_get_tgt_priv(scst_cmd);
SCpnt = tgt_specific->cmnd;
scmd = tgt_specific->cmnd;
done = tgt_specific->done;
#else
SCpnt = scst_cmd_get_tgt_priv(scst_cmd);
done = SCpnt->scsi_done;
scmd = scst_cmd_get_tgt_priv(scst_cmd);
done = scmd->scsi_done;
#endif
/*
@@ -1484,20 +1485,20 @@ static int scst_local_targ_xmit_response(struct scst_cmd *scst_cmd)
/* Calculate the residual ... */
if (likely(!scst_get_resid(scst_cmd, &resid, &out_resid))) {
TRACE_DBG("No residuals for request %p", SCpnt);
TRACE_DBG("No residuals for request %p", scmd);
} else {
if (out_resid != 0)
PRINT_ERROR("Unable to return OUT residual %d "
"(op %02x)", out_resid, SCpnt->cmnd[0]);
"(op %02x)", out_resid, scmd->cmnd[0]);
}
scsi_set_resid(SCpnt, resid);
scsi_set_resid(scmd, resid);
/*
* It seems like there is no way to set out_resid ...
*/
(void)scst_local_send_resp(SCpnt, scst_cmd, done,
(void)scst_local_send_resp(scmd, scst_cmd, done,
scst_cmd_get_status(scst_cmd));
}
@@ -1682,6 +1683,10 @@ static int scst_local_driver_probe(struct device *dev)
goto out;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)
hpnt->nr_hw_queues = num_possible_cpus();
#endif
sess->shost = hpnt;
hpnt->max_id = 1; /* Don't want more than one id */