Re: [PATCH V3 7/8] block: allow to allocate req with REQF_PREEMPT when queue is preempt frozen

2017-09-07 Thread Ming Lei
On Tue, Sep 05, 2017 at 10:23:25AM +0800, Ming Lei wrote: > On Tue, Sep 05, 2017 at 01:40:11AM +, Bart Van Assche wrote: > > On Tue, 2017-09-05 at 00:08 +0800, Ming Lei wrote: > > > On Mon, Sep 04, 2017 at 03:40:35PM +, Bart Van Assche wrote: > > > > Have you considered to use the blk-mq "r

Re: [GIT PULL] First set of block changes for 4.14-rc1

2017-09-07 Thread Ming Lei
On Thu, Sep 07, 2017 at 01:47:44PM -0600, Jens Axboe wrote: > On 09/07/2017 01:38 PM, Linus Torvalds wrote: > > On Thu, Sep 7, 2017 at 12:27 PM, Jens Axboe wrote: > >> > >> Which was committed yesterday? It was not from my tree. I try to keep > >> an eye out for potential conflicts or issues. > >

Re: [PATCH 2/2] scsi_transport_fc: fix NULL pointer dereference in fc_bsg_job_timeout

2017-09-07 Thread Ming Lei
On Thu, Sep 07, 2017 at 01:54:36PM +0200, Christoph Hellwig wrote: > bsg-lib now embeddeds the job structure into the request, and req->special > can't be used anymore. > > Signed-off-by: Christoph Hellwig > Cc: sta...@vger.kernel.org > --- > drivers/scsi/scsi_transport_fc.c | 2 +- > 1 file cha

Re: [PATCH 1/2] bsg-lib: don't free job in bsg_prepare_job

2017-09-07 Thread Ming Lei
On Thu, Sep 07, 2017 at 01:54:35PM +0200, Christoph Hellwig wrote: > The job structure is allocated as part of the request, so we should not > free it in the error path of bsg_prepare_job. > > Signed-off-by: Christoph Hellwig > Cc: sta...@vger.kernel.org > --- > block/bsg-lib.c | 1 - > 1 file c

Re: [PATCH] block: tolerate tracing of NULL bio

2017-09-07 Thread Ming Lei
On Fri, Sep 8, 2017 at 8:36 AM, Greg Thelen wrote: > __get_request() can call trace_block_getrq() with bio=NULL which causes > block_get_rq::TP_fast_assign() to deref a NULL pointer and panic. > > Syzkaller fuzzer panics with > linux-next (1d53d908b79d7870d89063062584eead4cf83448): > kasan: GPF

[PATCH] block: tolerate tracing of NULL bio

2017-09-07 Thread Greg Thelen
__get_request() can call trace_block_getrq() with bio=NULL which causes block_get_rq::TP_fast_assign() to deref a NULL pointer and panic. Syzkaller fuzzer panics with linux-next (1d53d908b79d7870d89063062584eead4cf83448): kasan: GPF could be caused by NULL-ptr deref or user memory access gener

BDI_CAP_STABLE_WRITES for stacked device (Re: Enable skip_copy can cause data integrity issue in some storage) stack

2017-09-07 Thread Shaohua Li
On Thu, Sep 07, 2017 at 11:11:24AM +1000, Neil Brown wrote: > On Wed, Sep 06 2017, Shaohua Li wrote: > > > On Fri, Sep 01, 2017 at 03:26:41PM +0800, alexwu wrote: > >> Hi, > >> > >> Recently a data integrity issue about skip_copy was found. We are able > >> to reproduce it and found the root caus

Re: [PATCH V2 0/3] block/loop: handle discard/zeroout error

2017-09-07 Thread Shaohua Li
On Thu, Sep 07, 2017 at 03:20:01PM +0200, Ilya Dryomov wrote: > Hi Shaohua, > > You wrote: > > BTW: blkdev_issue_zeroout retries if we immediately find the device doesn't > > support zeroout, but it doesn't retry if submit_bio_wait returns > > -EOPNOTSUPP. > > Is this correct behavior? > > I sen

