[PATCH v2 10/11] block: add a report_zones method

2018-10-11 Thread Damien Le Moal
-by: 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

[PATCH v2 09/11] block: Expose queue nr_zones in sysfs

2018-10-11 Thread Damien Le Moal
(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

[PATCH v2 11/11] block: Introduce blk_revalidate_disk_zones()

2018-10-11 Thread Damien Le Moal
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

[PATCH v2 08/11] block: Improve zone reset execution

2018-10-11 Thread Damien Le Moal
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

[PATCH v2 02/11] scsi: sd_zbc: Reduce boot device scan and revalidate time

2018-10-11 Thread 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(-)

[PATCH v2 06/11] block: Introduce BLKGETZONESZ ioctl

2018-10-11 Thread 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 --- block/ioctl.c | 2 ++ include/uapi/linux/blkzoned.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/block/ioctl.c b/block

[PATCH v2 03/11] scsi: sd_zbc: Fix sd_zbc_check_zones() error checks

2018-10-11 Thread Damien Le Moal
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

[PATCH v2 00/11] Zoned block device support improvements

2018-10-11 Thread Damien Le Moal
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 blkdev_nr_zones

[PATCH v2 05/11] block: Limit allocation of zone descriptors for report zones

2018-10-11 Thread Damien Le Moal
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

[PATCH v2 01/11] scsi: sd_zbc: Rearrange code

2018-10-11 Thread 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

[PATCH v2 07/11] block: Introduce BLKGETNRZONES ioctl

2018-10-11 Thread 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

[PATCH v2 04/11] block: Introduce blkdev_nr_zones() helper

2018-10-11 Thread Damien Le Moal
all to this 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.

Re: [RFC PATCH 2/5] break sd_done sense processing out to own function

2018-08-05 Thread Damien Le Moal
gt; - 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, ); > > -- Damien Le Moal Western Digital Research

Re: [RFC PATCH 1/5] add tweakable bounds_check flag, now off by default

2018-08-05 Thread Damien Le Moal
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

Re: [RFC PATCH 3/5] streamline REQ_OP_READ-WRITE access

2018-08-05 Thread Damien Le Moal
stants. 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

Re: [RFC PATCH 4/5] streamline some logical operations

