Re: [PATCH v4] blktrace: Fix potentail deadlock between delete & sysfs ops

2017-08-18 Thread Bart Van Assche
On Fri, 2017-08-18 at 16:01 -0400, Waiman Long wrote: > [ ... ] > Instead of using bd_mutex, a new global blktrace mutex is now used > to protect against concurrent access, creation and destruction of the > blk_trace structure that is used only in the blktrace.c file. As > blktrace files will not

Re: [PATCH v3] blktrace: Fix potentail deadlock between delete & sysfs ops

2017-08-18 Thread Bart Van Assche
On Fri, 2017-08-18 at 13:54 -0400, Waiman Long wrote: > Instead, a global blktrace > mutex will be used to serialize the read/write of the blktrace sysfs > attributes. Hello Waiman, Using a mutex to serialize code is wrong. What is needed is exact documentation of what data structures and/or

Re: [PATCH] blk-mq-debugfs: Add names for recently added flags

2017-08-18 Thread Bart Van Assche
On Fri, 2017-08-18 at 08:47 -0700, Bart Van Assche wrote: > diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c > index e53b6129ca5a..9fac2915d897 100644 > --- a/block/blk-mq-debugfs.c > +++ b/block/blk-mq-debugfs.c > @@ -73,6 +73,8 @@ static const char *const blk_

[PATCH 10/12] xen-blkback: Fix indentation

2017-08-17 Thread Bart Van Assche
Avoid that smatch reports the following warning when building with C=2 CHECK="smatch -p=kernel": drivers/block/xen-blkback/blkback.c:710 xen_blkbk_unmap_prepare() warn: inconsistent indenting Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Konrad Rzeszute

[PATCH 06/12] blk-mq-debugfs: Generate name-to-text translation tables

2017-08-17 Thread Bart Van Assche
It is easy to add a flag to one of the block layer headers and to forget to update blk-mq-debugfs.c. E.g. QUEUE_FLAG_SCSI_PASSTHROUGH, QUEUE_FLAG_QUIESCED and REQ_NOWAIT are missing from blk-mq-debugfs.c. Hence generate the symbol-to-text translation tables. Signed-off-by: Bart Van Assche

[PATCH 04/12] blk-mq: Make blk_mq_reinit_tagset() calls easier to read

2017-08-17 Thread Bart Van Assche
and to analyze. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Sagi Grimberg <s...@grimberg.me> Cc: James Smart <james.sm...@broadcom.com> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- block/blk-mq-tag.c | 9 +++

[PATCH 05/12] blk-mq-debugfs: Declare a local symbol static

2017-08-17 Thread Bart Van Assche
This was detected by sparse. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Omar Sandoval <osan...@fb.com> --- block/blk-mq-debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/blk-mq-debugfs.c b/block/blk-mq-debugfs.c index

[PATCH 03/12] blk-mq: Explain when 'active_queues' is decremented

2017-08-17 Thread Bart Van Assche
It is nontrivial to derive from the blk-mq source code when blk_mq_tags.active_queues is decremented. Hence add a comment that explains this. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc:

[PATCH 08/12] ide-floppy: Use blk_rq_is_scsi()

2017-08-17 Thread Bart Van Assche
This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: David S. Miller <da...@davemloft.net> Cc: linux-...@vger.kernel.org --- drivers/ide/ide-floppy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ide/

[PATCH 07/12] genhd: Annotate all part and part_tbl pointer dereferences

2017-08-17 Thread Bart Van Assche
mprove documentation of the locking requirements of the modified functions. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Tejun Heo <t...@kernel.org> Cc: Jan Kara <j...@suse.cz> Cc: Dan Williams <dan.j.willi...@intel.com> Cc: Christoph Hellwig <h...@lst.de>

[PATCH 11/12] xen-blkback: Avoid that gcc 7 warns about fall-through when building with W=1

2017-08-17 Thread Bart Van Assche
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Cc: Roger Pau Monn303251 <roger@citrix.com> Cc: xen-de...@lists.xenproject.org --- drivers/block/xen-blkback/blkback.c | 1 + drivers/block/xen-blkback/xenbus.c | 3 ++

[PATCH 09/12] virtio_blk: Use blk_rq_is_scsi()

2017-08-17 Thread Bart Van Assche
This patch does not change any functionality. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Jason Wang <jasow...@redhat.com> Cc: virtualizat...@lists.linux-foundation.org --- drivers/block/virtio_blk.c | 2 +- 1 file ch

[PATCH 02/12] block: Unexport blk_queue_end_tag()

2017-08-17 Thread Bart Van Assche
This function is only used inside the block layer core. Hence unexport it. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- block/blk-tag.c

Re: [PATCH v2] blktrace: Fix potentail deadlock between delete & sysfs ops

2017-08-17 Thread Bart Van Assche
On Thu, 2017-08-17 at 16:30 -0400, Steven Rostedt wrote: > On Thu, 17 Aug 2017 12:24:39 -0400 > Waiman Long wrote: > > > On 08/17/2017 09:34 AM, Steven Rostedt wrote: > > > On Wed, 16 Aug 2017 16:40:40 -0400 > > > Waiman Long wrote: > > > > > > > The

[PATCH 00/12] Twelve small block layer patches

2017-08-17 Thread Bart Van Assche
Hello Jens, The twelve patches in this series are patches I came up with while working on block drivers and SCSI drivers. Please consider these for inclusion in kernel v4.14. Thanks, Bart. Bart Van Assche (12): block: Fix two comments that refer to .queue_rq() return values block: Unexport

[PATCH 01/12] block: Fix two comments that refer to .queue_rq() return values

2017-08-17 Thread Bart Van Assche
drained/blocked by stopping queue") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Ming Lei <ming@redhat.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc: Johannes Thumshirn <jthumsh...@suse.de> --- block/blk-mq.c | 4

[PATCH 12/12] xen-blkfront: Avoid that gcc 7 warns about fall-through when building with W=1

2017-08-17 Thread Bart Van Assche
Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Konrad Rzeszutek Wilk <konrad.w...@oracle.com> Cc: Roger Pau Monn303251 <roger@citrix.com> Cc: xen-de...@lists.xenproject.org --- drivers/block/xen-blkfront.c | 2 +- 1 file changed, 1 insertion(+), 1 delet

[PATCH v2] blk-mq-debugfs: Add names for recently added flags

2017-08-18 Thread Bart Van Assche
The symbolic constants QUEUE_FLAG_SCSI_PASSTHROUGH, QUEUE_FLAG_QUIESCED and REQ_NOWAIT are missing from blk-mq-debugfs.c. Add these to blk-mq-debugfs.c such that these appear as names in debugfs instead of as numbers. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Omar Sandoval

Re: [PATCH V2 10/20] blk-mq-sched: introduce helpers for query, change busy state

2017-08-22 Thread Bart Van Assche
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > +static inline bool blk_mq_hctx_is_dispatch_busy(struct blk_mq_hw_ctx *hctx) > +{ > + return test_bit(BLK_MQ_S_DISPATCH_BUSY, >state); > +} > + > +static inline void blk_mq_hctx_set_dispatch_busy(struct blk_mq_hw_ctx *hctx) > +{ > +

Re: [PATCH V2 05/20] blk-mq-sched: improve dispatching from sw queue

2017-08-22 Thread Bart Van Assche
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > +static inline void blk_mq_do_dispatch_ctx(struct request_queue *q, > + struct blk_mq_hw_ctx *hctx) > +{ > + LIST_HEAD(rq_list); > + struct blk_mq_ctx *ctx = NULL; > + > + do { > +

Re: possible circular locking dependency detected [was: linux-next: Tree for Aug 22]

2017-08-22 Thread Bart Van Assche
On Tue, 2017-08-22 at 19:47 +0900, Sergey Senozhatsky wrote: > == > WARNING: possible circular locking dependency detected > 4.13.0-rc6-next-20170822-dbg-00020-g39758ed8aae0-dirty #1746 Not tainted >

[PATCH 2/2] block: Make I/O timeout failure injection support again task-independent

2017-08-22 Thread Bart Van Assche
] irq_forced_thread_fn+0x2a/0x70 irq_thread+0x144/0x1a0 kthread+0x125/0x140 ret_from_fork+0x2a/0x40 Fixes: commit e41d58185f14 ("fault-inject: support systematic fault injection") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Jens Axboe <ax...@kernel.dk> Cc: Dmitry Vyukov &

[PATCH 0/2] Make I/O timeout failure injection again task-independent

2017-08-22 Thread Bart Van Assche
Hello Andrew, A recent change in the fault injection code introduced an undesired change in the behavior of the I/O timeout failure injection code. This series restores the original behavior. Please consider these patches for kernel v4.14. Thanks, Bart. Bart Van Assche (2): fault-inject

[PATCH 1/2] fault-inject: Restore support for task-independent fault injection

2017-08-22 Thread Bart Van Assche
fault-inject: support systematic fault injection") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Dmitry Vyukov <dvyu...@google.com> Cc: Akinobu Mita <akinobu.m...@gmail.com> Cc: Michal Hocko <mho...@kernel.org> Cc: Andrew Morton <a...@linux-foundation.o

Re: [PATCH V2 05/20] blk-mq-sched: improve dispatching from sw queue

2017-08-22 Thread Bart Van Assche
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > easy to cause queue busy becasue of the small ^^^ because? > -static void blk_mq_do_dispatch(struct request_queue *q, > -struct elevator_queue *e, > -

Re: [PATCH V2 02/20] sbitmap: introduce __sbitmap_for_each_set()

2017-08-22 Thread Bart Van Assche
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > -static inline void sbitmap_for_each_set(struct sbitmap *sb, sb_for_each_fn > fn, > - void *data) > +static inline void __sbitmap_for_each_set(struct sbitmap *sb, > +

Re: [PATCH V2 02/20] sbitmap: introduce __sbitmap_for_each_set()

2017-08-22 Thread Bart Van Assche
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > /** > * sbitmap_for_each_set() - Iterate over each set bit in a sbitmap. > + * @off: Offset to iterate from > * @sb: Bitmap to iterate over. > * @fn: Callback. Should return true to continue or false to break early. > * @data: Pointer

Re: [PATCH V2 04/20] blk-mq-sched: move actual dispatching into one helper

2017-08-22 Thread Bart Van Assche
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > So that it becomes easy to support to dispatch from > sw queue in the following patch. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V2 03/20] blk-mq: introduce blk_mq_dispatch_rq_from_ctx()

2017-08-22 Thread Bart Van Assche
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > More importantly, for some SCSI devices, driver > tags are host wide, and the number is quite big, > but each lun has very limited queue depth. This may be the case but is not always the case. Another important use-case is one LUN per host and

Re: [PATCH V2 07/20] blk-mq-sched: introduce blk_mq_sched_queue_depth()

2017-08-22 Thread Bart Van Assche
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > The following patch will propose some hints to figure out > default queue depth for scheduler queue, so introduce helper > of blk_mq_sched_queue_depth() for this purpose. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V2 06/20] blk-mq-sched: don't dequeue request until all in ->dispatch are flushed

2017-08-22 Thread Bart Van Assche
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > + /* > + * Wherever DISPATCH_BUSY is set, blk_mq_run_hw_queue() > + * will be run to try to make progress, so it is always > + * safe to check the state here. > + */ > + if (test_bit(BLK_MQ_S_DISPATCH_BUSY, >state)) >

Re: [PATCH V2 08/20] blk-mq-sched: use q->queue_depth as hint for q->nr_requests

2017-08-22 Thread Bart Van Assche
t; This patch trys to use q->queue_depth as hint for computing tries? > q->nr_requests, which should be more effective than > current way. Reviewed-by: Bart Van Assche <bart.vanass...@wdc.com>

Re: [PATCH V2 14/20] blk-mq-sched: improve IO scheduling on SCSI devcie

2017-08-22 Thread Bart Van Assche
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > This patch introduces per-request_queue dispatch > list for this purpose, and only when all requests > in this list are dispatched out successfully, we > can restart to dequeue request from sw/scheduler > queue and dispath it to lld. Wasn't one

Re: [PATCH V2 09/20] blk-mq: introduce BLK_MQ_F_SHARED_DEPTH

2017-08-22 Thread Bart Van Assche
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > + /* > + * if there is q->queue_depth, all hw queues share > + * this queue depth limit > + */ > + if (q->queue_depth) { > + queue_for_each_hw_ctx(q, hctx, i) > + hctx->flags |=

[PATCH v2 0/2] Make I/O timeout failure injection again task-independent

2017-08-22 Thread Bart Van Assche
with CONFIG_FAIL_PAGE_ALLOC, CONFIG_FAIL_IO_TIMEOUT and/or CONFIG_FAIL_FUTEX enabled. Bart Van Assche (2): fault-inject: Restore support for task-independent fault injection block: Make I/O timeout failure injection again task-independent block/blk-timeout.c | 2 +- include/linux

[PATCH v2 2/2] block: Make I/O timeout failure injection again task-independent

2017-08-22 Thread Bart Van Assche
] irq_forced_thread_fn+0x2a/0x70 irq_thread+0x144/0x1a0 kthread+0x125/0x140 ret_from_fork+0x2a/0x40 Fixes: commit e41d58185f14 ("fault-inject: support systematic fault injection") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Jens Axboe <ax...@kernel.dk> Cc: Dmitry Vyukov &

[PATCH v2 1/2] fault-inject: Restore support for task-independent fault injection

2017-08-22 Thread Bart Van Assche
fault-inject: support systematic fault injection") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Dmitry Vyukov <dvyu...@google.com> Cc: Akinobu Mita <akinobu.m...@gmail.com> Cc: Michal Hocko <mho...@kernel.org> Cc: Andrew Morton <a...@linux-foundation.o

Re: [PATCH V2 11/20] blk-mq: introduce helpers for operating ->dispatch list

2017-08-22 Thread Bart Van Assche
On Sat, 2017-08-05 at 14:56 +0800, Ming Lei wrote: > +static inline bool blk_mq_has_dispatch_rqs(struct blk_mq_hw_ctx *hctx) > +{ > + return !list_empty_careful(>dispatch); > +} > + > +static inline void blk_mq_add_rq_to_dispatch(struct blk_mq_hw_ctx *hctx, > + struct request *rq)

[PATCH] blk-mq-debugfs: Add names for recently added flags

2017-08-18 Thread Bart Van Assche
The symbolic constants QUEUE_FLAG_SCSI_PASSTHROUGH, QUEUE_FLAG_QUIESCED and REQ_NOWAIT are missing from blk-mq-debugfs.c. Add these to blk-mq-debugfs.c such that these appear as names in debugfs instead of as numbers. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Omar Sandoval

[PATCH v2] blk-mq: Explain when 'active_queues' is decremented

2017-08-18 Thread Bart Van Assche
It is nontrivial to derive from the blk-mq source code when blk_mq_tags.active_queues is decremented. Hence add a comment that explains this. Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.de> Cc:

Re: [PATCH] block: don't call blk_mq_quiesce_queue() after queue is freezed

2017-05-02 Thread Bart Van Assche
or_switch_mq() and blk_mq_update_nr_requests(). Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com>

Re: BUG: KASAN: use-after-free in scsi_exit_rq

2017-05-02 Thread Bart Van Assche
On Tue, 2017-05-02 at 16:41 +0200, Jan Kara wrote: > So I'm also not aware of any particular breakage this would cause. However > logically the freeing of request mempools really belongs to > blk_release_queue() so it seems a bit dumb to move blk_exit_rl() just > because SCSI stores the fact from

Re: [PATCH 0/4] blk-mq: support to use hw tag for scheduling

2017-05-03 Thread Bart Van Assche
On Thu, 2017-05-04 at 01:19 +0800, Ming Lei wrote: > On Wed, May 03, 2017 at 05:08:30PM +0000, Bart Van Assche wrote: > > Callers of blk_mq_quiesce_queue() really need blk_mq_stop_hw_queue() to > > cancel delayed work synchronously. The above call stack shows that we have > >

Re: [PATCH 0/4] blk-mq: support to use hw tag for scheduling

2017-05-03 Thread Bart Van Assche
On Wed, 2017-05-03 at 11:24 -0600, Jens Axboe wrote: > diff --git a/drivers/block/mtip32xx/mtip32xx.c > b/drivers/block/mtip32xx/mtip32xx.c > index 3a779a4f5653..33b5d1382c45 100644 > --- a/drivers/block/mtip32xx/mtip32xx.c > +++ b/drivers/block/mtip32xx/mtip32xx.c > [ ... ] > @@ -4009,7 +4009,7

Re: [PATCH 0/4] blk-mq: support to use hw tag for scheduling

2017-05-03 Thread Bart Van Assche
rs from drivers, particularly from ->queue_rq() > when we have to stop processing for a bit. We can't block from > those locations, and we don't have to guarantee that we're > fully flushed. Reviewed-by: Bart Van Assche <bart.vanass...@sandisk.com>

Re: [PATCH 0/4] blk-mq: support to use hw tag for scheduling

2017-05-03 Thread Bart Van Assche
On Thu, 2017-05-04 at 00:52 +0800, Ming Lei wrote: > Looks v4.11 plus your for-linus often triggers the following hang during > boot, and it seems caused by the change in (blk-mq: unify hctx > delayed_run_work > and run_work) > > > BUG: scheduling while atomic: kworker/0:1H/704/0x0002 >

Crash in function called from __blkg_release_rcu()

2017-05-03 Thread Bart Van Assche
Hello Tejun and Christoph, While testing a series of SCSI target patches I ran into the following crash in the initiator call stack after I requested the iSCSI initiator code to log out: general protection fault: [#1] SMP Modules linked in: target_core_user uio target_core_iblock

Re: [PATCH] ARM: Fix rd_size declaration

2017-05-03 Thread Bart Van Assche
On Wed, 2017-05-03 at 20:25 +0100, Russell King - ARM Linux wrote: > There were comments on the patch which seemed to be unresolved. Do you mean the header guard? That's easy to resolve. > However, it would be nice if rd_size could go with some other related > declarations somewhere (if there

[PATCH] ARM: Fix rd_size declaration

2017-05-03 Thread Bart Van Assche
existing declarations in . Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Russell King <li...@armlinux.org.uk> Cc: Jens Axboe <ax...@kernel.dk> Cc: Jan Kara <j...@suse.cz> Cc: <yanai...@huawei.com> Cc: <zhaohongji...@huawei.com> Cc: &l

Re: [RFC PATCH 0/2] Introduce blkdev_issue_flush_no_wait()

2017-05-16 Thread Bart Van Assche
On Tue, 2017-05-16 at 17:39 +0800, Anand Jain wrote: > BTRFS wanted a block device flush function which does not wait for > its completion, so that the flush for the next device can be called > in the same thread. > > Here is a RFC patch to provide the function > 'blkdev_issue_flush_no_wait()',

Re: [PATCH 1/9] fs: add fcntl() interface for setting/getting write life time hints

2017-06-20 Thread Bart Van Assche
On Mon, 2017-06-19 at 11:04 -0600, Jens Axboe wrote: > +static long fcntl_rw_hint(struct file *file, unsigned int cmd, > + u64 __user *ptr) > +{ > + struct inode *inode = file_inode(file); > + long ret = 0; > + u64 hint; > + > + switch (cmd) { > + case

Re: [PATCH] blk-mq: Make it safe to call blk_mq_quiesce_queue_nowait() from an interrupt handler

2017-06-20 Thread Bart Van Assche
On Tue, 2017-06-20 at 19:48 -0600, Jens Axboe wrote: > Good catch. Bart, will you spin a v2? Hello Jens, That's the first task I will work on tomorrow morning. Bart.

[PATCH v5 07/12] block: Add a comment above queue_lockdep_assert_held()

2017-06-20 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Add a comment above the queue_lockdep_assert_held() macro that explains the purpose of the q->queue_lock test. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst.de> C

[PATCH v5 09/12] block: Document what queue type each function is intended for

2017-06-20 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Some functions in block/blk-core.c must only be used on blk-sq queues while others are safe to use against any queue type. Document which functions are intended for blk-sq queues and issue a warning if the blk-sq API is misused. Thi

[PATCH v5 05/12] block: Change argument type of scsi_req_init()

2017-06-20 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Since scsi_req_init() works on a struct scsi_request, change the argument type into struct scsi_request *. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by:

Re: [PATCH] ARM: Fix rd_size declaration

2017-06-21 Thread Bart Van Assche
On Wed, 2017-05-03 at 12:46 -0700, Bart Van Assche wrote: > The global variable 'rd_size' is declared as 'int' in source file > arch/arm/kernel/atags_parse.c and as 'unsigned long' in > drivers/block/brd.c. Fix this inconsistency. Additionally, remove > the declarations of rd

[PATCH 0/3] Fixes for kernel v4.13

2017-06-21 Thread Bart Van Assche
Hello Jens, The three patches in this series fix issues in the patches that are queued for kernel v4.13. Please consider these for kernel v4.13. Thanks, Bart. Bart Van Assche (3): block: Declare local symbols static block: Fix off-by-one errors in blk_status_to_errno

[PATCH 3/3] blk-mq: Make it safe to quiesce and unquiesce from an interrupt handler

2017-06-21 Thread Bart Van Assche
Since blk_mq_quiesce_queue_nowait() can be called from interrupt context, make this safe. Since this function is not in the hot path, uninline it. Fixes: commit f4560ffe8cec ("blk-mq: use QUEUE_FLAG_QUIESCED to quiesce queue") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com&

[PATCH 2/3] block: Fix off-by-one errors in blk_status_to_errno() and print_req_error()

2017-06-21 Thread Bart Van Assche
This was detected by the smatch static analyzer. Fixes: commit 2a842acab109 ("block: introduce new block status code type") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com> Cc: Ming Lei <

[PATCH 1/3] block: Declare local symbols static

2017-06-21 Thread Bart Van Assche
Avoid that building with W=1 causes the compiler to complain that a declaration for bounce_bio_set and bounce_bio_split is missing. References: commit a8821f3f32be ("block: Improvements to bounce-buffer handling") Signed-off-by: Bart Van Assche <bart.vanass...@wdc.com> Cc

Re: [PATCH v3 00/12] More patches for kernel v4.13

2017-06-19 Thread Bart Van Assche
On Sun, 2017-06-18 at 20:55 -0600, Jens Axboe wrote: > On 06/08/2017 11:33 AM, Bart Van Assche wrote: > > This patch series contains one patch that reduces the size of struct > > blk_mq_hw_ctx, a few patches that simplify some of the block layer code and > > also patches t

[PATCH v4 08/12] block: Check locking assumptions at runtime

2017-06-19 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Instead of documenting the locking assumptions of most block layer functions as a comment, use lockdep_assert_held() to verify locking assumptions at runtime. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-b

[PATCH v4 12/12] blk-mq: Warn when attempting to run a hardware queue that is not mapped

2017-06-19 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> A queue must be frozen while the mapped state of a hardware queue is changed. Additionally, any change of the mapped state is followed by a call to blk_mq_map_swqueue() (see also blk_mq_init_allocated_queue() and blk_mq_update_nr_hw_

[PATCH v4 11/12] block: Constify disk_type

2017-06-19 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> The variable 'disk_type' is never modified so constify it. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com> Cc: Omar Sandoval &

[PATCH v4 01/12] blk-mq: Reduce blk_mq_hw_ctx size

2017-06-19 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Since the srcu structure is rather large (184 bytes on an x86-64 system with kernel debugging disabled), only allocate it if needed. Reported-by: Ming Lei <ming@redhat.com> Signed-off-by: Bart Van Assche <bart.vanass...@sandis

[PATCH v4 10/12] blk-mq: Document locking assumptions

2017-06-19 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Document the locking assumptions in functions that modify blk_mq_ctx.rq_list to make it easier for humans to verify this code. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst

[PATCH v4 06/12] blk-mq: Initialize .rq_flags in blk_mq_rq_ctx_init()

2017-06-19 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Initialization of blk-mq requests is a bit weird: blk_mq_rq_ctx_init() is called after a value has been assigned to .rq_flags and .rq_flags is initialized in __blk_mq_finish_request(). Initialize .rq_flags in blk_mq_rq_ctx_init() i

[PATCH v4 04/12] block: Make most scsi_req_init() calls implicit

2017-06-19 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Instead of explicitly calling scsi_req_init() after blk_get_request(), call that function from inside blk_get_request(). Add an .initialize_rq_fn() callback function to the block drivers that need it. Merge the IDE .init_rq_fn() fu

[PATCH v4 09/12] block: Document what queue type each function is intended for

2017-06-19 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Some functions in block/blk-core.c must only be used on blk-sq queues while others are safe to use against any queue type. Document which functions are intended for blk-sq queues and issue a warning if the blk-sq API is misused. Thi

[PATCH v4 05/12] block: Change argument type of scsi_req_init()

2017-06-19 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Since scsi_req_init() works on a struct scsi_request, change the argument type into struct scsi_request *. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Reviewed-by:

[PATCH v4 00/12] More patches for kernel v4.13

2017-06-19 Thread Bart Van Assche
q and blk-mq. * Added several new patches, e.g. "block: Rename blk_mq_rq_{to,from}_pdu()". Bart Van Assche (12): blk-mq: Reduce blk_mq_hw_ctx size block: Make request operation type argument declarations consistent block: Introduce request_queue.initialize_rq_fn() block: Make most scsi_

[PATCH v4 02/12] block: Make request operation type argument declarations consistent

2017-06-19 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Instead of declaring the second argument of blk_*_get_request() as int and passing it to functions that expect an unsigned int, declare that second argument as unsigned int. Also because of consistency, rename that second argument fr

[PATCH v4 07/12] block: Add a comment above queue_lockdep_assert_held()

2017-06-19 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Add a comment above the queue_lockdep_assert_held() macro that explains the purpose of the q->queue_lock test. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst.de> C

[PATCH v4 03/12] block: Introduce request_queue.initialize_rq_fn()

2017-06-19 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Several block drivers need to initialize the driver-private request data after having called blk_get_request() and before .prep_rq_fn() is called, e.g. when submitting a REQ_OP_SCSI_* request. Avoid that that initialization co

Re: [PATCH v4 04/12] block: Make most scsi_req_init() calls implicit

2017-06-20 Thread Bart Van Assche
On Tue, 2017-06-20 at 08:37 +0200, Hannes Reinecke wrote: > On 06/20/2017 12:07 AM, Bart Van Assche wrote: > > +static void sas_initialize_rq(struct request *rq) > > +{ > > + scsi_req_init(rq); > > +} > > Any particular reason why you didn't use scsi_ini

Re: [PATCH v4 12/12] blk-mq: Warn when attempting to run a hardware queue that is not mapped

2017-06-19 Thread Bart Van Assche
On Mon, 2017-06-19 at 17:06 -0600, Jens Axboe wrote: > On 06/19/2017 04:08 PM, Bart Van Assche wrote: > > --- a/block/blk-mq.c > > +++ b/block/blk-mq.c > > @@ -1140,8 +1140,9 @@ static int blk_mq_hctx_next_cpu(struct blk_mq_hw_ctx > > *hctx) > > static void _

[PATCH v5 12/12] blk-mq: Warn when attempting to run a hardware queue that is not mapped

2017-06-20 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> A queue must be frozen while the mapped state of a hardware queue is changed. Additionally, any change of the mapped state is followed by a call to blk_mq_map_swqueue() (see also blk_mq_init_allocated_queue() and blk_mq_update_nr_hw_

[PATCH v5 04/12] block: Make most scsi_req_init() calls implicit

2017-06-20 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Instead of explicitly calling scsi_req_init() after blk_get_request(), call that function from inside blk_get_request(). Add an .initialize_rq_fn() callback function to the block drivers that need it. Merge the IDE .init_rq_fn() fu

[PATCH v5 11/12] block: Constify disk_type

2017-06-20 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> The variable 'disk_type' is never modified so constify it. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com> Cc: Omar Sandoval &

[PATCH v5 02/12] block: Make request operation type argument declarations consistent

2017-06-20 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Instead of declaring the second argument of blk_*_get_request() as int and passing it to functions that expect an unsigned int, declare that second argument as unsigned int. Also because of consistency, rename that second argument fr

[PATCH v5 10/12] blk-mq: Document locking assumptions

2017-06-20 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Document the locking assumptions in functions that modify blk_mq_ctx.rq_list to make it easier for humans to verify this code. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst

[PATCH v5 08/12] block: Check locking assumptions at runtime

2017-06-20 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Instead of documenting the locking assumptions of most block layer functions as a comment, use lockdep_assert_held() to verify locking assumptions at runtime. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-b

[PATCH v5 06/12] blk-mq: Initialize .rq_flags in blk_mq_rq_ctx_init()

2017-06-20 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Initialization of blk-mq requests is a bit weird: blk_mq_rq_ctx_init() is called after a value has been assigned to .rq_flags and .rq_flags is initialized in __blk_mq_finish_request(). Initialize .rq_flags in blk_mq_rq_ctx_init() i

[PATCH v5 03/12] block: Introduce request_queue.initialize_rq_fn()

2017-06-20 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Several block drivers need to initialize the driver-private request data after having called blk_get_request() and before .prep_rq_fn() is called, e.g. when submitting a REQ_OP_SCSI_* request. Avoid that that initialization co

[PATCH v5 00/12] More patches for kernel v4.13

2017-06-20 Thread Bart Van Assche
h blk-sq and blk-mq. * Added several new patches, e.g. "block: Rename blk_mq_rq_{to,from}_pdu()". Bart Van Assche (12): blk-mq: Reduce blk_mq_hw_ctx size block: Make request operation type argument declarations consistent block: Introduce request_queue.initialize_rq_fn() bl

[PATCH v5 01/12] blk-mq: Reduce blk_mq_hw_ctx size

2017-06-20 Thread Bart Van Assche
From: Bart Van Assche <bart.vanass...@sandisk.com> Since the srcu structure is rather large (184 bytes on an x86-64 system with kernel debugging disabled), only allocate it if needed. Reported-by: Ming Lei <ming@redhat.com> Signed-off-by: Bart Van Assche <bart.vanass...@sandis

[PATCH] block: Add fallthrough markers to switch statements

2017-06-21 Thread Bart Van Assche
This patch suppresses gcc 7 warnings about falling through in switch statements when building with W=1. From the gcc documentation: The -Wimplicit-fallthrough=3 warning is enabled by -Wextra. See also https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/Warning-Options.html. Signed-off-by: Bart Van

[PATCH, RESEND] ARM: Fix rd_size declaration

2017-06-27 Thread Bart Van Assche
existing declarations in . Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Russell King <li...@armlinux.org.uk> Cc: Jens Axboe <ax...@kernel.dk> Cc: Jan Kara <j...@suse.cz> Cc: <yanai...@huawei.com> Cc: <zhaohongji...@huawei.com> Cc: &l

Re: [PATCH 12/15] block: merge blk_types.h into bio.h

2017-05-18 Thread Bart Van Assche
On Thu, 2017-05-18 at 15:18 +0200, Christoph Hellwig wrote: > We've cleaned up our headers sufficiently that we don't need this split > anymore. Hello Christoph, Request-based drivers need the structure definitions from and the type definitions from but do not need the definition of struct

Re: [PATCH 03/31] Protect SCSI device state changes with a mutex

2017-05-24 Thread Bart Van Assche
On Wed, 2017-05-24 at 07:51 +0200, Hannes Reinecke wrote: > On 05/24/2017 02:33 AM, Bart Van Assche wrote: > > Enable this mechanism for all scsi_target_*block() callers but not > > for the scsi_internal_device_unblock() calls from the mpt3sas driver > > because

[PATCH 24/31] scsi: Make scsi_initialize_rq() zero the entire struct scsi_cmnd

2017-05-23 Thread Bart Van Assche
This simplifies the memset() call in scsi_initialize_rq() and avoids that any stale data is left behind in struct scsi_request. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com> --- drive

[PATCH 30/31] scsi: virtio: Remove code that zeroes driver-private command data

2017-05-23 Thread Bart Van Assche
Since the SCSI core zeroes driver-private command data, remove that code from the virtio driver. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.c

[PATCH 13/31] pktcdvd: Check queue type before attaching to a queue

2017-05-23 Thread Bart Van Assche
split scsi_request out of struct request") Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Jens Axboe <ax...@fb.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Omar Sandoval <osan...@fb.com> Cc: Hannes Reinecke <h...@suse.com> Cc: linux-block@vger.ker

[PATCH 22/31] scsi: Inline scsi_init_command()

2017-05-23 Thread Bart Van Assche
-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com> --- drivers/scsi/scsi_error.c | 1 - drivers/scsi/scsi_lib.c | 10 ++ drivers/scsi/scsi_priv.h | 1 - 3 files changed, 2 insertions(+), 10

[PATCH 15/31] nfsd: Check private request size before submitting a SCSI request

2017-05-23 Thread Bart Van Assche
truct request") Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: J. Bruce Fields <bfie...@fieldses.org> Cc: Jeff Layton <jlay...@poochiereds.net> Cc: Jens Axboe <ax...@fb.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Omar Sandoval <osan...@fb.

[PATCH 18/31] block: Make scsi_req_init() calls implicit

2017-05-23 Thread Bart Van Assche
it as a separate function. References: commit 82ed4db499b8 ("block: split scsi_request out of struct request") Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Jens Axboe <ax...@fb.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Omar Sandoval <osan...@fb.com>

[PATCH 09/31] block: Avoid that blk_exit_rl() triggers a use-after-free

2017-05-23 Thread Bart Van Assche
;scsi: allocate scsi_cmnd structures as part of struct request") Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Cc: Jens Axboe <ax...@fb.com> Cc: Christoph Hellwig <h...@lst.de> Cc: Tejun Heo <t...@kernel.org> Cc: Jan Kara <j...@suse.cz> Cc:

[PATCH 23/31] scsi: Move sense buffer pointer initialization into scsi_initialize_rq()

2017-05-23 Thread Bart Van Assche
This patch is a preparation for the next patch that will zero the struct scsi_request embedded in struct scsi_cmnd before calling scsi_req_init(). Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke &l

[PATCH 19/31] scsi: Change argument type of scsi_req_init()

2017-05-23 Thread Bart Van Assche
Since scsi_req_init() works on a struct scsi_request, change the argument type into struct scsi_request *. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com> --- block/scsi_ioctl.c

[PATCH 28/31] scsi_setup_fs_cmnd(): Call scsi_req_init() instead of open-coding it

2017-05-23 Thread Bart Van Assche
The only functional change is that this patch causes scsi_setup_fs_cmnd() to clear scsi_request.sense_len. Signed-off-by: Bart Van Assche <bart.vanass...@sandisk.com> Reviewed-by: Christoph Hellwig <h...@lst.de> Cc: Hannes Reinecke <h...@suse.com> --- drivers/scsi/scsi_lib.

<    1   2   3   4   5   6   7   8   9   10   >