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

Hannes Reinecke <[email protected]>
Newsgroups org.kernel.vger.linux-block
Message-ID <[email protected]>
On 8/11/26 2:13 PM, Damien Le Moal wrote:
> 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.
> 
Ah yes, these are NCQ commands. That's of course painful.

So:

Reviewed-by: Hannes Reinecke <[email protected]>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
[email protected]                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
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.