Re: [PATCH v3 10/13] block: fail zone management operations to read-only and offline zones

Damien Le Moal <[email protected]>
Newsgroups org.kernel.vger.linux-block
Organization Western Digital Research
Message-ID <[email protected]>
On 2026/08/11 4:41, Hannes Reinecke wrote:
> On 8/11/26 12:58 PM, Damien Le Moal wrote:
>> Any zone management operation targeting a zone that is in the read-only
>> or offline condition will fail. So there is no point in issuing such
>> BIO. Modify the check in submit_bio_noacct() to use the new helper
>> function bdev_check_zone_mgmt() to check that a zone is sequential (as was
>> checked before) and also that the zone is not offline nor read-only.
>>
>> Signed-off-by: Damien Le Moal <[email protected]>
>> Reviewed-by: Bart Van Assche <[email protected]>
>> ---
>>   block/blk-core.c  |  7 +++++--
>>   block/blk-zoned.c | 24 ++++++++++++++++++++++++
>>   block/blk.h       |  6 ++++++
>>   3 files changed, 35 insertions(+), 2 deletions(-)
>>
> Hmm. But that checks the in-kernel zone state only,
> so I would expect that we still can see failures if
> the zone state has not been updated (yet) while
> the command has been issued.
> What harm would it do to just run the command and
> deal with the results?

NCQ errors are painful with SATA due to the queue drain they cause. So I am all
for avoiding them as much as possible. This is not the hot path and this check
is not a heavy one, so I added it.

This is a minor case anyway since these errors can only come from a bad
application behavior given that a head depop that offline zones is always user
triggered. So a well-behaving application must do a report zones right after the
depop to note the zones that went offline and let them be.

> 
> Cheers,
> 
> Hannes


-- 
Damien Le Moal
Western Digital Research
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.