Re: [PATCH V2 3/3] block/loop: suppress discard IO error message

2017-09-07 Thread Shaohua Li
On Thu, Sep 07, 2017 at 05:16:21PM +0800, Ming Lei wrote: > On Thu, Sep 7, 2017 at 8:13 AM, Shaohua Li wrote: > > From: Shaohua Li > > > > We don't know if fallocate really supports FALLOC_FL_PUNCH_HOLE till > > fallocate is called. If it doesn't support, loop will return -EOPNOTSUPP > > and we s

Re: [GIT PULL] First set of block changes for 4.14-rc1

2017-09-07 Thread Jens Axboe
On 09/07/2017 01:38 PM, Linus Torvalds wrote: > On Thu, Sep 7, 2017 at 12:27 PM, Jens Axboe wrote: >> >> Which was committed yesterday? It was not from my tree. I try to keep >> an eye out for potential conflicts or issues. > > It was from Andrew, so I'm assuming it was in linux-next. Not as a gi

Re: [GIT PULL] First set of block changes for 4.14-rc1

2017-09-07 Thread Linus Torvalds
On Thu, Sep 7, 2017 at 12:27 PM, Jens Axboe wrote: > > Which was committed yesterday? It was not from my tree. I try to keep > an eye out for potential conflicts or issues. It was from Andrew, so I'm assuming it was in linux-next. Not as a git tree, but as the usual akpm branch. I'm not sure why

Re: [PATCH 00/13] bcache: fixes and update for 4.14

2017-09-07 Thread Jens Axboe
On 09/07/2017 12:51 PM, Eddie Chapman wrote: > On 06/09/17 18:38, Coly Li wrote: >> On 2017/9/6 下午11:46, Jens Axboe wrote: >>> On 09/06/2017 09:41 AM, Coly Li wrote: On 2017/9/6 下午10:20, Jens Axboe wrote: > On Wed, Sep 06 2017, Coly Li wrote: >> Hi Jens, >> >> Here are 12 patch

Re: [GIT PULL] First set of block changes for 4.14-rc1

2017-09-07 Thread Jens Axboe
On 09/07/2017 01:04 PM, Linus Torvalds wrote: > On Tue, Sep 5, 2017 at 7:31 AM, Jens Axboe wrote: >> >> Note that you'll hit a conflict in block/bio-integrity.c and >> mm/page_io.c, since we had fixes later in the 4.13 series for both of >> those that ended up conflicting with new changes. Both ar

Re: [GIT PULL] First set of block changes for 4.14-rc1

2017-09-07 Thread Linus Torvalds
On Tue, Sep 5, 2017 at 7:31 AM, Jens Axboe wrote: > > Note that you'll hit a conflict in block/bio-integrity.c and > mm/page_io.c, since we had fixes later in the 4.13 series for both of > those that ended up conflicting with new changes. Both are trivial to > fix up, I've included my resolution a

Re: [PATCH 00/13] bcache: fixes and update for 4.14

2017-09-07 Thread Eddie Chapman
On 06/09/17 18:38, Coly Li wrote: On 2017/9/6 下午11:46, Jens Axboe wrote: On 09/06/2017 09:41 AM, Coly Li wrote: On 2017/9/6 下午10:20, Jens Axboe wrote: On Wed, Sep 06 2017, Coly Li wrote: Hi Jens, Here are 12 patchs for bcache fixes and updates, most of them were posted by Eric Wheeler in 4.1

Re: [PATCH 00/13] bcache: fixes and update for 4.14

2017-09-07 Thread Eddie Chapman
On 06/09/17 18:38, Coly Li wrote: On 2017/9/6 下午11:46, Jens Axboe wrote: On 09/06/2017 09:41 AM, Coly Li wrote: On 2017/9/6 下午10:20, Jens Axboe wrote: On Wed, Sep 06 2017, Coly Li wrote: Hi Jens, Here are 12 patchs for bcache fixes and updates, most of them were posted by Eric Wheeler in 4.1

Re: [PATCH]blk-mq-sched: remove the empty entry in token wait list

