]> git.baikalelectronics.ru Git - kernel.git/commit
target/pscsi: Fix TYPE_TAPE + TYPE_MEDIMUM_CHANGER export
authorNicholas Bellinger <nab@linux-iscsi.org>
Fri, 4 Nov 2016 06:06:53 +0000 (23:06 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Wed, 8 Mar 2017 06:15:19 +0000 (22:15 -0800)
commit123fc1e73e46c71166932ca7f41489393ce08b63
tree631bf922978866bf34f0405ad62f72229257f85e
parent94e2a518d0ac4a168bccd1446b1a1407458c45bd
target/pscsi: Fix TYPE_TAPE + TYPE_MEDIMUM_CHANGER export

The following fixes a divide by zero OOPs with TYPE_TAPE
due to pscsi_tape_read_blocksize() failing causing a zero
sd->sector_size being propigated up via dev_attrib.hw_block_size.

It also fixes another long-standing bug where TYPE_TAPE and
TYPE_MEDIMUM_CHANGER where using pscsi_create_type_other(),
which does not call scsi_device_get() to take the device
reference.  Instead, rename pscsi_create_type_rom() to
pscsi_create_type_nondisk() and use it for all cases.

Finally, also drop a dump_stack() in pscsi_get_blocks() for
non TYPE_DISK, which in modern target-core can get invoked
via target_sense_desc_format() during CHECK_CONDITION.

Reported-by: Malcolm Haak <insanemal@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_pscsi.c