Christoph, On 2018/04/17 8:18, Christoph Hellwig wrote: > On Mon, Apr 16, 2018 at 06:00:34PM -0700, Bart Van Assche wrote: >> This patch on itself does not change the behavior of either ioctl. >> However, this patch is necessary to avoid that these ioctls fail >> with -EIO if sd_revalidate_disk() is called while these ioctls are >> in progress because the current zoned block command code temporarily >> clears data that is needed by these ioctls. See also commit >> 3ed05a987e0f ("blk-zoned: implement ioctls"). > > Hmm. I think we need to avoid clearing that data and update it using > RCU instead. Calling blk_queue_enter before submitting bios is > something that would make zone reporting very different from any > other block layer user. > With the scsi patches that Bart sent, the data is not cleared anymore until it is ready to be updated all at once, in between calls to blk_mq_freeze_queue() and blk_mq_unfreeze_queue(). This prevents the scheduler (deadline and mq-deadline) from using partially incorrect data since the queue freeze guarantees no activity on the scheduler side during the data swap. But for the BIO issuing side, the calls to blk_queue_enter() ensures the same. This all allows to leave unmodified all the blk-zoned.c helper functions that use the request queue information (bitmaps and number of zones), without any need for rcu lock calls. I think this is a simpler approach. Best regards. -- Damien Le Moal Western Digital Research