2017-09-07 Thread Omar Sandoval
On Tue, Aug 29, 2017 at 10:52:13PM +0800, 查斌 wrote: > From: Bin Zha > > > When the kyber adjusts the sync and other write depth to the > minimum(1), there is a case that maybe cause the requests to > be stalled in the kyber_hctx_data list. > > The following example I have tested: > > > CPU7

[PATCH V2 11/12] scsi: sd: Introduce scsi_disk_from_queue()

2017-09-07 Thread Damien Le Moal
Using scsi_device_from_queue(), return the scsi_disk structure associated with a request queue if the device is a disk. Export this function to make it available to modules. Signed-off-by: Damien Le Moal --- drivers/scsi/sd.c | 32 drivers/scsi/sd.h | 2 ++ 2 fi

[PATCH V2 12/12] scsi: Introduce ZBC disk I/O scheduler

2017-09-07 Thread Damien Le Moal
The zoned I/O scheduler is mostly identical to mq-deadline and retains the same configuration attributes. The main difference is that the zoned scheduler will ensure that at any time at most only one write request (command) per sequential zone is in flight (has been issued to the disk) in order to

[PATCH V2 10/12] scsi: sd_zbc: Disable zone write locking with scsi-mq

2017-09-07 Thread Damien Le Moal
In the case of a ZBC disk used with scsi-mq, zone write locking does not prevent write reordering in sequential zones. Unlike the legacy case, zone locking can only be done after the command request is removed from the scheduler dispatch queue. That is, at the time of zone locking, the write comman

[PATCH V2 09/12] scsi: sd_zbc: Limit zone write locking to sequential zones

2017-09-07 Thread Damien Le Moal
Zoned block devices have no write constraints for conventional zones so write locking of conventional zones is not necessary and can hurt performance. To avoid this, introduce the seq_zones bitmap to indicate if a zone is a sequential one. Use this information to allow any write to be issued to con

[PATCH V2 08/12] scsi: sd_zbc: Fix sd_zbc_read_zoned_characteristics()

2017-09-07 Thread Damien Le Moal
The three values starting at byte 8 of the Zoned Block Device Characteristics VPD page B6h are 32 bits values, not 64bits. So use get_unaligned_be32() to retrieve the values and not get_unaligned_be64() Fixes: 89d947561077 ("sd: Implement support for ZBC devices") Cc: Signed-off-by: Damien Le Mo

[PATCH V2 06/12] scsi: sd_zbc: Rearrange code

2017-09-07 Thread Damien Le Moal
Move inline functions sd_zbc_zone_sectors() and sd_zbc_zone_no() declarations to sd_zbc.h and rearrange sd_zbc_setup() to include use_16_for_rw and use_10_for_rw assignment. Also move calculation of sdkp->zone_shift together with the assignment of the verified zone_blocks value in sd_zbc_check_zone

[PATCH V2 07/12] scsi: sd_zbc.c: Use well defined macros

2017-09-07 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 --- drivers/scs

[PATCH V2 05/12] scsi: sd_zbc: Fix comments and indentation

2017-09-07 Thread Damien Le Moal
Fix comments style (do not use documented comment style) and add some comments to clarify some functions. Also fix some functions signature indentation and remove a useless blank line. No functional change is introduced by this patch. Signed-off-by: Damien Le Moal --- drivers/scsi/sd_zbc.c | 50

[PATCH V2 03/12] scsi: sd_zbc: Move ZBC declarations to scsi_proto.h

2017-09-07 Thread Damien Le Moal
Move standard macro definitions for the zone types and zone conditions to scsi_proto.h together with the definitions related to the REPORT ZONES command. While at it, define all values in the enums to be clear. Signed-off-by: Damien Le Moal Reviewed-by: Bart Van Assche --- drivers/scsi/sd_zbc.

[PATCH V2 04/12] scsi: sd_zbc: Move zbc disk declarations to sd_zbc.h

2017-09-07 Thread Damien Le Moal
Introduce sd_zbc.h to gather ZBC disk related declarations and avoid cluttering sd.h. No functional change is introduced by this patch. Signed-off-by: Damien Le Moal --- drivers/scsi/sd.c | 1 + drivers/scsi/sd.h | 48 --- drivers/scsi/sd_zbc.c | 7

