Re: [PATCH 07/11] blktrace: export cgroup info in trace

2017-06-02 Thread kbuild test robot
Hi Shaohua, [auto build test WARNING on driver-core/driver-core-testing] [also build test WARNING on v4.12-rc3 next-20170602] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Shaohua-Li/kernfs

[PATCH] elevator: fix truncation of icq_cache_name

2017-06-02 Thread Eric Biggers
From: Eric Biggers gcc 7.1 reports the following warning: block/elevator.c: In function ‘elv_register’: block/elevator.c:898:5: warning: ‘snprintf’ output may be truncated before the last format character [-Wformat-truncation=] "%s_io_cq", e->elevator_name); ^~

Re: [PATCH 11/11] block: use standard blktrace API to output cgroup info for debug notes

2017-06-02 Thread kbuild test robot
Hi Shaohua, [auto build test ERROR on driver-core/driver-core-testing] [also build test ERROR on v4.12-rc3 next-20170602] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Shaohua-Li/kernfs

Re: [PATCH 11/11] block: use standard blktrace API to output cgroup info for debug notes

2017-06-02 Thread kbuild test robot
Hi Shaohua, [auto build test ERROR on driver-core/driver-core-testing] [also build test ERROR on v4.12-rc3 next-20170602] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Shaohua-Li/kernfs

Re: [PATCH 03/11] kernfs: add an API to get kernfs node from inode number

2017-06-02 Thread Shaohua Li
On Fri, Jun 02, 2017 at 03:03:45PM -0700, Eduardo Valentin wrote: > On Fri, Jun 02, 2017 at 02:53:56PM -0700, Shaohua Li wrote: > > From: Shaohua Li > > > > Add an API to get kernfs node from inode number. We will need this to > > implement exportfs operations. > > > > To make the API lock free,

Re: Block device integrity support

2017-06-02 Thread Jens Axboe
On 06/02/2017 03:38 PM, Bart Van Assche wrote: > On Fri, 2017-06-02 at 18:24 -0400, Martin K. Petersen wrote: >>> then the output shown below appears in the kernel log. Does anyone know how >>> to fix this? Sorry but I'm not really familiar with the integrity >>> code. >> >> Dmitry posted a fix for

Re: Block device integrity support

2017-06-02 Thread Bart Van Assche
On Fri, 2017-06-02 at 18:24 -0400, Martin K. Petersen wrote: > > then the output shown below appears in the kernel log. Does anyone know how > > to fix this? Sorry but I'm not really familiar with the integrity > > code. > > Dmitry posted a fix for this a few weeks ago. Ah, that's right. Jens, ha

Re: [PATCH v3 3/9] blk-mq: use the introduced blk_mq_unquiesce_queue()

2017-06-02 Thread Bart Van Assche
On Fri, 2017-06-02 at 10:00 +0800, Ming Lei wrote: > On Thu, Jun 01, 2017 at 11:09:00PM +, Bart Van Assche wrote: > > My opinion is that scsi_internal_device_block() and > > scsi_internal_device_unblock() > > should be changed as follows for the scsi-mq code path: > > * scsi_internal_device_bl

Re: Block device integrity support

2017-06-02 Thread Martin K. Petersen
Jens, > There's not much in my for-next/4.13 branches yet, so I'm assuming this also > triggers with current mainline? Yep. -- Martin K. Petersen Oracle Linux Engineering

Re: Block device integrity support

2017-06-02 Thread Martin K. Petersen
Bart, > modprobe scsi_debug delay=0 dif=3 dix=-1 dev_size_mb=16 Those options don't make much sense. > then the output shown below appears in the kernel log. Does anyone know how > to fix this? Sorry but I'm not really familiar with the integ

Re: Block device integrity support

2017-06-02 Thread Jens Axboe
On 06/02/2017 02:53 PM, Bart Van Assche wrote: > Hello Jens and Christoph, > > With Jens' for-next branch (commit fe02d46ab775), if I run the following > commands: > > modprobe scsi_debug delay=0 dif=3 dix=-1 dev_size_mb=16 > mkfs.xfs /dev/disk/by-id/scsi-1Linux_scsi_debug_22000 > > then

