Christoph, (+CC Jens and Martin) On 6/7/17 22:24, Christoph Hellwig wrote: > On Wed, Jun 07, 2017 at 06:11:33PM +0900, Damien Le Moal wrote: >> Sure, that is one solution. However, not a ideal one as that would >> prevent ZBC/ZAC drives working with target/iscsi. >> There are a few problems there that I am fixing right now, but that >> translation error is stopping all effort. > > The normal way to use the target code is through the block layer. A block backstore in target indeed is great as any block device, not just physical ones, can be exported. The problem is that for a zoned block device the block layer API lacks functions and information to fully emulate the corresponding ZBC SCSI device in target: no open/close/finish zone functions (no REQ_OP_xx for that), and the information from the zoned block device characteristics VPD page 0xB6 is not available. So I am limiting support in target to the passthrough SCSI (pscsi) backstore type (and will also add a user emulation backstore). Fixes needed in pscsi are rather trivial, but the block layer is not involved at the highest level as scsi commands are simply passed along through requests. Hence the ZBC/ZAC translation problem showing up. I could work on completing support for ZBC at the block layer API: 1) Add REQ_OP_ZONE_OPEN/CLOSE/FINISH, with corresponding blkdev_issue_xxx functions 2) Add more queue attributes and corresponding files in sysfs for the zoned block device characteristics 3) Fix sd.c to support the new REQ_OP_ZONE_xxx 4) Add corresponding user ioctls for OPEN/CLOSE/FINISH That's a lot of work for mostly just being used in the target code as none of the other areas in the kernel supporting zoned block devices don't really need these features (dm, f2fs, and on-going btrfs). But if you think that is OK to add all this, I will. And fix target ZBC support using that. Best regards. -- Damien Le Moal, Western Digital -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html