[PATCH V2 02/12] block: Fix declaration of blk-mq scheduler functions

2017-09-07 Thread Damien Le Moal
The functions blk_mq_sched_free_hctx_data(), blk_mq_sched_try_merge(), blk_mq_sched_try_insert_merge() and blk_mq_sched_request_inserted() are all exported symbols but are declared only internally in block/blk-mq-sched.h. Move these declarations to the new file include/linux/blk-mq-sched.h to make

[PATCH V2 00/12] scsi-mq support for ZBC disks

2017-09-07 Thread Damien Le Moal
This series implements support for ZBC disks used through the scsi-mq I/O path. The current scsi level support of ZBC disks guarantees write request ordering using a per-zone write lock which prevents issuing simultaneously multiple write commands to a zone, doing so avoid reordering of sequential

[PATCH V2 01/12] block: Fix declaration of blk-mq debugfs functions

2017-09-07 Thread Damien Le Moal
__blk_mq_debugfs_rq_show() and blk_mq_debugfs_rq_show() are exported symbols but ar eonly declared in the block internal file block/blk-mq-debugfs.h. which is not cleanly accessible to files outside of the block directory. Move the declaration of these functions to the new file include/linux/blk-mq

Re: BFQ + dm-mpath

2017-09-07 Thread Mike Snitzer
On Tue, Sep 05 2017 at 10:15am -0400, Bart Van Assche wrote: > On Tue, 2017-09-05 at 09:56 +0200, Paolo Valente wrote: > > Ok, my suspects seem confirmed: the path dm_mq_queue_rq -> map_request > > -> setup_clone -> blk_rq_prep_clone creates a cloned request without > > invoking e->type->ops.mq.p

Re: [PATCH 2/3] nvme: introduce nvme_reinit_tagset

2017-09-07 Thread Bart Van Assche
On Wed, 2017-09-06 at 18:30 +0300, Sagi Grimberg wrote: > +int nvme_reinit_tagset(struct nvme_ctrl *ctrl, bool admin) > +{ > + struct blk_mq_tag_set *set = admin ? > + ctrl->admin_tagset : ctrl->tagset; > + > + if (!ctrl->ops->reinit_request) > + return 0; >

Re: [PATCH 3/3] block: remove blk_mq_reinit_tagset

2017-09-07 Thread Bart Van Assche
On Wed, 2017-09-06 at 18:30 +0300, Sagi Grimberg wrote: > No callers left. Reviewed-by: Bart Van Assche

Re: [PATCH 1/3] block: introduce blk_mq_tagset_iter

2017-09-07 Thread Bart Van Assche
On Wed, 2017-09-06 at 18:30 +0300, Sagi Grimberg wrote: > Iterator helper to apply a function on all the > tags in a given tagset. export it as it will be used > outside the block layer later on. Thanks Sagi for having done this work. Reviewed-by: Bart Van Assche

[PATCH] lightnvm: prevent bd removal if busy

2017-09-07 Thread Rakesh Pandit
Removal of virtual block device by "nvm lnvm remove..." undergoing IO and created by "nvme lnvm create... -t pblk" results in following and is annoying. 446416.309757] bdi-block not registered [446416.309773] [ cut here ] [446416.309780] WARNING: CPU: 3 PID: 4319 at fs/fs-w

Re: [PATCH V2 0/3] block/loop: handle discard/zeroout error

2017-09-07 Thread Ilya Dryomov
Hi Shaohua, You wrote: > BTW: blkdev_issue_zeroout retries if we immediately find the device doesn't > support zeroout, but it doesn't retry if submit_bio_wait returns -EOPNOTSUPP. > Is this correct behavior? I sent a patch for that yesterday, see "[PATCH] block: cope with WRITE SAME failing in b

[PATCH 1/2] bsg-lib: don't free job in bsg_prepare_job