Re: [PATCH 03/11] kernfs: add an API to get kernfs node from inode number

2017-06-02 Thread Eduardo Valentin
On Fri, Jun 02, 2017 at 02:53:56PM -0700, Shaohua Li wrote: > From: Shaohua Li > > Add an API to get kernfs node from inode number. We will need this to > implement exportfs operations. > > To make the API lock free, kernfs node is freed in RCU context. And we > depend on kernfs_node count/ino n

[PATCH 00/11]blktrace: output cgroup info

2017-06-02 Thread Shaohua Li
From: Shaohua Li Hi, Currently blktrace isn't cgroup aware. blktrace prints out task name of current context, but the task of current context isn't always in the cgroup where the BIO comes from. We can't use task name to find out IO cgroup. For example, Writeback BIOs always comes from flusher t

[PATCH 01/11] kernfs: implement i_generation

2017-06-02 Thread Shaohua Li
From: Shaohua Li Set i_generation for kernfs inode. This is required to implement exportfs operations. Note, the generation is 32-bit, so it's possible the generation wraps up and we find stale files. The possiblity is low, since fhandle matches both inode number and generation. In most fs, the

[PATCH 03/11] kernfs: add an API to get kernfs node from inode number

2017-06-02 Thread Shaohua Li
From: Shaohua Li Add an API to get kernfs node from inode number. We will need this to implement exportfs operations. To make the API lock free, kernfs node is freed in RCU context. And we depend on kernfs_node count/ino number to filter stale kernfs nodes. Signed-off-by: Shaohua Li --- fs/ke

[PATCH 05/11] kernfs: add exportfs operations

2017-06-02 Thread Shaohua Li
From: Shaohua Li Now we have the facilities to implement exportfs operations. The idea is cgroup can export the fhandle info to userspace, then userspace uses fhandle to find the cgroup name. Another example is userspace can get fhandle for a cgroup and BPF uses the fhandle to filter info for the

[PATCH 11/11] block: use standard blktrace API to output cgroup info for debug notes

2017-06-02 Thread Shaohua Li
From: Shaohua Li Currently cfq/bfq/blk-throttle output cgroup info in trace in their own way. Now we have standard blktrace API for this, so convert them to use it. Note, this changes the behavior a little bit. cgroup info isn't output by default, we only do this with 'blk_cgroup' option enabled

[PATCH 10/11] blktrace: add an option to allow displying cgroup path

2017-06-02 Thread Shaohua Li
From: Shaohua Li By default we output cgroup id in blktrace. This adds an option to display cgroup path. Since get cgroup path is a relativly heavy operation, we don't enable it by default. with the option enabled, blktrace will output something like this: dd-1353 [007] d..2 293.015252: 8,0

[PATCH 02/11] kernfs: use idr instead of ida to manage inode number

2017-06-02 Thread Shaohua Li
From: Shaohua Li kernfs uses ida to manage inode number. The problem is we can't get kernfs_node from inode number with ida. Switching to use idr, next patch will add an API to get kernfs_node from inode number. Signed-off-by: Shaohua Li --- fs/kernfs/dir.c| 17 - inclu

[PATCH 09/11] block: call __bio_free in bio_endio

2017-06-02 Thread Shaohua Li
From: Shaohua Li bio_free isn't a good place to free cgroup/integrity info. There are a lot of cases bio is allocated in special way (for example, in stack) and never gets called by bio_put hence bio_free, we are leaking memory. This patch moves the free to bio endio, which should be called anywa

[PATCH 04/11] kernfs: don't set dentry->d_fsdata

2017-06-02 Thread Shaohua Li
From: Shaohua Li When working on adding exportfs operations in kernfs, I found it's hard to initialize dentry->d_fsdata in the exportfs operations. Looks there is no way to do it without race condition. Look at the kernfs code closely, there is no point to set dentry->d_fsdata. inode->i_private a

