Hi Malcolm, On Mon, 2016-10-31 at 12:16 +1100, Malcolm Haak wrote: > Hi all, > > In my quest to get targetcli exporting mhvtl devices I ran into a dev0 > in se_dev_align_max_sectors. > Thanks for reporting this long standing PSCSI w/ TYPE_TAPE bug. > Now I am running kernel-3.10.0-229.el7 so it might be patched in newer > kernels, but it seems that when using pscsi to export tape/changer > scsi devices (being that they aren't block devices) it encounters a > zero value for block_size. > > I've made my self a patch that sets a zero block size to PAGE_SIZE and > it's working, but I'm not sure if this is the correct fix. (Patch is > just a simple if block_size == 0 then block_size = PAGE_SIZE) > Sure, let's have a look. Feel free to post your patch here. Btw, how do your PSCSI backend settings look..? head /sys/kernel/config/target/core/pscsi_*/*/info head /sys/kernel/config/target/core/pscsi_*/*/attrib/* > So I guess I'm trying to a) find out if that is a valid fix and b) > regardless if it is/isn't get a fix into mainline for other people to > use. > > IIRC, there is an ancient hack in pscsi_transport_complete() to set the correct sd->sector_size during MODE_SELECT from the underlying scsi_device. Once upon a time ~10 years ago this was required to get things working.. I'd be amazed if we still need that hack, but as you've noticed it's been awhile since someone made PSCSI w/ TYPE_TAPE export work. Nice work btw. -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html