2018-08-05 Thread Damien Le Moal
(sense_valid && (!scsi_sense_is_deferred( > + good_bytes = sd_done_sense(SCpnt, good_bytes, ); > } > - 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, ); > + sdkp->medium_access_timed_out = 0; > > if (sd_is_zoned(sdkp)) > sd_zbc_complete(SCpnt, good_bytes, ); > -- Damien Le Moal Western Digital Research

[PATCH] scsi: sd_zbc: Fix variable type and bogus comment

2018-07-03 Thread Damien Le Moal
"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

[PATCH V2 2/2] ata: Fix ZBC_OUT all bit handling

2018-06-26 Thread Damien Le Moal
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

[PATCH V2 1/2] ata: Fix ZBC_OUT command block check

2018-06-26 Thread Damien Le Moal
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

[PATCH V2 0/2] ZBC_OUT command translation fixes

2018-06-26 Thread Damien Le Moal
but 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

[PATCH V2 0/2] ZBC_OUT command translation fixes

2018-06-26 Thread Damien Le Moal
but 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

[PATCH 1/2] ata: Fix ZBC_OUT command block check

2018-06-26 Thread Damien Le Moal
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

[PATCH 2/2] ata: Fix ZBC_OUT all bit handling

2018-06-26 Thread Damien Le Moal
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

[PATCH 0/2] ZBC_OUT command translation fixes

2018-06-26 Thread Damien Le Moal
but 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

[PATCH v2 0/2] 4.14 long term stable ZBC fixes

2018-06-04 Thread Damien Le Moal
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

[PATCH v2 1/2] scsi: sd_zbc: Fix potential memory leak

2018-06-04 Thread Damien Le Moal
[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

[PATCH v2 2/2] scsi: sd_zbc: Avoid that resetting a zone fails sporadically

2018-06-04 Thread Damien Le Moal
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

[PATCH 0/2] 4.14 long term stable ZBC fixes

2018-05-31 Thread Damien Le Moal
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(-) -- 2.17.0

[PATCH 1/2] scsi: sd_zbc: Fix potential memory leak

2018-05-31 Thread Damien Le Moal
[Backport of upstream commit 0aa3fdb8b3a6df3c2e3b61dbfe079db9d30e03cd] 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

[PATCH 2/2] scsi: sd_zbc: Avoid that resetting a zone fails sporadically

2018-05-31 Thread Damien Le Moal
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

[PATCH] sd_zbc: Fix sd_zbc_check_zone_size() error path

2018-05-31 Thread Damien Le Moal
. Fixes: ccce20fc7968 ("scsi: sd_zbc: Avoid that resetting a zone fails sporadically") Signed-off-by: Damien Le Moal Cc: Bart Van Assche --- drivers/scsi/sd_zbc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c index 32

Re: [PATCH 3/3] sd_zbc: Avoid that resetting a zone fails sporadically

2018-04-17 Thread Damien Le Moal
) > Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> > Cc: Jens Axboe <ax...@kernel.dk> > Cc: Damien Le Moal <damien.lem...@wdc.com> > Cc: Christoph Hellwig <h...@lst.de> > Cc: Hannes Reinecke <h...@suse.com> > Cc: sta...@vger.kernel.org #

Re: [PATCH 2/3] sd_zbc: Let the SCSI core handle ILLEGAL REQUEST / ASC 0x21

2018-04-17 Thread Damien Le Moal
ode that resets cmd->allowed from > sd_zbc_complete(). > > Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> > Cc: Damien Le Moal <damien.lem...@wdc.com> > Cc: Christoph Hellwig <h...@lst.de> > Cc: Hannes Reinecke <h...@suse.com> > --- > dri

Re: [PATCH 1/3] sd_zbc: Change the type of the ZBC fields into u32

2018-04-17 Thread Damien Le Moal
On 2018/04/16 18:04, Bart Van Assche wrote: > This patch does not change any functionality but makes it clear > that it is on purpose that these fields are 32 bits wide. > > Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> > Cc: Damien Le Moal <damien.lem...@

Re: [PATCH v2] Fix DID_OK handling in __scsi_error_from_host_byte()

2018-04-04 Thread Damien Le Moal
csi_error_from_host_byte() > by only translating good status values into BLK_STS_OK. > > Fixes: e39a97353e53 ("scsi: core: return BLK_STS_OK for DID_OK in > __scsi_error_from_host_byte()") > Reported-by: Damien Le Moal <damien.lem...@wdc.com> > Signed-off-by: Bart

Re: [PATCH 2/2] sd_zbc: Avoid errors due to sd_zbc_setup() execution

2018-04-04 Thread Damien Le Moal
Bart, On 4/5/18 00:22, Bart Van Assche wrote: > On Wed, 2018-04-04 at 17:54 +0900, Damien Le Moal wrote: >> Since SCSI scanning occurs asynchronously, since sd_revalidate_disk() >> is called from sd_probe_async() and since sd_revalidate_disk() calls >> sd_zbc_read_

Re: [PATCH 1/2] sd_zbc: Avoid errors due to sd_zbc_check_zone_size() execution

2018-04-04 Thread Damien Le Moal
Bart, On 4/5/18 00:08, Bart Van Assche wrote: > On 04/04/18 01:54, Damien Le Moal wrote: >> static int sd_zbc_check_zone_size(struct scsi_disk *sdkp) >> { >> +u64 sdkp_zone_blocks = sdkp->zone_blocks; > > Shouldn't this variable be initialized to zero

[PATCH 2/2] sd_zbc: Avoid errors due to sd_zbc_setup() execution

2018-04-04 Thread Damien Le Moal
ff-by: Bart Van Assche <bart.vanass...@wdc.com> [Damien] Updated commit message and changed nr_zones/bitmap swap order. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com> Cc: sta...@vger.ker

[PATCH 0/2] Fix errors due to revalidation of ZBC disks

2018-04-04 Thread Damien Le Moal
series introduces fix these problems by avoiding any change to the disk information unless a change is detected by revalidate. Bart Van Assche (1): sd_zbc: Avoid errors due to sd_zbc_setup() execution Damien Le Moal (1): sd_zbc: Avoid errors due to sd_zbc_check_zone_size() execution drivers

[PATCH 1/2] sd_zbc: Avoid errors due to sd_zbc_check_zone_size() execution

2018-04-04 Thread Damien Le Moal
ne_blocks. This change is valid for both revalidate as well as for the first scan of the device. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Cc: <sta...@vger.kernel.org> --- drivers/scsi/sd_zbc.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/sc

Re: [PATCH] scsi: Fix failed request error code

2018-04-04 Thread Damien Le Moal
On 4/4/18 16:39, Damien Le Moal wrote: > Hannes, > > On 4/4/18 16:35, Hannes Reinecke wrote: >> On Wed, 4 Apr 2018 07:06:58 +0000 >> Damien Le Moal <damien.lem...@wdc.com> wrote: >> >>> Hannes, >>> >>> On 4/4/18 15:57, Hannes Reineck

Re: [PATCH] scsi: Fix failed request error code

2018-04-04 Thread Damien Le Moal
Hannes, On 4/4/18 16:35, Hannes Reinecke wrote: > On Wed, 4 Apr 2018 07:06:58 + > Damien Le Moal <damien.lem...@wdc.com> wrote: > >> Hannes, >> >> On 4/4/18 15:57, Hannes Reinecke wrote: >>> On Wed, 4 Apr 2018 15:51:38 +0900 >&g

Re: [PATCH] scsi: Fix failed request error code

2018-04-04 Thread Damien Le Moal
Hannes, On 4/4/18 15:57, Hannes Reinecke wrote: > On Wed, 4 Apr 2018 15:51:38 +0900 > Damien Le Moal <damien.lem...@wdc.com> wrote: > >> With the introduction of commit e39a97353e53 ("scsi: core: return >> BLK_STS_OK for DID_OK in __scsi_error_from_host_by

[PATCH] scsi: Fix failed request error code

2018-04-04 Thread Damien Le Moal
o be taken for a failed command is to not retry it and terminate it immediately (ACTION_FAIL) . Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Fixes: e39a97353e53 ("scsi: core: return BLK_STS_OK for DID_OK in __scsi_error_from_host_byte()") Cc: Hannes Reineck

Re: [PATCH] Improve ZBC/ZAC error handling

2018-03-06 Thread Damien Le Moal
Replicating the code is of course trivial but rather dirty. Best regards. -- Damien Le Moal Western Digital Research

Re: [PATCH] Improve ZBC/ZAC error handling

2018-03-04 Thread Damien Le Moal
Tejun, On 2018/03/05 5:33, Tejun Heo wrote: > On Fri, Mar 02, 2018 at 04:40:18AM +0900, Damien Le Moal wrote: >> This series introduces changes to scsi and libata error handling for ZBC and >> ZAC >> devices. >> >> The first patch moves ZBC specific

[PATCH] sd_zbc: Fix potential memory leak

2018-03-01 Thread Damien Le Moal
Rework sd_zbc_check_zone_size() to avoid a memory leak due to an early return if sd_zbc_report_zones() fails. Reported-by: David.butterfield <david.butterfi...@wdc.com> Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Cc: sta...@vger.kernel.org --- drivers/scsi/s

[PATCH 2/6] libata: Use scsi_zbc_noretry_cmd() for ZAC devices

2018-03-01 Thread Damien Le Moal
Improve decisions regarding command retry worthiness by calling the funtion scsi_zbc_noretry_cmd() in ata_eh_worth_retry() if the command target is a ZAC device. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/ata/libata-eh.c | 4 1 file changed, 4 insertions(+)

[PATCH 1/6] scsi: Introduce scsi_zbc_noretry_cmd()

2018-03-01 Thread Damien Le Moal
in scsi_noretry_cmd(). This allows simplifying sd_zbc_complete() which now only has to deal with report zones command reply. scsi_zbc_noretry_cmd() is also exported so that it can be used from libata. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/scsi_error.

[PATCH 4/6] libata: Fix ata_err_string()

2018-03-01 Thread Damien Le Moal
Add proper error string output for ATA_ERR_NCQ and ATA_ERR_NODEV_HINT instead of returning "unknown error". Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/ata/libata-eh.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/ata/libata-eh.c b/drivers

[PATCH 3/6] libata: Fix comment typo in ata_eh_analyze_tf()

2018-03-01 Thread Damien Le Moal
Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/ata/libata-eh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 504272b18e75..d6264235c3d7 100644 --- a/drivers/ata/libata-eh.c +++ b/drive

[PATCH 6/6] libata: Be quiet when asked to

2018-03-01 Thread Damien Le Moal
For a successful setting of the device transfer speed mode in ata_dev_set_mode(), do not print the message "ataX.XX: configured for xxx" if the EH context has the quiet flag set. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/ata/libata-core.c | 7 --- 1

[PATCH 5/6] libata: Honor RQF_QUIET flag

2018-03-01 Thread Damien Le Moal
and irq_stat messages printed. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/ata/libata-eh.c | 26 +- drivers/ata/libata-scsi.c | 3 +++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libat

[PATCH] Improve ZBC/ZAC error handling

2018-03-01 Thread Damien Le Moal
are improvements in libata error handling verbosity. Damien Le Moal (6): scsi: Introduce scsi_zbc_noretry_cmd() libata: Use scsi_zbc_noretry_cmd() for ZAC devices libata: Fix comment typo in ata_eh_analyze_tf() libata: Fix ata_err_string() libata: Honor RQF_QUIET flag libata: Be quiet when asked

Re: [PATCH v2] Avoid that ATA error handling can trigger a kernel hang or oops

2018-02-27 Thread Damien Le Moal
ltiple users have confirmed independently > that this patch fixes the double call_rcu() issue for them. > > Thanks, > > Bart. Please feel free to add: Reviewed-by: Damien Le Moal <damien.lem...@wdc.com> Tested-by: Damien Le Moal <damien.lem...@wdc.com> -- Damien Le Moal Western Digital Research

Re: [PATCH] Avoid that ATA error handling hangs

2018-02-21 Thread Damien Le Moal
On 2/22/18 14:08, Damien Le Moal wrote: > Bart, > > On 2/22/18 12:53, Bart Van Assche wrote: >> On Thu, 2018-02-22 at 02:23 +0000, Damien Le Moal wrote: >>> On Wed, 2018-02-21 at 09:23 -0800, Bart Van Assche wrote: >>>> [ ... ] >>> This does not

Re: [PATCH] Avoid that ATA error handling hangs

2018-02-21 Thread Damien Le Moal
Bart, On 2/22/18 12:53, Bart Van Assche wrote: > On Thu, 2018-02-22 at 02:23 +0000, Damien Le Moal wrote: >> On Wed, 2018-02-21 at 09:23 -0800, Bart Van Assche wrote: >>> [ ... ] >> This does not compile. > > This patch depends on another patch that is not yet in M

Re: [PATCH] Avoid that ATA error handling hangs

2018-02-21 Thread Damien Le Moal
Bart, On 2/22/18 13:39, Bart Van Assche wrote: > On Thu, 2018-02-22 at 04:39 +, Bart Van Assche wrote: >> On Thu, 2018-02-22 at 04:19 +0000, Damien Le Moal wrote: >>> It looks OK to me, at least if CONFIG_DEBUG_OBJECTS_RCU_HEAD is turned >>> off since the init_rcu_

Re: [PATCH] Avoid that ATA error handling hangs

2018-02-21 Thread Damien Le Moal
d object", yes, but that does not match the use of the object done in scsi (i.e. alloc before use + free after use). Because of this doubt, No reviewed-by from me. I will miss fame and fortune this time :) Best regards. -- Damien Le Moal, Western Digital

Re: [PATCH] Avoid that ATA error handling hangs

2018-02-21 Thread Damien Le Moal
Bart, On Wed, 2018-02-21 at 09:23 -0800, Bart Van Assche wrote: > Avoid that the recently introduced call_rcu() call in the SCSI core > causes the RCU core to complain about double call_rcu() calls. > > Reported-by: Natanael Copa <nc...@alpinelinux.org> > Reported-by: Damie

Re: [PATCH v2] scsi: remove extra white space at the end of the line

2017-12-21 Thread Damien Le Moal
ite spaces at the *beginning* of lines, and that is only for what your patches touched and the lines around them. If I run in the drivers/scsi directory the command: grep -r '^ [[ ]]*' *.[ch] | wc -l I get 8795 lines. I guess you could make your patch even bigger:) If we exclude leading spaces, applying the patch and doing a "diff -rb" of the patched scsi files against the original unpatched files leads to no differences at all. So it looks good. Best regards. -- Damien Le Moal Western Digital Research

[PATCH V9 3/7] mq-deadline: Introduce zone locking support

2017-12-20 Thread Damien Le Moal
-by: Damien Le Moal <damien.lem...@wdc.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> --- block/mq-deadline.c | 89 +++-- 1 file changed, 86 insertions(+), 3 deletions(-)

[PATCH V9 7/7] sd: Remove zone write locking

2017-12-20 Thread Damien Le Moal
The block layer now handles zone write locking. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> --- drivers/scsi/sd.c| 41 +++-

[PATCH V9 5/7] deadline-iosched: Introduce zone locking support

2017-12-20 Thread Damien Le Moal
-by: Damien Le Moal <damien.lem...@wdc.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> --- block/deadline-iosched.c | 71 ++-- 1 file changed, 68 insertions(+), 3 deletions(-)

[PATCH V9 6/7] sd_zbc: Initialize device request queue zoned data

2017-12-20 Thread Damien Le Moal
capacity (number of zones) changes. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd_zbc.c | 152 +++--- 1 file changed, 144 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c

[PATCH V9 2/7] mq-deadline: Introduce dispatch helpers

2017-12-20 Thread Damien Le Moal
Avoid directly referencing the next_rq and fifo_list arrays using the helper functions deadline_next_request() and deadline_fifo_request() to facilitate changes in the dispatch request selection in __dd_dispatch_request() for zoned block devices. Signed-off-by: Damien Le Moal <damien.

[PATCH V9 4/7] deadline-iosched: Introduce dispatch helpers

2017-12-20 Thread Damien Le Moal
forward declaration of the function deadline_move_request(). Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> --- block/deadl

[PATCH V9 0/7] blk-mq support for ZBC disks

2017-12-20 Thread Damien Le Moal
y introducing scsi_disk_from_queue() Christoph Hellwig (1): block: introduce zoned block devices zone write locking Damien Le Moal (6): mq-deadline: Introduce dispatch helpers mq-deadline: Introduce zone locking support deadline-iosched: Introduce dispatch helpers deadline-iosched: Introduc

[PATCH V9 1/7] block: introduce zoned block devices zone write locking

2017-12-20 Thread Damien Le Moal
dering by limiting to at most a single write request per zone outside of the scheduler at any time. Based on previous patches from Damien Le Moal. Signed-off-by: Christoph Hellwig <h...@lst.de> [Damien] * Fixed comments and identation in blkdev.h * Changed helper functions * Fixed this commit messag

Re: [PATCH] scsi: remove extra white space at the end of the line

2017-12-20 Thread Damien Le Moal
touch a line near one with whitespaces (which can happen a lot...) ? Best regards. -- Damien Le Moal, Western Digital

Re: [PATCH V8 0/7] blk-mq support for ZBC disks

2017-12-11 Thread Damien Le Moal
Jens, On Fri, 2017-11-24 at 16:54 -0700, Jens Axboe wrote: > On 11/24/2017 04:48 PM, Damien Le Moal wrote: > > [Full quote deleted] > > > > Hi Jens, > > > > Any comment regarding this series ? > > I understand that this would be for the 4.16 merge wi

Re: [PATCH V8 0/7] blk-mq support for ZBC disks

2017-11-24 Thread Damien Le Moal
. -- Damien Le Moal Western Digital Research

[PATCH V8 2/7] mq-deadline: Introduce dispatch helpers

2017-11-08 Thread Damien Le Moal
Avoid directly referencing the next_rq and fifo_list arrays using the helper functions deadline_next_request() and deadline_fifo_request() to facilitate changes in the dispatch request selection in __dd_dispatch_request() for zoned block devices. Signed-off-by: Damien Le Moal <damien.

[PATCH V8 4/7] deadline-iosched: Introduce dispatch helpers

2017-11-08 Thread Damien Le Moal
forward declaration of the function deadline_move_request(). Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> --- block/deadl

[PATCH V8 6/7] sd_zbc: Initialize device request queue zoned data

2017-11-08 Thread Damien Le Moal
capacity (number of zones) changes. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd_zbc.c | 152 +++--- 1 file changed, 144 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/sd_zbc.c b/drivers/scsi/sd_zbc.c

[PATCH V8 0/7] blk-mq support for ZBC disks

2017-11-08 Thread Damien Le Moal
lk-mq patches (declarations files) * Split (former) patch 4 into multiple patches to facilitate review * Fixed scsi disk lookup from io scheduler by introducing scsi_disk_from_queue() Christoph Hellwig (1): block: introduce zoned block devices zone write locking Damien Le Moal (6): mq-deadline:

[PATCH V8 5/7] deadline-iosched: Introduce zone locking support

2017-11-08 Thread Damien Le Moal
-by: Damien Le Moal <damien.lem...@wdc.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> --- block/deadline-iosched.c | 71 ++-- 1 file changed, 68 insertions(+), 3 deletions(-)

[PATCH V8 1/7] block: introduce zoned block devices zone write locking

2017-11-08 Thread Damien Le Moal
dering by limiting to at most a single write request per zone outside of the scheduler at any time. Based on previous patches from Damien Le Moal. Signed-off-by: Christoph Hellwig <h...@lst.de> [Damien] * Fixed comments and identation in blkdev.h * Changed helper functions * Fixed this commit messag

[PATCH V8 7/7] sd: Remove zone write locking

2017-11-08 Thread Damien Le Moal
The block layer now handles zone write locking. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> --- drivers/scsi/sd.c| 41 +++-

[PATCH V8 3/7] mq-deadline: Introduce zone locking support

2017-11-08 Thread Damien Le Moal
-by: Damien Le Moal <damien.lem...@wdc.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by: Martin K. Petersen <martin.peter...@oracle.com> --- block/mq-deadline.c | 89 +++-- 1 file changed, 86 insertions(+), 3 deletions(-)

Re: [PATCH V7 6/8] scsi: sd_zbc: Initialize device request queue zoned data

2017-11-08 Thread Damien Le Moal
fter the first report zones... In any case, as you suggested, patch 8 should be merged with this one. I will fix that and post a v8. Thank you for the review. -- Damien Le Moal, Western Digital

[PATCH V7 3/8] block: mq-deadline: Introduce zone locking support

2017-11-08 Thread Damien Le Moal
-by: Damien Le Moal <damien.lem...@wdc.com> --- block/mq-deadline.c | 89 +++-- 1 file changed, 86 insertions(+), 3 deletions(-) diff --git a/block/mq-deadline.c b/block/mq-deadline.c index 8bd6db9e69c7..d56972e8ebda 100644 --- a/block/mq-dead

[PATCH V7 8/8] scsi: sd_zbc: Fix zone information initialization

2017-11-08 Thread Damien Le Moal
Make sure that the device request queue zone information (number of zones and zone bitmaps) are reinitialized if the number of zones changes (e.g. on a drive capacity change on revalidate). Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd_zbc.

[PATCH V7 1/8] block: introduce zoned block devices zone write locking

2017-11-08 Thread Damien Le Moal
dering by limiting to at most a single write request per zone outside of the scheduler at any time. Based on previous patches from Damien Le Moal. Signed-off-by: Christoph Hellwig <h...@lst.de> [Damien] * Fixed comments and identation in blkdev.h * Changed helper functions * Fixed this commit messag

[PATCH V7 7/8] scsi: sd: Remove zone write locking

2017-11-08 Thread Damien Le Moal
The block layer now handles zone write locking. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd.c| 41 +++--- drivers/scsi/sd.h| 11 - drivers/scsi/sd_zbc.c| 105 +++ includ

[PATCH V7 4/8] block: deadline-iosched: Introduce dispatch helpers

2017-11-08 Thread Damien Le Moal
forward declaration of the function deadline_move_request(). Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- block/deadline-iosched.c | 47 +-- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/block/deadline-iosched.c b

[PATCH V7 6/8] scsi: sd_zbc: Initialize device request queue zoned data

2017-11-08 Thread Damien Le Moal
of zones to stabilize on the second revalidation pass to allocate and initialize the bitmaps. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- drivers/scsi/sd_zbc.c | 138 -- 1 file changed, 133 insertions(+), 5 deletions(-) diff

[PATCH V7 2/8] blokc: mq-deadline: Introduce dispatch helpers

2017-11-08 Thread Damien Le Moal
Avoid directly referencing the next_rq and fifo_list arrays using the helper functions deadline_next_request() and deadline_fifo_request() to facilitate changes in the dispatch request selection in __dd_dispatch_request() for zoned block devices. Signed-off-by: Damien Le Moal <damien.

[PATCH V7 0/8] blk-mq support for ZBC disks

2017-11-08 Thread Damien Le Moal
cilitate review * Fixed scsi disk lookup from io scheduler by introducing scsi_disk_from_queue() Christoph Hellwig (1): block: introduce zoned block devices zone write locking Damien Le Moal (7): blokc: mq-deadline: Introduce dispatch helpers block: mq-deadline: Introduce zone locking suppor

[PATCH V7 5/8] block: deadline-iosched: Introduce zone locking support

2017-11-08 Thread Damien Le Moal
-by: Damien Le Moal <damien.lem...@wdc.com> --- block/deadline-iosched.c | 71 ++-- 1 file changed, 68 insertions(+), 3 deletions(-) diff --git a/block/deadline-iosched.c b/block/deadline-iosched.c index 81e3f0897457..9de9f156e203 100644 --- a/block/de

Re: [PATCH] Suppress a kernel warning in case the prep function returns BLKPREP_DEFER

2017-10-22 Thread Damien Le Moal
pages+0x9/0x10 > do_writepages+0x34/0xc0 > __filemap_fdatawrite_range+0x6c/0x90 > file_write_and_wait_range+0x31/0x90 > blkdev_fsync+0x16/0x40 > vfs_fsync_range+0x44/0xa0 > do_fsync+0x38/0x60 > SyS_fsync+0xb/0x10 > entry_SYSCALL_64_fastpath+0x13/0x94 > ---[ end trace 86e

[PATCH 5/5] scsi: sd_zbc: Fix sd_zbc_read_zoned_characteristics()

2017-10-10 Thread Damien Le Moal
er.kernel.org> Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> Reviewed-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/sd_zbc.c | 6 +++--- 1 file change

[PATCH 4/5] scsi: sd_zbc: Use well defined macros

2017-10-10 Thread Damien Le Moal
instead of open coding, use the min() macro to calculate a report zones reply buffer length in sd_zbc_check_zone_size() and the round_up() macro for calculating the number of zones in sd_zbc_setup(). No functional change is introduced by this patch. Signed-off-by: Damien Le Moal <damien.

[PATCH 3/5] scsi: sd_zbc: Rearrange code

2017-10-10 Thread Damien Le Moal
Rearrange sd_zbc_setup() to include use_16_for_rw and use_10_for_rw assignments and move the calculation of sdkp->zone_shift together with the assignment of the verified zone_blocks value in sd_zbc_check_zone_size(). No functional change is introduced by this patch. Signed-off-by: Damien Le M

[PATCH 2/5] scsi: sd_zbc: Fix comments and indentation

2017-10-10 Thread Damien Le Moal
Fix comments style (use kernel-doc style) and content to clarify some functions. Also fix some functions signature indentation and remove a useless blank line in sd_zbc_read_zones(). No functional change is introduced by this patch. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Re

[PATCH 0/5] ZBC support clenaup and fixes

2017-10-10 Thread Damien Le Moal
ll ongoing and will be sent later. Please consider these for addition to 4.15. Damien Le Moal (5): scsi: sd_zbc: Move ZBC declarations to scsi_proto.h scsi: sd_zbc: Fix comments and indentation scsi: sd_zbc: Rearrange code scsi: sd_zbc: Use well defined macros scsi: s

[PATCH 1/5] scsi: sd_zbc: Move ZBC declarations to scsi_proto.h

2017-10-10 Thread Damien Le Moal
by this patch. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com> Reviewed-by: Johannes Thumshirn <jthumsh...@suse.de> Reviewed-by: Christoph Hellwig <h...@lst.de> --- drivers/scsi/sd_zbc.c | 24 --

Re: [PATCH V6 13/14] block: mq-deadline: Limit write request dispatch for zoned block devices

2017-10-03 Thread Damien Le Moal
Bart, On 10/4/17 05:56, Bart Van Assche wrote: > On Tue, 2017-10-03 at 09:19 +0900, Damien Le Moal wrote: >> On 10/3/17 08:44, Bart Van Assche wrote: >>> On Mon, 2017-10-02 at 16:15 +0900, Damien Le Moal wrote: >>>> static void deadline_wunlock

Re: [PATCH V6 13/14] block: mq-deadline: Limit write request dispatch for zoned block devices

2017-10-02 Thread Damien Le Moal
Bart, On 10/3/17 08:44, Bart Van Assche wrote: > On Mon, 2017-10-02 at 16:15 +0900, Damien Le Moal wrote: >> When dispatching write requests to a zoned block device, only allow >> requests targeting an unlocked zone. Requests targeting a locked zone >> are left in the schedu

[PATCH V6 12/14] block: mq-deadline: Introduce zone locking support

2017-10-02 Thread Damien Le Moal
private data to store the value RQ_ZONE_WLOCKED. Testing for this value allows quick decision in dd_insert_request() and dd_completed_request() regarding the need for unlocking the target zone of a request. Signed-off-by: Damien Le Moal <damien.lem...@wdc.com> --- block/mq-deadline.c

  1   2   3   4   >