[PATCH 08/11] block: always attach cgroup info into bio

2017-06-02 Thread Shaohua Li
From: Shaohua Li blkcg_bio_issue_check() already gets blkcg for a BIO. bio_associate_blkcg() uses a percpu refcounter, so it's a very cheap operation. There is no point we don't attach the cgroup info into bio at blkcg_bio_issue_check. This also makes blktrace outputs correct cgroup info. Signed

[PATCH 06/11] cgroup: export fhandle info for a cgroup

2017-06-02 Thread Shaohua Li
From: Shaohua Li Add an API to export cgroup fhandle info. We don't export a full 'struct file_handle', there are unrequired info. Sepcifically, cgroup is always a directory, so we don't need a 'FILEID_INO32_GEN_PARENT' type fhandle, we only need export the inode number and generation number just

[PATCH 07/11] blktrace: export cgroup info in trace

2017-06-02 Thread Shaohua Li
From: Shaohua Li Currently blktrace isn't cgroup aware. blktrace prints out task name of current context, but the task of current context isn't always in the cgroup where the BIO comes from. We can't use task name to find out IO cgroup. For example, Writeback BIOs always comes from flusher thread

Block device integrity support

2017-06-02 Thread Bart Van Assche
Hello Jens and Christoph, With Jens' for-next branch (commit fe02d46ab775), if I run the following commands: modprobe scsi_debug delay=0 dif=3 dix=-1 dev_size_mb=16 mkfs.xfs /dev/disk/by-id/scsi-1Linux_scsi_debug_22000 then the output shown below appears in the kernel log. Does anyone kn

Re: [PATCH] nvme: fix hang in remove path

2017-06-02 Thread Rakesh Pandit
Hi Ming, On Fri, Jun 02, 2017 at 04:32:08PM +0800, Ming Lei wrote: > We need to start admin queues too in nvme_kill_queues() > for avoiding hang in remove path[1]. > > This patch is very similar with 806f026f9b901eaf(nvme: use > blk_mq_start_hw_queues() in nvme_kill_queues()). It would make sens

[GIT PULL] Block fixes for 4.12-rc4

2017-06-02 Thread Jens Axboe
Hi Linus, A set of fixes that should go into the next -rc. This pull request contains: - A use-after-free in the request_list exit for the legacy IO path, from Bart. - A fix for CFQ, fixing a recent regression with the conversion to higher resolution timing for iops mode. From Hou Tao. - A

Re: [PATCH] nvme: fix hang in remove path

2017-06-02 Thread Sagi Grimberg
Reviewed-by: Sagi Grimberg

Re: [PATCH v5 00/17] fs: introduce new writeback error reporting and convert ext2 and ext4 to use it

2017-06-02 Thread Jeff Layton
On Thu, 2017-06-01 at 23:25 -0600, Ross Zwisler wrote: > On Wed, May 31, 2017 at 08:45:23AM -0400, Jeff Layton wrote: > > v5: don't retrofit old API over the new infrastructure > > add fstype flag to indicate how wb errors are tracked within that fs > > add more function variants that take

[PATCH] nvme: fix hang in remove path

2017-06-02 Thread Ming Lei
We need to start admin queues too in nvme_kill_queues() for avoiding hang in remove path[1]. This patch is very similar with 806f026f9b901eaf(nvme: use blk_mq_start_hw_queues() in nvme_kill_queues()). [1] hang stack trace [] blk_execute_rq+0x56/0x80 [] __nvme_submit_sync_cmd+0x89/0xf0 [] nvme_set

[PATCH] block: simplify code with bio_io_error

2017-06-02 Thread Guoqing Jiang
bio_io_error was introduced in the commit 4246a0b ("block: add a bi_error field to struct bio"), so use it directly. Signed-off-by: Guoqing Jiang --- block/blk-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index c706852..92bc663