]> www.infradead.org Git - users/hch/xfs.git/commitdiff
scsi: set permanent stream count in block limits
authorKeith Busch <kbusch@kernel.org>
Tue, 29 Oct 2024 15:19:22 +0000 (08:19 -0700)
committerChristoph Hellwig <hch@lst.de>
Tue, 5 Nov 2024 15:35:38 +0000 (16:35 +0100)
The block limits exports the number of write hints, so set this limit if
the device reports support for the lifetime hints. Not only does this
inform the user of which hints are possible, it also allows scsi devices
supporting the feature to utilize the full range through raw block
device direct-io.

Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/scsi/sd.c

index ca4bc0ac76adcfa8a883df8f4259ba755d3b6413..235dd6e5b6688a036fa425a869563cccaa2f716c 100644 (file)
@@ -3768,6 +3768,8 @@ static int sd_revalidate_disk(struct gendisk *disk)
                sd_config_protection(sdkp, &lim);
        }
 
+       lim.max_write_hints = sdkp->permanent_stream_count;
+
        /*
         * We now have all cache related info, determine how we deal
         * with flush requests.