Linux block layer
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Damien Le Moal <damien.lemoal@opensource.wdc.com>,
	linux-ide@vger.kernel.org, linux-block@vger.kernel.org,
	Jens Axboe <axboe@kernel.dk>
Cc: "Maciej S . Szmigiero" <mail@maciej.szmigiero.name>
Subject: Re: [PATCH v4 5/7] ata: libata: Fix FUA handling in ata_build_rw_tf()
Date: Wed, 2 Nov 2022 15:25:21 +0100	[thread overview]
Message-ID: <6dc6661e-5ef2-1ae7-357d-c8108918d222@suse.de> (raw)
In-Reply-To: <20221031015329.141954-6-damien.lemoal@opensource.wdc.com>

On 10/31/22 02:53, Damien Le Moal wrote:
> If a user issues a write command with the FUA bit set for a device with
> NCQ support disabled (that is, the device queue depth was set to 1), the
> LBA 48 command WRITE DMA FUA EXT must be used. However,
> ata_build_rw_tf() ignores this and first tests if LBA 28 can be used
> based on the write command sector and number of blocks. That is, for
> small FUA writes at low LBAs, ata_rwcmd_protocol() will cause the write
> to fail.
> 
> Fix this by preventing the use of LBA 28 for any FUA write request.
> 
> Given that the WRITE MULTI FUA EXT command is marked as obsolete iin the
> ATA specification since ACS-3 (published in 2013), remove the
> ATA_CMD_WRITE_MULTI_FUA_EXT command from the ata_rw_cmds array.
> 
> Finally, since the block layer should never issue a FUA read
> request, warn in ata_build_rw_tf() if we see such request.
> 
> Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
> ---
>   drivers/ata/libata-core.c | 12 +++++++++---
>   1 file changed, 9 insertions(+), 3 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		           Kernel Storage Architect
hare@suse.de			                  +49 911 74053 688
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Felix Imendörffer


  reply	other threads:[~2022-11-02 14:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31  1:53 [PATCH v4 0/7] Damien Le Moal
2022-10-31  1:53 ` [PATCH v4 1/7] block: Prevent the use of REQ_FUA with read operations Damien Le Moal
2022-10-31  1:53 ` [PATCH v4 2/7] ata: libata: Introduce ata_ncq_supported() Damien Le Moal
2022-10-31  1:53 ` [PATCH v4 3/7] ata: libata: Rename and cleanup ata_rwcmd_protocol() Damien Le Moal
2022-10-31  1:53 ` [PATCH v4 4/7] ata: libata: cleanup fua support detection Damien Le Moal
2022-10-31  1:53 ` [PATCH v4 5/7] ata: libata: Fix FUA handling in ata_build_rw_tf() Damien Le Moal
2022-11-02 14:25   ` Hannes Reinecke [this message]
2022-10-31  1:53 ` [PATCH v4 6/7] ata: libata: blacklist FUA support for known buggy drives Damien Le Moal
2022-10-31  1:53 ` [PATCH v4 7/7] ata: libata: Enable fua support by default Damien Le Moal
2022-10-31  1:59 ` [PATCH v4 0/7] Chaitanya Kulkarni
2022-10-31  2:19   ` Damien Le Moal
  -- strict thread matches above, loose matches on Subject: below --
2022-10-31  2:26 [PATCH v4 0/7] Improve libata support for FUA Damien Le Moal
2022-10-31  2:26 ` [PATCH v4 5/7] ata: libata: Fix FUA handling in ata_build_rw_tf() Damien Le Moal

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=6dc6661e-5ef2-1ae7-357d-c8108918d222@suse.de \
    --to=hare@suse.de \
    --cc=axboe@kernel.dk \
    --cc=damien.lemoal@opensource.wdc.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-ide@vger.kernel.org \
    --cc=mail@maciej.szmigiero.name \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox