[PATCH] nbd: set sk->sk_sndtimeo for our sockets

2017-06-08 Thread josef
From: Josef Bacik If the nbd server stops receiving packets altogether we will get stuck waiting for them to receive indefinitely as the tcp buffer will never empty, which looks like a deadlock. Fix this by setting the sk send timeout to our configured timeout, that way if the

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

2017-06-08 Thread Bart Van Assche
Hello Jens, 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 that improve the block layer documentation. Please consider these patches for kernel v4.13. The basis for these patches is a

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

2017-06-08 Thread Bart Van Assche
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 from 'rw' into 'op'. This patch does not change any functionality.

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

2017-06-08 Thread Bart Van Assche
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. This does not only help block driver authors but will also make it

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

2017-06-08 Thread Bart Van Assche
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 Reviewed-by: Christoph Hellwig Cc: Hannes Reinecke

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

2017-06-08 Thread Bart Van Assche
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 Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Hannes

[PATCH v3 11/12] block: Constify disk_type

2017-06-08 Thread Bart Van Assche
The variable 'disk_type' is never modified so constify it. Signed-off-by: Bart Van Assche Reviewed-by: Christoph Hellwig Cc: Hannes Reinecke Cc: Omar Sandoval Cc: Ming Lei --- block/genhd.c | 4 ++--

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

2017-06-08 Thread Bart Van Assche
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() function into .initialize_rq_fn() because it is too small to keep it

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

2017-06-08 Thread Bart Van Assche
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 Reviewed-by: Christoph Hellwig Cc: Hannes Reinecke Cc: Omar Sandoval

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

2017-06-08 Thread Bart Van Assche
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_queues()). Since blk_mq_map_swqueue() does not map any unmapped

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

2017-06-08 Thread Bart Van Assche
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 Reviewed-by: Christoph Hellwig Cc: Hannes Reinecke Cc: Omar Sandoval Cc: Ming

[PATCH v3 06/12] blk-mq: Initialize a request before assigning a tag

2017-06-08 Thread Bart Van Assche
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(). Call blk_mq_rq_ctx_init() before modifying any struct request members. Initialize .rq_flags in

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

2017-06-08 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 Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke Reviewed-by: Martin K. Petersen

Re: dedicated error codes for the block layer V3

2017-06-08 Thread Mike Snitzer
On Thu, Jun 08 2017 at 11:42am -0400, Jens Axboe wrote: > On 06/03/2017 01:37 AM, Christoph Hellwig wrote: > > This series introduces a new blk_status_t error code type for the block > > layer so that we can have tigher control and explicit semantics for > > block layer errors.

Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when safe

2017-06-08 Thread Jens Axboe
On 06/08/2017 09:30 AM, Paolo Valente wrote: > >> Il giorno 05 giu 2017, alle ore 10:11, Paolo Valente >> ha scritto: >> >> In blk-cgroup, operations on blkg objects are protected with the >> request_queue lock. This is no more the lock that protects >> I/O-scheduler

Re: dedicated error codes for the block layer V3

2017-06-08 Thread Jens Axboe
On 06/03/2017 01:37 AM, Christoph Hellwig wrote: > This series introduces a new blk_status_t error code type for the block > layer so that we can have tigher control and explicit semantics for > block layer errors. > > All but the last three patches are cleanups that lead to the new type. > >

Re: [PATCH BUGFIX] block, bfq: access and cache blkg data only when safe

2017-06-08 Thread Paolo Valente
> Il giorno 05 giu 2017, alle ore 10:11, Paolo Valente > ha scritto: > > In blk-cgroup, operations on blkg objects are protected with the > request_queue lock. This is no more the lock that protects > I/O-scheduler operations in blk-mq. In fact, the latter are now >

Re: [PATCH blktests] loop/002: Regression testing for loop device flush

2017-06-08 Thread Jens Axboe
On 06/08/2017 06:28 AM, James Wang wrote: > Add a regression testing for loop device. when an unbound device > be close that take too long time. kernel will consume serveral orders > of magnitude more wall time than it does for a mounted device. Thanks a lot for taking the time to turn this into

Re: [PATCHv8 0/2] loop: enable different logical blocksizes

2017-06-08 Thread Jens Axboe
On 06/08/2017 05:46 AM, Hannes Reinecke wrote: > Currently the loop driver just simulates 512-byte blocks. When > creating bootable images for virtual machines it might be required > to use a different physical blocksize (eg 4k for S/390 DASD), as > the some bootloaders (like lilo or zipl for

Re: [PATCH 6/7] pktcdvd: use class_groups instead of class_attrs

2017-06-08 Thread Jens Axboe
On 06/08/2017 02:12 AM, Greg Kroah-Hartman wrote: > The class_attrs pointer is long depreciated, and is about to be finally > removed, so move to use the class_groups pointer instead. Feel free to add my Acked-by to this. -- Jens Axboe

Re: [PATCH] Fix loop device flush before configure v3

2017-06-08 Thread Jens Axboe
On 06/08/2017 12:52 AM, James Wang wrote: > While installing SLES-12 (based on v4.4), I found that the installer > will stall for 60+ seconds during LVM disk scan. The root cause was > determined to be the removal of a bound device check in loop_flush() > by commit b5dd2f6047ca ("block: loop:

Re: [xfstests PATCH v3 5/5] btrfs: allow it to use $SCRATCH_LOGDEV

2017-06-08 Thread Jeff Layton
On Tue, 2017-06-06 at 17:19 +0800, Eryu Guan wrote: > On Wed, May 31, 2017 at 09:08:20AM -0400, Jeff Layton wrote: > > With btrfs, we can't really put the log on a separate device. What we > > can do however is mirror the metadata across two devices and make the > > data striped across all

[PATCH blktests] loop/002: Regression testing for loop device flush

2017-06-08 Thread James Wang
Add a regression testing for loop device. when an unbound device be close that take too long time. kernel will consume serveral orders of magnitude more wall time than it does for a mounted device. Signed-off-by: James Wang --- tests/loop/002 | 77

[PATCHv8 2/2] loop: support 4k physical blocksize

2017-06-08 Thread Hannes Reinecke
When generating bootable VM images certain systems (most notably s390x) require devices with 4k blocksize. This patch implements a new flag 'LO_FLAGS_BLOCKSIZE' which will set the physical blocksize to that of the underlying device, and allow to change the logical blocksize for up to the physical

[PATCHv8 1/2] loop: Remove unused 'bdev' argument from loop_set_capacity

2017-06-08 Thread Hannes Reinecke
Signed-off-by: Hannes Reinecke Reviewed-by: Christoph Hellwig --- drivers/block/loop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 28d9329..fc706ad 100644 --- a/drivers/block/loop.c +++

[PATCHv8 0/2] loop: enable different logical blocksizes

2017-06-08 Thread Hannes Reinecke
Currently the loop driver just simulates 512-byte blocks. When creating bootable images for virtual machines it might be required to use a different physical blocksize (eg 4k for S/390 DASD), as the some bootloaders (like lilo or zipl for S/390) need to know the physical block addresses of the

Re: [PATCH] Fix loop device flush before configure v3

2017-06-08 Thread James Wang
On 06/08/2017 03:53 PM, Johannes Thumshirn wrote: > On 06/08/2017 08:52 AM, James Wang wrote: >> Test method: >> modprobe loop max_loop=64 >> dd if=/dev/zero of=disk bs=512 count=200K >> for((i=0;i<4;i++))do losetup -f disk; done >> mkfs.ext4 -F /dev/loop0 >> for((i=0;i<4;i++))do mkdir t$i;

[PATCH 6/7] pktcdvd: use class_groups instead of class_attrs

2017-06-08 Thread Greg Kroah-Hartman
The class_attrs pointer is long depreciated, and is about to be finally removed, so move to use the class_groups pointer instead. Cc: Cc: Jens Axboe Cc: Hannes Reinecke Cc: Jan Kara Cc: Mike Christie

Re: [PATCH] Fix loop device flush before configure v3

2017-06-08 Thread Johannes Thumshirn
On 06/08/2017 08:52 AM, James Wang wrote: > Test method: > modprobe loop max_loop=64 > dd if=/dev/zero of=disk bs=512 count=200K > for((i=0;i<4;i++))do losetup -f disk; done > mkfs.ext4 -F /dev/loop0 > for((i=0;i<4;i++))do mkdir t$i; mount /dev/loop$i t$i;done > for f in `ls /dev/loop[0-9]*|sort`;

Re: [PATCH 0/10 v11] No wait AIO

2017-06-08 Thread Christoph Hellwig
As already indicated this whole series looks fine to me. Al: are you going to pick this up? Or Andrew? On Tue, Jun 06, 2017 at 06:19:29AM -0500, Goldwyn Rodrigues wrote: > This series adds nonblocking feature to asynchronous I/O writes. > io_submit() can be delayed because of a number of

Re: [PATCH] Fix loop device flush before configure

2017-06-08 Thread James Wang
On 06/08/2017 02:56 PM, Christoph Hellwig wrote: > On Thu, Jun 08, 2017 at 08:45:31AM +0800, James Wang wrote: >> Ok I got it blktests is a suite. I'd like to contribute something. If you >> need, we adapt you,;-)! >> But I have to learn some how to do that, need time. > I haven't added test

Re: [PATCH 7/8] blk-mq: create hctx for each present CPU

2017-06-08 Thread Christoph Hellwig
On Wed, Jun 07, 2017 at 03:04:11PM -0700, Omar Sandoval wrote: > On Sat, Jun 03, 2017 at 04:04:02PM +0200, Christoph Hellwig wrote: > > Currently we only create hctx for online CPUs, which can lead to a lot > > of churn due to frequent soft offline / online operations. Instead > > allocate one

Re: [PATCH] Fix loop device flush before configure

2017-06-08 Thread Christoph Hellwig
On Thu, Jun 08, 2017 at 08:45:31AM +0800, James Wang wrote: > Ok I got it blktests is a suite. I'd like to contribute something. If you > need, we adapt you,;-)! > But I have to learn some how to do that, need time. I haven't added test myself to blktests yet either, so I'd have to learn it as

[PATCH] Fix loop device flush before configure v3

2017-06-08 Thread James Wang
While installing SLES-12 (based on v4.4), I found that the installer will stall for 60+ seconds during LVM disk scan. The root cause was determined to be the removal of a bound device check in loop_flush() by commit b5dd2f6047ca ("block: loop: improve performance via blk-mq"). Restoring this

[PATCH] Fix loop device flush before configure

2017-06-08 Thread James Wang
While installing SLES-12 (based on v4.4), I found that the installer will stall for 60+ seconds during LVM disk scan. The root cause was determined to be the removal of a bound device check in loop_flush() by commit b5dd2f6047ca ("block: loop: improve performance via blk-mq"). Restoring this