2017-09-07 Thread Christoph Hellwig
The job structure is allocated as part of the request, so we should not free it in the error path of bsg_prepare_job. Signed-off-by: Christoph Hellwig Cc: sta...@vger.kernel.org --- block/bsg-lib.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/bsg-lib.c b/block/bsg-lib.c index dd56d74

[PATCH 2/2] scsi_transport_fc: fix NULL pointer dereference in fc_bsg_job_timeout

2017-09-07 Thread Christoph Hellwig
bsg-lib now embeddeds the job structure into the request, and req->special can't be used anymore. Signed-off-by: Christoph Hellwig Cc: sta...@vger.kernel.org --- drivers/scsi/scsi_transport_fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_transport_fc.c

two small bsg fixes, take 3

2017-09-07 Thread Christoph Hellwig
Now fully away, with my fair share of coffee and lunch: Two fixups for the recent bsg-lib fixes, should go into 4.13 stable as well.

Re: [PATCH 10/18] lightnvm: pblk: use bio_copy_kern when possible

2017-09-07 Thread Javier González
> On 7 Sep 2017, at 13.08, Christoph Hellwig wrote: > > On Wed, Sep 06, 2017 at 04:00:56PM +0200, Javier González wrote: >>> Nope. You want to loop over vmalloc_to_page and call bio_add_page >>> for each page, >> >> Yes. This is basically what I did before. >> >>> after taking care of virtuall

Re: [PATCH 10/18] lightnvm: pblk: use bio_copy_kern when possible

2017-09-07 Thread Christoph Hellwig
On Wed, Sep 06, 2017 at 04:00:56PM +0200, Javier González wrote: > > Nope. You want to loop over vmalloc_to_page and call bio_add_page > > for each page, > > Yes. This is basically what I did before. > > > after taking care of virtually tagged caches instead > > of this bounce buffering. > > An

Re: [PATCH 0/3] Move tagset reinit to its only current consumer, nvme-core

2017-09-07 Thread Max Gurtovoy
On 9/6/2017 6:30 PM, Sagi Grimberg wrote: As suggested by Bart Van Assche, get rid of blk_mq_reinit_tagset and move it to nvme-core (its only current consumer). Instead, introduce a more generic tagset iterator helper. Sagi Grimberg (3): block: introduce blk_mq_tagset_iter nvme: introdu

Re: [PATCH 3/3] block: remove blk_mq_reinit_tagset

2017-09-07 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG N

Re: [PATCH 2/3] nvme: introduce nvme_reinit_tagset

2017-09-07 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG N

Re: [PATCH 1/3] block: introduce blk_mq_tagset_iter

2017-09-07 Thread Johannes Thumshirn
Looks good, Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumsh...@suse.de+49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG N

Re: [PATCH V2 1/3] block/loop: don't hijack error number

2017-09-07 Thread Ming Lei
On Thu, Sep 7, 2017 at 8:13 AM, Shaohua Li wrote: > From: Shaohua Li > > If the bio returns -EOPNOTSUPP, we shouldn't hijack it and return -EIO > > Signed-off-by: Shaohua Li > --- > drivers/block/loop.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/block

Re: [PATCH V2 3/3] block/loop: suppress discard IO error message

2017-09-07 Thread Ming Lei
On Thu, Sep 7, 2017 at 8:13 AM, Shaohua Li wrote: > From: Shaohua Li > > We don't know if fallocate really supports FALLOC_FL_PUNCH_HOLE till > fallocate is called. If it doesn't support, loop will return -EOPNOTSUPP > and we see a lot of error message printed by blk_update_request. Failure > for

Re: [PATCH V2 2/3] block/loop: use FALLOC_FL_ZERO_RANGE for REQ_OP_WRITE_ZEROES

2017-09-07 Thread Ming Lei
On Thu, Sep 7, 2017 at 8:13 AM, Shaohua Li wrote: > From: Shaohua Li > > REQ_OP_WRITE_ZEROES really means zero the data. And in blkdev_fallocate, > FALLOC_FL_ZERO_RANGE will retry but FALLOC_FL_PUNCH_HOLE not, even loop > request doesn't have BLKDEV_ZERO_NOFALLBACK set. > > Signed-off-by: Shaohua