From: sashiko-bot@kernel.org
To: "Damien Le Moal" <dlemoal@kernel.org>
Cc: cassel@kernel.org, linux-ide@vger.kernel.org, dlemoal@kernel.org
Subject: Re: [PATCH v2 1/5] ata: libata: rename ata_dev_is_zac()
Date: Thu, 02 Jul 2026 07:16:52 +0000 [thread overview]
Message-ID: <20260702071653.009531F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260702063412.1892584-2-dlemoal@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Incomplete refactoring of ZBC checks leaves SCSI emulation in an inconsistent state for Device Managed drives.
--
commit 8a69ac9e4f68da535d403caef5279dfdb19419f2
Author: Damien Le Moal <dlemoal@kernel.org>
ata: libata: rename ata_dev_is_zac()
The helper function ata_dev_is_zac() is renamed to ata_dev_is_zoned() to
better reflect its checks. Existing callers and an open-coded check are
updated to use the renamed helper.
> diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
> index d54ec1631e9a6..8811bfc373697 100644
> --- a/drivers/ata/libata-scsi.c
> +++ b/drivers/ata/libata-scsi.c
[ ... ]
> @@ -3656,8 +3656,7 @@ static unsigned int ata_scsi_report_supported_opcodes(struct ata_device *dev,
> break;
> case ZBC_IN:
> case ZBC_OUT:
> - if (ata_id_zoned_cap(dev->id) ||
> - dev->class == ATA_DEV_ZAC)
> + if (ata_dev_is_zoned(dev))
[Severity: High]
Should this refactoring also be applied to ata_scsiop_inq_std() and
ata_scsiop_read_cap() to prevent an inconsistent state for Device Managed
drives?
They still use the identical open-coded check:
drivers/ata/libata-scsi.c:ata_scsiop_inq_std() {
...
if (ata_id_zoned_cap(dev->id) || dev->class == ATA_DEV_ZAC)
memcpy(rbuf + 58, versions_zbc, sizeof(versions_zbc));
...
}
drivers/ata/libata-scsi.c:ata_scsiop_read_cap() {
...
if (ata_id_zoned_cap(dev->id) || dev->class == ATA_DEV_ZAC)
rbuf[12] = (1 << 4); /* RC_BASIS */
...
}
By only replacing the check here in ata_scsi_report_supported_opcodes(),
Device Managed zoned drives (ata_id_zoned_cap == 0x02) will correctly no
longer report support for ZBC commands, but will still incorrectly claim ZBC
capabilities in standard INQUIRY and set the ZBC-specific RC_BASIS bit in
READ CAPACITY (16).
> supported = 3;
> break;
> case SECURITY_PROTOCOL_IN:
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260702063412.1892584-1-dlemoal@kernel.org?part=1
next prev parent reply other threads:[~2026-07-02 7:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-02 6:34 [PATCH v2 0/5] Improve ata_scsi_report_supported_opcodes() Damien Le Moal
2026-07-02 6:34 ` [PATCH v2 1/5] ata: libata: rename ata_dev_is_zac() Damien Le Moal
2026-07-02 6:38 ` Hannes Reinecke
2026-07-02 7:16 ` sashiko-bot [this message]
2026-07-02 6:34 ` [PATCH v2 2/5] ata: libata-scsi: refactor ata_scsi_report_supported_opcodes() Damien Le Moal
2026-07-02 6:44 ` Hannes Reinecke
2026-07-02 7:01 ` Damien Le Moal
2026-07-02 6:53 ` sashiko-bot
2026-07-02 13:25 ` Niklas Cassel
2026-07-02 14:36 ` Niklas Cassel
2026-07-02 14:48 ` Christoph Hellwig
2026-07-02 14:53 ` Niklas Cassel
2026-07-02 6:34 ` [PATCH v2 3/5] ata: libata-scsi: improve service action support in ata_scsi_report_supported_opcodes() Damien Le Moal
2026-07-02 6:45 ` Hannes Reinecke
2026-07-02 6:47 ` sashiko-bot
2026-07-02 6:34 ` [PATCH v2 4/5] ata: libata-scsi: support reporting options 2 in REPORT SUPPORTED OPERATION CODES Damien Le Moal
2026-07-02 6:46 ` Hannes Reinecke
2026-07-02 6:52 ` sashiko-bot
2026-07-02 7:00 ` Damien Le Moal
2026-07-02 11:41 ` Niklas Cassel
2026-07-02 6:53 ` Hannes Reinecke
2026-07-02 6:34 ` [PATCH v2 5/5] ata: libata-scsi: support the all command format for reporting supported commands Damien Le Moal
2026-07-02 6:54 ` Hannes Reinecke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260702071653.009531F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=cassel@kernel.org \
--cc=dlemoal@kernel.org \
--cc=linux-ide@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.