_ioctl.c | 6 ++
> drivers/scsi/ufs/ufshcd.c | 3 ++-
> 13 files changed, 37 insertions(+), 15 deletions(-)
>
> --
> 2.7.4
>
>
--
Damien Le Moal
Western Digital Research
original
command value in struct scsi_eh_save.
Cc: sta...@vger.kernel.org
Signed-off-by: Damien Le Moal
---
Changes from V2:
* Open code resid save/restore to keep the functions style
* rename struct scsi_eh_save resid field to resid_len to match struct
scsi_request field name
Changes from V1
On 2019/09/30 17:42, Finn Thain wrote:
> On Sat, 28 Sep 2019, Damien Le Moal wrote:
>
>> When a non-passthrough command is terminated with CHECK CONDITION,
>> request sense is executed by hijacking the command descriptor. Since
>> scsi_eh_prep_cmnd() and scsi_eh_restore_cm
original
command resid value in struct scsi_eh_save.
Cc: sta...@vger.kernel.org
Signed-off-by: Damien Le Moal
---
Changes from V1:
* Dropped patch 2
* Add resid reset in scsi_eh_prep_cmnd()
drivers/scsi/scsi_error.c | 3 +++
include/scsi/scsi_eh.h| 1 +
2 files changed, 4 insertions(+)
diff
On 2019/09/27 9:34, Alan Stern wrote:
> On Fri, 27 Sep 2019, Damien Le Moal wrote:
>
>> On 2019/09/26 16:57, Alan Stern wrote:
>>> On Fri, 27 Sep 2019, Damien Le Moal wrote:
>>>
>>>> If a non-passthrough command is terminated with a CHECK CONDITION, th
On 2019/09/26 16:57, Alan Stern wrote:
> On Fri, 27 Sep 2019, Damien Le Moal wrote:
>
>> If a non-passthrough command is terminated with a CHECK CONDITION, the
>> scsi error recovery code reuses the failed command scsi_cmnd structure
>> to process error recovery re
: Damien Le Moal
---
drivers/usb/storage/transport.c | 9 +
1 file changed, 9 insertions(+)
diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index 96cb0409dd89..c69fcbe467ef 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
: Damien Le Moal
---
drivers/scsi/scsi_error.c | 2 ++
include/scsi/scsi_eh.h| 1 +
2 files changed, 3 insertions(+)
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 1c470e31ae81..d4ac13979189 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
usb_stor_Bulk_transport(). Note that
usb_stor_CB_transport() does not need changes since usb_stor_bulk_srb()
always sets the resid for a completed command, regardless of the
residual value.
Damien Le Moal (2):
scsi: save/restore command resid for error handling
usb: Clear scsi command resid when residue is 0
On 2019/09/19 16:01, Alan Stern wrote:
> On Thu, 19 Sep 2019, Damien Le Moal wrote:
>
>>> This is exactly the sort of difference one might expect to see from
>>> the commit f664a3cc17b7 ("scsi: kill off the legacy IO path") you
>>> identified as the
On 2019/09/19 10:56, Ming Lei wrote:
> On Thu, Sep 19, 2019 at 08:26:32AM +0000, Damien Le Moal wrote:
>> On 2019/09/18 18:30, Alan Stern wrote:
>>> On Wed, 18 Sep 2019, Andrea Vai wrote:
>>>
>>>>> Also, I wonder if the changing the size of the data transf
nditions. One of these is sync requests on a multiqueue device. We hit this
problem on Zoned disks which can easily return an error for write requests
without the elevator throttling writes per zones (zone write locking). This
problem was discovered by Hans (on CC).
I discussed this with Hannes yesterday and we think we have a fix, but we'll
need to do a lot of testing as all block devices are potentially impacted by the
change, including stacked drivers (DM). Performance regression is scary with any
change in that area (see blk_mq_make_request() and use of
blk_mq_try_issue_directly() vs blk_mq_sched_insert_request()).
--
Damien Le Moal
Western Digital Research
For commands completing with a resid not aligned on the device logical
sector size, also print the command CDB in addition to the current
message to help debug hardware generating such incorrect command
completion information.
Signed-off-by: Damien Le Moal
---
drivers/scsi/sd.c | 1 +
1 file
if (!test_bit(TCMU_CMD_BIT_EXPIRED, &cmd->flags)) {
> + WARN_ON(!cmd->se_cmd);
May be WARN_ON_ONCE() similarly to the previous one ? No strong opinion about it
though.
> list_del_init(&cmd->queue_entry);
> if (err_level == 1) {
> /*
>
Apart from the optional nit above:
Reviewed-by: Damien Le Moal
--
Damien Le Moal
Western Digital Research
On 2019/07/13 0:13, Jens Axboe wrote:
> On 7/11/19 8:05 PM, Jens Axboe wrote:
>> On 7/7/19 8:02 PM, Damien Le Moal wrote:
>>> On 2019/07/01 14:09, Damien Le Moal wrote:
>>>> This series addresses a recuring problem with zone revalidation
>>>> failures obs
problems
disappeared and with no side effects detected.
Thank you.
> Acked-by: Martin K. Petersen
Thanks !
--
Damien Le Moal
Western Digital Research
On 2019/06/21 0:25, Bart Van Assche wrote:
> On 6/19/19 8:48 PM, Damien Le Moal wrote:
>> +/*
>> + * Limit the command buffer size to the arbitrary SD_ZBC_REPORT_SIZE
>> + * size (1MB), allowing up to 16383 zone descriptors being reported with
>> + * a si
Bart,
On 2019/06/21 12:46, Bart Van Assche wrote:
> On 6/20/19 5:58 PM, Damien Le Moal wrote:
>> The REPORT_ZONES command is executed using scsi_execute_req(). Can we pass a
>> vmalloc-ed buffer to that function ? It does look like it since
>> scsi_execute_rq
>> ca
Bart,
On 2019/06/21 0:25, Bart Van Assche wrote:
> On 6/19/19 8:48 PM, Damien Le Moal wrote:
>> +/*
>> + * Limit the command buffer size to the arbitrary SD_ZBC_REPORT_SIZE
>> + * size (1MB), allowing up to 16383 zone descriptors being reported with
>> +
("scsi: sd_zbc: Fix sd_zbc_report_zones() buffer
allocation")
Fixes: e76239a3748c ("block: add a report_zones method")
Cc: sta...@vger.kernel.org
Signed-off-by: Damien Le Moal
---
drivers/scsi/sd_zbc.c | 54 +++
1 file changed,
xpected reply format
rather than the size of the array of generic sturct blkzone passed by
blk_report_zones() makes more sense.
Fixes: e76239a3748c ("block: add a report_zones method")
Cc: sta...@vger.kernel.org
Signed-off-by: Masato Suzuki
Signed-off-by: Damien Le Moal
---
Changes from
is,
BLK_DEF_MAX_SECTORS and max_hw_sectors_kb is several megabytes (16 for SAS and
32 for SATA), which is plenty for even very large blkdev_report_zones()
requests. But the value given with smartpqi is too small for even the report
zones calls from blk_revalidate_zones().
Updating and resending.
Thanks !
--
Damien Le Moal
Western Digital Research
rmat rather than
the generic struct blkzone size expected by blk_report_zones() makes
more sense.
Fixes: e76239a3748c ("block: add a report_zones method")
Cc: sta...@vger.kernel.org
Signed-off-by: Damien Le Moal
Signed-off-by: Masato Suzuki
---
drivers/scsi/sd_zbc.c | 8 +---
1 fi
.
>
> We're also lacking tests for things like ioprio, persistent reservation,
> bcache and so on.
+1 for ioprio discussion. I mentioned my interest in discussing this in my
invite request. Having it as a topic would be great. Since we are in the middle
of blktest improvements for zoned devices, I can try to put together a proposal
as a discussion base.
>
> Adding support for collecting gcov information after running a test case
> would also be awesome (this is missing in xfstests as well).
>
> So I think a session on blktests can help us get the gap closed.
>
> Byte,
> Johannes
>
--
Damien Le Moal
Western Digital Research
Martin,
Any comment on this patch ?
On 2019/01/30 7:55, Damien Le Moal wrote:
> Commit bf5054569653 ("block: Introduce blk_revalidate_disk_zones()")
> inadvertently broke the message output of sd_zbc_print_zones() because
> the zone information initialization of the scsi
There is no need to call twice string_get_size() when the capacity
messages are not going to be printed. Reverse the message output
condition to return early and avoid executing string_get_size() when it
is not necessary.
Signed-off-by: Damien Le Moal
---
drivers/scsi/sd.c | 26
blk_revalidate_zones(). This functions is still called only once the
block device capacity is set on the second revalidate run on boot, or if
the disk zone configuration changed (i.e. the disk changed).
Fixes: bf5054569653 ("block: Introduce blk_revalidate_disk_zones()")
Cc: sta...@vger.kerne
Jens,
On 2018/10/23 16:59, Jens Axboe wrote:
> On 10/12/18 4:08 AM, Damien Le Moal wrote:
>> This series improves zoned block device support (reduce overhead) and
>> introduces many simplifications to the code (overall, there are more
>> deletions
>> than inserti
On 2018/10/16 11:34, Jens Axboe wrote:
> On 10/14/18 6:45 PM, Damien Le Moal wrote:
>> Jens,
>>
>> On 2018/10/14 7:43, Jens Axboe wrote:
>>> On 10/12/18 4:08 AM, Damien Le Moal wrote:
>>>> This series improves zoned block device support (reduce overhead) a
Martin, Mike,
On 2018/10/16 11:34, Jens Axboe wrote:
> On 10/14/18 6:45 PM, Damien Le Moal wrote:
>> Jens,
>>
>> On 2018/10/14 7:43, Jens Axboe wrote:
>>> On 10/12/18 4:08 AM, Damien Le Moal wrote:
>>>> This series improves zoned block device support
Jens,
On 2018/10/14 7:43, Jens Axboe wrote:
> On 10/12/18 4:08 AM, Damien Le Moal wrote:
>> This series improves zoned block device support (reduce overhead) and
>> introduces many simplifications to the code (overall, there are more
>> deletions
>> than inserti
On 2018/10/12 19:23, Hannes Reinecke wrote:
> On 10/12/18 12:08 PM, Damien Le Moal wrote:
>> The unsigned 32 bits overflow check for the zone size value is already
>> done within sd_zbc_check_zones() with the test:
>>
>> } else if (logical_to_sectors(sdkp->d
.
Signed-off-by: Damien Le Moal
Reviewed-by: Christoph Hellwig
Reviewed-by: Hannes Reinecke
---
block/blk-sysfs.c | 11 +++
include/linux/blkdev.h | 10 ++
2 files changed, 21 insertions(+)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 3772671cf2bc..92be8092ca4f
bitmaps allocated and initialized with
blk_revalidate_disk_zones() are freed automatically from
__blk_release_queue() using the block internal function
blk_queue_free_zone_bitmaps().
Signed-off-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Reviewed-by: Christoph Hellwig
---
block/blk-sysfs.c
Get a zoned block device total number of zones. The device can be a
partition of the whole device. The number of zones is always 0 for
regular block devices.
Signed-off-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Reviewed-by: Christoph Hellwig
---
block/ioctl.c | 2
blkdev_reset_zones() to operate similarly to
blkdev_issue_discard() using the next_bio() helper for chaining BIOs. To
avoid code duplication of that function in blk_zoned.c, rename
next_bio() into blk_next_bio() and declare it as a block internal
function in blk.h.
Signed-off-by: Damien Le Moal
: Christoph Hellwig
[Damien]
* Changed method block_device argument to gendisk
* Various bug fixes and improvements
* Added support for null_blk, dm-linear and dm-flakey.
Signed-off-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
---
block/blk-core.c | 1 -
block/blk-mq-debugfs.c
his helper.
Signed-off-by: Damien Le Moal
Reviewed-by: Christoph Hellwig
Reviewed-by: Hannes Reinecke
---
block/blk-zoned.c| 27 +++
drivers/md/dm-zoned-target.c | 3 +--
include/linux/blkdev.h | 5 +
3 files changed, 33 insertions(+), 2 deletions(-)
d
There is no point in allocating more zone descriptors than the number of
zones a block device has for doing a zone report. Avoid doing that in
blkdev_report_zones_ioctl() by limiting the number of zone decriptors
allocated internally to process the user request.
Signed-off-by: Damien Le Moal
Get a zoned block device zone size in number of 512 B sectors.
The zone size is always 0 for regular block devices.
Signed-off-by: Damien Le Moal
Reviewed-by: Hannes Reinecke
Reviewed-by: Christoph Hellwig
---
block/ioctl.c | 2 ++
include/uapi/linux/blkzoned.h | 2 ++
2 files
off-by: Damien Le Moal
---
drivers/scsi/sd_zbc.c | 19 ---
1 file changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
index ca73c46931c0..0678e1e108b0 100644
--- a/drivers/scsi/sd_zbc.c
+++ b/drivers/scsi/sd_zbc.c
@@ -373,7
with zoned block device support disabled
* Rebased on latest rc including the most recent dm patches
Christoph Hellwig (1):
block: add a report_zones method
Damien Le Moal (10):
scsi: sd_zbc: Rearrange code
scsi: sd_zbc: Reduce boot device scan and revalidate time
scsi: s
about 3.5s down to about 900ms. Disk revalidate times are also
reduced from about 450ms down to 230ms.
Signed-off-by: Damien Le Moal
Reviewed-by: Christoph Hellwig
Reviewed-by: Hannes Reinecke
---
drivers/scsi/sd_zbc.c | 94 ++-
1 file changed, 40 inserti
().
Also fix the error message displayed when reading that VPD page fails.
Signed-off-by: Damien Le Moal
Reviewed-by: Christoph Hellwig
Reviewed-by: Hannes Reinecke
---
drivers/scsi/sd_zbc.c | 39 +++
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git a
On 2018/10/12 16:41, Hannes Reinecke wrote:
> On 10/12/18 4:30 AM, Damien Le Moal wrote:
>> Expose through sysfs the nr_zones field of struct request_queue.
>> Exposing this value helps in debugging disk issues as well as
>> facilitating scripts based use of the disk (e.g.
On 2018/10/12 16:35, Hannes Reinecke wrote:
> On 10/12/18 4:30 AM, Damien Le Moal wrote:
>> The 32 bits overflow check for the zone size value is already done
>> within sd_zbc_check_zones() with the test:
>>
>> } else if (logical_to_sectors(sdkp->device, zone_blocks
On 2018/10/12 16:33, Hannes Reinecke wrote:
> On 10/12/18 4:30 AM, Damien Le Moal wrote:
>> Handling checks of ZBC device capacity using the max_lba field of the
>> REPORT ZONES command reply for disks with rc_basis == 0 can be done
>> using the same report zones command re
: Christoph Hellwig
[Damien]
* Changed method block_device argument to gendisk
* Various bug fixes and improvements
* Added support for null_blk, dm-linear and dm-flakey.
Signed-off-by: Damien Le Moal
---
block/blk-core.c | 1 -
block/blk-mq-debugfs.c | 1 -
block/blk-zoned.c
bitmaps allocated and initialized with
blk_revalidate_disk_zones() are freed automatically from
__blk_release_queue() using the block internal function
blk_queue_free_zone_bitmaps().
Signed-off-by: Damien Le Moal
---
block/blk-sysfs.c | 2 +
block/blk-zoned.c | 136
blkdev_reset_zones() to operate similarly to
blkdev_issue_discard() using the next_bio() helper for chaining BIOs. To
avoid code duplication of that function in blk_zoned.c, rename
next_bio() into blk_next_bio() and declare it as a block internal
function in blk.h.
Signed-off-by: Damien Le Moal
.
Signed-off-by: Damien Le Moal
---
block/blk-sysfs.c | 11 +++
include/linux/blkdev.h | 10 ++
2 files changed, 21 insertions(+)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 3772671cf2bc..92be8092ca4f 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -300,6
his helper.
Signed-off-by: Damien Le Moal
Reviewed-by: Christoph Hellwig
---
block/blk-zoned.c| 27 +++
drivers/md/dm-zoned-target.c | 3 +--
include/linux/blkdev.h | 5 +
3 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/block/blk-zoned.
v1:
* Addressed Christoph's and Bart's comments
* Fixed several compilation errors with zoned block device support disabled
* Rebased on latest rc including the most recent dm patches
Christoph Hellwig (1):
block: add a report_zones method
Damien Le Moal (10):
scsi: sd_zbc: Rear
nd fix sd_zbc_check_zones()
error return to -EFBIG instead of -ENODEV if the zone size is too large.
Signed-off-by: Damien Le Moal
Reviewed-by: Christoph Hellwig
---
drivers/scsi/sd_zbc.c | 15 ++-
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/scsi/sd_zbc.c b/d
().
Also fix the error message displayed when reading that VPD page fails.
Signed-off-by: Damien Le Moal
Reviewed-by: Christoph Hellwig
---
drivers/scsi/sd_zbc.c | 39 +++
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git a/drivers/scsi/sd_zbc.c b/drivers
Get a zoned block device zone size in number of 512 B sectors.
The zone size is always 0 for regular block devices.
Signed-off-by: Damien Le Moal
---
block/ioctl.c | 2 ++
include/uapi/linux/blkzoned.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/block/ioctl.c b/block
about 3.5s down to about 900ms. Disk revalidate times are also
reduced from about 450ms down to 230ms.
Signed-off-by: Damien Le Moal
Reviewed-by: Christoph Hellwig
---
drivers/scsi/sd_zbc.c | 94 ++-
1 file changed, 40 insertions(+), 54 deletions(-)
di
Get a zoned block device total number of zones. The device can be a
partition of the whole device. The number of zones is always 0 for
regular block devices.
Signed-off-by: Damien Le Moal
---
block/ioctl.c | 2 ++
include/uapi/linux/blkzoned.h | 1 +
2 files changed, 3
There is no point in allocating more zone descriptors than the number of
zones a block device has for doing a zone report. Avoid doing that in
blkdev_report_zones_ioctl() by limiting the number of zone decriptors
allocated internally to process the user request.
Signed-off-by: Damien Le Moal
ere conditional on CONFIG_BLK_DEV_ZONED?
>
Yes, I guess it would. #ifdef in c code is normally not welcome, so I was a
little heavy handed with this v2 change to avoid adding any to blk-sysfs.c :)
I will rework this and send a v3.
Thanks for the review.
--
Damien Le Moal
Western Digital Research
: Christoph Hellwig
[Damien]
* Changed method block_device argument to gendisk
* Various bug fixes and improvements
* Added support for null_blk, dm-linear and dm-flakey.
Signed-off-by: Damien Le Moal
---
block/blk-core.c | 1 -
block/blk-mq-debugfs.c | 1 -
block/blk-zoned.c
(e.g. blktests).
Signed-off-by: Damien Le Moal
---
block/blk-sysfs.c | 11 +++
include/linux/blkdev.h | 2 +-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 3772671cf2bc..f7060a938bf9 100644
--- a/block/blk-sysfs.c
+++ b
bitmaps allocated and initialized with
blk_revalidate_disk_zones() are freed automatically from
__blk_release_queue() using the block internal function
blk_queue_free_zone_bitmaps().
Signed-off-by: Damien Le Moal
---
block/blk-sysfs.c | 2 +
block/blk-zoned.c | 136
blkdev_reset_zones() to operate similarly to
blkdev_issue_discard() using the next_bio() helper for chaining BIOs. To
avoid code duplication of that function in blk_zoned.c, rename
next_bio() into blk_next_bio() and declare it as a block internal
function in blk.h.
Signed-off-by: Damien Le Moal
about 3.5s down to about 900ms. Disk revalidate times are also
reduced from about 450ms down to 230ms.
Signed-off-by: Damien Le Moal
Reviewed-by: Christoph Hellwig
---
drivers/scsi/sd_zbc.c | 94 ++-
1 file changed, 40 insertions(+), 54 deletions(-)
di
Get a zoned block device zone size in number of 512 B sectors.
The zone size is always 0 for regular block devices.
Signed-off-by: Damien Le Moal
---
block/ioctl.c | 2 ++
include/uapi/linux/blkzoned.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/block/ioctl.c b/block
nd fix sd_zbc_check_zones()
error return to -EFBIG instead of -ENODEV if the zone size is too large.
Signed-off-by: Damien Le Moal
Reviewed-by: Christoph Hellwig
---
drivers/scsi/sd_zbc.c | 15 ++-
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/scsi/sd_zbc.c b/d
latest rc including the most recent dm patches
Christoph Hellwig (1):
block: add a report_zones method
Damien Le Moal (10):
scsi: sd_zbc: Rearrange code
scsi: sd_zbc: Reduce boot device scan and revalidate time
scsi: sd_zbc: Fix sd_zbc_check_zones() error checks
block: Introduce blkde
There is no point in allocating more zone descriptors than the number of
zones a block device has for doing a zone report. Avoid doing that in
blkdev_report_zones_ioctl() by limiting the number of zone decriptors
allocated internally to process the user request.
Signed-off-by: Damien Le Moal
().
Also fix the error message displayed when reading that VPD page fails.
Signed-off-by: Damien Le Moal
Reviewed-by: Christoph Hellwig
---
drivers/scsi/sd_zbc.c | 39 +++
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git a/drivers/scsi/sd_zbc.c b/drivers
Get a zoned block device total number of zones. The device can be a
partition of the whole device. The number of zones is always 0 for
regular block devices.
Signed-off-by: Damien Le Moal
---
block/ioctl.c | 2 ++
include/uapi/linux/blkzoned.h | 1 +
2 files changed, 3
his helper.
Signed-off-by: Damien Le Moal
Reviewed-by: Christoph Hellwig
---
block/blk-zoned.c| 27 +++
drivers/md/dm-zoned-target.c | 3 +--
include/linux/blkdev.h | 5 +
3 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/block/blk-zoned.
improvements
* Added support for null_blk, dm-linear and dm-flakey.
Signed-off-by: Damien Le Moal
---
block/blk-core.c | 1 -
block/blk-mq-debugfs.c | 1 -
block/blk-zoned.c | 164 ++---
drivers/block/null_blk.h | 11 ++-
drivers
Get a zoned block device zone size in number of 512 B sectors.
The zone size is always 0 for regular block devices.
Signed-off-by: Damien Le Moal
---
block/ioctl.c | 2 ++
include/uapi/linux/blkzoned.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/block/ioctl.c b/block
initialized by revalidate_disk_zones()
are freed automatically from __blk_release_queue() using the block
internal function blk_queue_free_zone_bitmaps().
Signed-off-by: Damien Le Moal
---
block/blk-sysfs.c | 2 +
block/blk-zoned.c | 137 +
block/blk.h
his helper.
Signed-off-by: Damien Le Moal
---
block/blk-zoned.c| 27 +++
drivers/md/dm-zoned-target.c | 3 +--
include/linux/blkdev.h | 5 +
3 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
in
There is no point in allocating more zone descriptors than the number of
zones a block device has for doing a zone report. Avoid doing that in
blkdev_report_zones_ioctl() by limiting the number of zone decriptors
allocated internally to process the user request.
Signed-off-by: Damien Le Moal
Get a zoned block device total number of zones. The device can be a
partition of the whole device. The number of zones is always 0 for
regular block devices.
Signed-off-by: Damien Le Moal
---
block/ioctl.c | 2 ++
include/uapi/linux/blkzoned.h | 1 +
2 files changed, 3
blkdev_reset_zones() to operate similarly to
blkdev_issue_discard() using the next_bio() helper for chaining BIOs. To
avoid code duplication of that function in blk_zoned.c, rename
next_bio() into blk_next_bio() and declare it as a block internal
function in blk.h.
Signed-off-by: Damien Le Moal
().
Also fix the error message displayed when reading that VPD page fails.
Signed-off-by: Damien Le Moal
---
drivers/scsi/sd_zbc.c | 39 +++
1 file changed, 19 insertions(+), 20 deletions(-)
diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
index
about 3.5s down to about 900ms. Disk revalidate times are also
reduced from about 450ms down to 230ms.
Signed-off-by: Damien Le Moal
---
drivers/scsi/sd_zbc.c | 94 ++-
1 file changed, 40 insertions(+), 54 deletions(-)
diff --git a/drivers/scsi/sd_zbc.c b/dr
Christoph Hellwig (1):
block: add a report_zones method
Damien Le Moal (10):
scsi: sd_zbc: Rearrange code
scsi: sd_zbc: Reduce boot device scan and revalidate time
scsi: sd_zbc: Fix sd_zbc_check_zones() error checks
block: Introduce blkdev_nr_zones() helper
block: Limit allocati
(e.g. blktests).
Signed-off-by: Damien Le Moal
---
block/blk-sysfs.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 3772671cf2bc..f7060a938bf9 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -300,6 +300,11 @@ static ssize_t
nd fix sd_zbc_check_zones()
error return to -EFBIG instead of -ENODEV if the zone size is too large.
Signed-off-by: Damien Le Moal
---
drivers/scsi/sd_zbc.c | 15 ++-
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c
index ca73c4
ommand(): one for protect, one for ZBC/ZAC and one for the
> rest (the most common case, I assume). That leaves open the question can a ZBC
> disk also have protection information :-)
I do not know of any such drive on the market. The standards certainly do not
prevent it, so that is something that we should have as a possibility.
Best regards.
--
Damien Le Moal
Western Digital Research
1;
> - sd_config_write_same(sdkp);
> - req->__data_len = blk_rq_bytes(req);
> - req->rq_flags |= RQF_QUIET;
> - }
> - break;
> - }
> - }
> - break;
> - default:
> - break;
> - }
> -
> - out:
> if (sd_is_zoned(sdkp))
> sd_zbc_complete(SCpnt, good_bytes, &sshdr);
>
>
--
Damien Le Moal
Western Digital Research
k_rq_sectors(rq) & mask))) {
> + scmd_printk(KERN_ERR, cmd,
> + "request not aligned to logical block size\n");
> + ret = BLKPREP_KILL;
> + goto out;
> + }
> }
>
> /*
> diff --git a/drivers/scsi/sd.h b/drivers/scsi/sd.h
> index 392c7d078ae3..6f58d130fb75 100644
> --- a/drivers/scsi/sd.h
> +++ b/drivers/scsi/sd.h
> @@ -117,6 +117,7 @@ struct scsi_disk {
> unsignedurswrz : 1;
> unsignedsecurity : 1;
> unsignedignore_medium_access_errors : 1;
> + unsignedbounds_check : 1;
> };
> #define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev)
>
>
--
Damien Le Moal
Western Digital Research
m constants. Place check here because only need to check
> + * early and once.
> + */
> + if (REQ_OP_READ + REQ_OP_WRITE > 1)
> + pr_err("%s: REQ_OP_READ=%d REQ_OP_WRITE=%d %s.\n", __func__,
> +REQ_OP_READ, REQ_OP_WRITE,
> +"expected 0 and 1. Logic ERROR");
>
> for (i = 0; i < SD_MAJORS; i++) {
> if (register_blkdev(sd_major(i), "sd") != 0)
>
--
Damien Le Moal
Western Digital Research
ver_byte(result) == DRIVER_SENSE ||
> + (sense_valid && (!scsi_sense_is_deferred(&sshdr
> + good_bytes = sd_done_sense(SCpnt, good_bytes, &sshdr);
> }
> - sdkp->medium_access_timed_out = 0;
>
> - if (unlikely(driver_byte(result) == DRIVER_SENSE ||
> - (sense_valid && !sense_deferred)))
> - good_bytes = sd_done_sense(SCpnt, good_bytes, &sshdr);
> + sdkp->medium_access_timed_out = 0;
>
> if (sd_is_zoned(sdkp))
> sd_zbc_complete(SCpnt, good_bytes, &sshdr);
>
--
Damien Le Moal
Western Digital Research
ot;ret" type to s64.
Fixes: ccce20fc79 ("sd_zbc: Avoid that resetting a zone fails sporadically")
Signed-off-by: Damien Le Moal
Cc: Bart Van Assche
Cc: sta...@kernel.org
---
drivers/scsi/sd_zbc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/scsi/sd
If the ALL bit is set in the ZBC_OUT command, the command zone ID field
(block) should be ignored.
Reported-by: David Butterfield
Signed-off-by: Damien Le Moal
Cc: sta...@vger.kernel.org
---
drivers/ata/libata-scsi.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git
a zone start
LBA should be ILLEGAL REQUEST, regardless if the bad LBA is out of
range.
Reported-by: David Butterfield
Signed-off-by: Damien Le Moal
Cc: sta...@vger.kernel.org
---
drivers/ata/libata-scsi.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/ata
incorrect) LBA OUT OF RANGE.
The second patch disables the ZBC_OUT command block address check if the ALL
bit is set, as defined by the ZBC specifications.
Thank you for considering these patches for inclusion in 4.18 fixes (and CC
stable).
Damien Le Moal (2):
ata: Fix ZBC_OUT command block check
incorrect) LBA OUT OF RANGE.
The second patch disables the ZBC_OUT command block address check if the ALL
bit is set, as defined by the ZBC specifications.
Thank you for considering these patches for inclusion in 4.18 fixes (and CC
stable).
Damien Le Moal (2):
ata: Fix ZBC_OUT command block check
a zone start
LBA should be ILLEGAL REQUEST, regardless if the bad LBA is out of
range.
Reported-by: David Butterfield
Signed-off-by: Damien Le Moal
---
drivers/ata/libata-scsi.c | 13 +++--
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/ata/libata-scsi.c b/drivers/a
incorrect) LBA OUT OF RANGE.
The second patch disables the ZBC_OUT command block address check if the ALL
bit is set, as defined by the ZBC specifications.
Thank you for considering these patches for inclusion in 4.18 fixes (and CC
stable).
Damien Le Moal (2):
ata: Fix ZBC_OUT command block check
If the ALL bit is set in the ZBC_OUT command, the command zone ID field
(block) should be ignored.
Reported-by: David Butterfield
Signed-off-by: Damien Le Moal
---
drivers/ata/libata-scsi.c | 11 ---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/ata/libata
setting a zone fails sporadically
Damien Le Moal (1):
scsi: sd_zbc: Fix potential memory leak
drivers/scsi/sd_zbc.c | 128 +-
1 file changed, 76 insertions(+), 52 deletions(-)
Changes from v1:
* Fixed upstream commit reference in the first patch commit message
--
2.17.0
[Backport of upstream commit 4b433924b2755a94f99258c178684a0e05c344de]
Rework sd_zbc_check_zone_size() to avoid a memory leak due to an early
return if sd_zbc_report_zones() fails.
Signed-off-by: Damien Le Moal
Cc: sta...@vger.kernel.org # 4.14
---
drivers/scsi/sd_zbc.c | 34
t;)
Signed-off-by: Bart Van Assche
[Damien]
* Backport for 4.14-stable
* Updated this commit message
Signed-off-by: Damien Le Moal
Cc: sta...@vger.kernel.org # 4.14
---
drivers/scsi/sd_zbc.c | 98 +++
1 file changed, 63 insertions(+), 35 deletions(-)
di
1 - 100 of 467 matches
Mail list logo