Re: [PATCH V2] scsi_debugfs: fix crash in scsi_show_rq()

2017-11-07 Thread Ming Lei
Hi James, On Tue, Nov 07, 2017 at 07:04:23PM -0800, James Bottomley wrote: > On Wed, 2017-11-08 at 09:15 +0800, Ming Lei wrote: > > On Wed, Nov 08, 2017 at 01:06:44AM +, Bart Van Assche wrote: > > > > > > On Wed, 2017-11-08 at 08:59 +0800, Ming Lei wrote: > > > > > > > > On Tue, Nov 07,

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Jens Axboe
On 11/07/2017 08:12 PM, Ming Lei wrote: > On Tue, Nov 07, 2017 at 08:01:48PM -0700, Jens Axboe wrote: >> On 11/07/2017 06:03 PM, Ming Lei wrote: >>> On Tue, Nov 07, 2017 at 03:06:31PM -0700, Jens Axboe wrote: On 11/07/2017 10:36 AM, Jens Axboe wrote: > On 11/07/2017 10:10 AM, Jens Axboe

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Ming Lei
On Tue, Nov 07, 2017 at 08:01:48PM -0700, Jens Axboe wrote: > On 11/07/2017 06:03 PM, Ming Lei wrote: > > On Tue, Nov 07, 2017 at 03:06:31PM -0700, Jens Axboe wrote: > >> On 11/07/2017 10:36 AM, Jens Axboe wrote: > >>> On 11/07/2017 10:10 AM, Jens Axboe wrote: > On 11/07/2017 09:29 AM, Jens

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Jens Axboe
On 11/07/2017 09:17 AM, Bart Van Assche wrote: > On Tue, 2017-11-07 at 18:15 +0800, Ming Lei wrote: >> Last time, you didn't mention the target patch for setting its >> can_queue as 1, so I think you can't reproduce the issue on upstream >> kernel without out-of-tree patch. Then looks it is

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Jens Axboe
On 11/07/2017 07:58 PM, Ming Lei wrote: > On Tue, Nov 07, 2017 at 07:55:32PM -0700, Jens Axboe wrote: >> On 11/07/2017 05:39 PM, Ming Lei wrote: >>> On Tue, Nov 07, 2017 at 04:20:08PM +, Bart Van Assche wrote: On Tue, 2017-11-07 at 10:11 +0800, Ming Lei wrote: > If you can reproduce,

Re: [PATCH V2] scsi_debugfs: fix crash in scsi_show_rq()

2017-11-07 Thread James Bottomley
On Wed, 2017-11-08 at 09:15 +0800, Ming Lei wrote: > On Wed, Nov 08, 2017 at 01:06:44AM +, Bart Van Assche wrote: > > > > On Wed, 2017-11-08 at 08:59 +0800, Ming Lei wrote: > > > > > > On Tue, Nov 07, 2017 at 04:13:48PM +, Bart Van Assche wrote: > > > > > > > > On Tue, 2017-11-07 at

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Jens Axboe
On 11/07/2017 06:03 PM, Ming Lei wrote: > On Tue, Nov 07, 2017 at 03:06:31PM -0700, Jens Axboe wrote: >> On 11/07/2017 10:36 AM, Jens Axboe wrote: >>> On 11/07/2017 10:10 AM, Jens Axboe wrote: On 11/07/2017 09:29 AM, Jens Axboe wrote: > On 11/07/2017 09:20 AM, Bart Van Assche wrote:

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Ming Lei
On Tue, Nov 07, 2017 at 07:55:32PM -0700, Jens Axboe wrote: > On 11/07/2017 05:39 PM, Ming Lei wrote: > > On Tue, Nov 07, 2017 at 04:20:08PM +, Bart Van Assche wrote: > >> On Tue, 2017-11-07 at 10:11 +0800, Ming Lei wrote: > >>> If you can reproduce, please provide me at least the following

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Jens Axboe
On 11/07/2017 05:39 PM, Ming Lei wrote: > On Tue, Nov 07, 2017 at 04:20:08PM +, Bart Van Assche wrote: >> On Tue, 2017-11-07 at 10:11 +0800, Ming Lei wrote: >>> If you can reproduce, please provide me at least the following log >>> first: >>> >>> find /sys/kernel/debug/block -name tags |

Re: [PATCH] blk-mq: respect queue dead via blk_mq_quiesce_queue

2017-11-07 Thread Ming Lei
On Tue, Nov 07, 2017 at 10:27:11AM +0800, Ming Lei wrote: > On Mon, Nov 06, 2017 at 04:34:21PM +, Bart Van Assche wrote: > > On Mon, 2017-11-06 at 11:44 +0800, Ming Lei wrote: > > > On Sun, Nov 05, 2017 at 03:38:49PM +, Bart Van Assche wrote: > > > > On Sun, 2017-11-05 at 20:10 +0800, Ming

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Ming Lei
On Wed, Nov 08, 2017 at 08:53:38AM +0800, Ming Lei wrote: > On Tue, Nov 07, 2017 at 05:34:38PM +, Bart Van Assche wrote: > > On Tue, 2017-11-07 at 09:29 -0700, Jens Axboe wrote: > > > On 11/07/2017 09:20 AM, Bart Van Assche wrote: > > > > On Tue, 2017-11-07 at 10:11 +0800, Ming Lei wrote: > >

Re: [PATCH V2] scsi_debugfs: fix crash in scsi_show_rq()

2017-11-07 Thread Ming Lei
On Wed, Nov 08, 2017 at 01:06:44AM +, Bart Van Assche wrote: > On Wed, 2017-11-08 at 08:59 +0800, Ming Lei wrote: > > On Tue, Nov 07, 2017 at 04:13:48PM +, Bart Van Assche wrote: > > > On Tue, 2017-11-07 at 23:21 +0800, Ming Lei wrote: > > > > diff --git a/drivers/scsi/scsi_debugfs.c

[PATCH V2] blk-mq: put driver tag if dispatch budget can't be got

2017-11-07 Thread Ming Lei
We have to put the driver tag if dispatch budget can't be got, otherwise it might cause IO deadlock, especially in case that size of tags is very small. Fixes: de1482974080(blk-mq: introduce .get_budget and .put_budget in blk_mq_ops) Signed-off-by: Ming Lei --- V2:

Re: [PATCH V2] scsi_debugfs: fix crash in scsi_show_rq()

2017-11-07 Thread Bart Van Assche
On Wed, 2017-11-08 at 08:59 +0800, Ming Lei wrote: > On Tue, Nov 07, 2017 at 04:13:48PM +, Bart Van Assche wrote: > > On Tue, 2017-11-07 at 23:21 +0800, Ming Lei wrote: > > > diff --git a/drivers/scsi/scsi_debugfs.c b/drivers/scsi/scsi_debugfs.c > > > index 5e9755008aed..7a50878446b4 100644 >

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Ming Lei
On Tue, Nov 07, 2017 at 03:06:31PM -0700, Jens Axboe wrote: > On 11/07/2017 10:36 AM, Jens Axboe wrote: > > On 11/07/2017 10:10 AM, Jens Axboe wrote: > >> On 11/07/2017 09:29 AM, Jens Axboe wrote: > >>> On 11/07/2017 09:20 AM, Bart Van Assche wrote: > On Tue, 2017-11-07 at 10:11 +0800, Ming

Re: [PATCH V2] scsi_debugfs: fix crash in scsi_show_rq()

2017-11-07 Thread Ming Lei
On Tue, Nov 07, 2017 at 04:13:48PM +, Bart Van Assche wrote: > On Tue, 2017-11-07 at 23:21 +0800, Ming Lei wrote: > > cmd->cmnd can be allocated/freed dynamically in case of > > T10_PI_TYPE2_PROTECTION, > > so we can't access it in scsi_show_rq() if 'SCpnt->cmnd != > > scsi_req(rq)->cmd', >

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Ming Lei
On Tue, Nov 07, 2017 at 05:34:38PM +, Bart Van Assche wrote: > On Tue, 2017-11-07 at 09:29 -0700, Jens Axboe wrote: > > On 11/07/2017 09:20 AM, Bart Van Assche wrote: > > > On Tue, 2017-11-07 at 10:11 +0800, Ming Lei wrote: > > > > If you can reproduce, please provide me at least the following

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Ming Lei
On Tue, Nov 07, 2017 at 10:34:35PM +, Bart Van Assche wrote: > On Tue, 2017-11-07 at 15:06 -0700, Jens Axboe wrote: > > Just to keep everyone in the loop, this bug is not new to > > for-4.15/block, nor is it new to the current 4.41-rc or 4.13. So it's > > probably different to what Bart is

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Ming Lei
On Tue, Nov 07, 2017 at 04:20:08PM +, Bart Van Assche wrote: > On Tue, 2017-11-07 at 10:11 +0800, Ming Lei wrote: > > If you can reproduce, please provide me at least the following log > > first: > > > > find /sys/kernel/debug/block -name tags | xargs cat | grep busy > > > > If any

Re: [PATCH] blk-mq: put driver tag if dispatch budget can't be got

2017-11-07 Thread Ming Lei
On Tue, Nov 07, 2017 at 09:23:19AM -0700, Jens Axboe wrote: > On 11/07/2017 02:59 AM, Ming Lei wrote: > > We have to put the driver tag if dispatch budget can't be got, otherwise > > it might cause IO deadlock, especially in case that size of tags is very > > small. > > Fix looks correct to me,

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Bart Van Assche
On Tue, 2017-11-07 at 15:06 -0700, Jens Axboe wrote: > Just to keep everyone in the loop, this bug is not new to > for-4.15/block, nor is it new to the current 4.41-rc or 4.13. So it's > probably different to what Bart is hitting, but it's a bug none the > less... Hello Jens, There are several

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Jens Axboe
On 11/07/2017 10:36 AM, Jens Axboe wrote: > On 11/07/2017 10:10 AM, Jens Axboe wrote: >> On 11/07/2017 09:29 AM, Jens Axboe wrote: >>> On 11/07/2017 09:20 AM, Bart Van Assche wrote: On Tue, 2017-11-07 at 10:11 +0800, Ming Lei wrote: > If you can reproduce, please provide me at least the

[PATCH] bio: have bio_kmap_irq return the size of mapped data (fwd)

2017-11-07 Thread Mikulas Patocka
Hi I need the function bio_kmap_irq in the driver that I am developing, but it doesn't return the size of the mapped data. I've made this patch to fix it. Mikulas From: Mikulas Patocka The function bio_kmap_irq is not usable because it does not return the size of the

[PATCH] nbd: fix bdev invalidation

2017-11-07 Thread Josef Bacik
From: Josef Bacik We do the bdev invalidation sort of haphazardly throughout nbd which has resulted in weirdness like partitions not showing up when doing netlink connects, or they not disappearing properly in the ioctl case. Fix this by making the invalidation of the device more

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Jens Axboe
On 11/07/2017 10:10 AM, Jens Axboe wrote: > On 11/07/2017 09:29 AM, Jens Axboe wrote: >> On 11/07/2017 09:20 AM, Bart Van Assche wrote: >>> On Tue, 2017-11-07 at 10:11 +0800, Ming Lei wrote: If you can reproduce, please provide me at least the following log first: find

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Bart Van Assche
On Tue, 2017-11-07 at 09:29 -0700, Jens Axboe wrote: > On 11/07/2017 09:20 AM, Bart Van Assche wrote: > > On Tue, 2017-11-07 at 10:11 +0800, Ming Lei wrote: > > > If you can reproduce, please provide me at least the following log > > > first: > > > > > > find /sys/kernel/debug/block -name tags

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Jens Axboe
On 11/07/2017 09:29 AM, Jens Axboe wrote: > On 11/07/2017 09:20 AM, Bart Van Assche wrote: >> On Tue, 2017-11-07 at 10:11 +0800, Ming Lei wrote: >>> If you can reproduce, please provide me at least the following log >>> first: >>> >>> find /sys/kernel/debug/block -name tags | xargs cat | grep

Re: [PATCH 3/3] nvme: fix eui_show() print format

2017-11-07 Thread Javier González
> On 7 Nov 2017, at 17.28, Christoph Hellwig wrote: > > On Sat, Nov 04, 2017 at 12:22:20PM +0100, Javier González wrote: >>> Perhaps this should just become >>> >>>%8ph >>> >>> without D >> >> That would be ok with me. > > Can you resend a patch for that? > Sure. I’ll

Re: [PATCH 3/3] nvme: fix eui_show() print format

2017-11-07 Thread Christoph Hellwig
On Sat, Nov 04, 2017 at 12:22:20PM +0100, Javier González wrote: > > Perhaps this should just become > > > > %8ph > > > > without D > > That would be ok with me. Can you resend a patch for that?

Re: [PATCH] null_blk: add an usage for shared tags in documentation

2017-11-07 Thread Jens Axboe
On 11/07/2017 07:18 AM, Minwoo Im wrote: > add usage explanation for a shared_tags of > commit 82f402fefa50f1675bf918bcd009981bd6b30ac8 > ("null_blk: add support for shared tags") to this documentation. > > Signed-off-by: Minwoo Im > --- >

Re: [PATCH] null_blk: fix default values in documentation

2017-11-07 Thread Jens Axboe
On 11/07/2017 06:23 AM, Minwoo Im wrote: > null_blk.c has initial value of > (1) nr_devices as 1. > (2) completion_nsec as 10,000ns, not 10.000ns. > documentation should be updated for fixes above. Thanks, applied. -- Jens Axboe

Re: [PATCH] blk-mq: put driver tag if dispatch budget can't be got

2017-11-07 Thread Jens Axboe
On 11/07/2017 02:59 AM, Ming Lei wrote: > We have to put the driver tag if dispatch budget can't be got, otherwise > it might cause IO deadlock, especially in case that size of tags is very > small. Fix looks correct to me, but it's missing a Fixes: line. I tried to go back a little bit, but it

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Bart Van Assche
On Tue, 2017-11-07 at 10:11 +0800, Ming Lei wrote: > If you can reproduce, please provide me at least the following log > first: > > find /sys/kernel/debug/block -name tags | xargs cat | grep busy > > If any pending requests arn't completed, please provide the related > info in dbgfs about

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Bart Van Assche
On Tue, 2017-11-07 at 18:15 +0800, Ming Lei wrote: > Last time, you didn't mention the target patch for setting its > can_queue as 1, so I think you can't reproduce the issue on upstream > kernel without out-of-tree patch. Then looks it is another issue, > and we are making progress actually. If

Re: [PATCH V2] scsi_debugfs: fix crash in scsi_show_rq()

2017-11-07 Thread Bart Van Assche
On Tue, 2017-11-07 at 23:21 +0800, Ming Lei wrote: > cmd->cmnd can be allocated/freed dynamically in case of > T10_PI_TYPE2_PROTECTION, > so we can't access it in scsi_show_rq() if 'SCpnt->cmnd != scsi_req(rq)->cmd', > because this request can be freed any time. That description is inaccurate.

Re: [PATCH 1/1] [RFC] blk-mq: fix queue stalling on shared hctx restart

2017-11-07 Thread Bart Van Assche
On Wed, 2017-10-18 at 12:22 +0200, Roman Pen wrote: > the patch below fixes queue stalling when shared hctx marked for restart > (BLK_MQ_S_SCHED_RESTART bit) but q->shared_hctx_restart stays zero. Since I have been able to reproduce this queue stall with an upstream driver (ib_srp) and since I

[PATCH V2] scsi_debugfs: fix crash in scsi_show_rq()

2017-11-07 Thread Ming Lei
cmd->cmnd can be allocated/freed dynamically in case of T10_PI_TYPE2_PROTECTION, so we can't access it in scsi_show_rq() if 'SCpnt->cmnd != scsi_req(rq)->cmd', because this request can be freed any time. This patch trys to fix the following kernel crash when dumping request via block's debugfs

Re: [PATCH] scsi_debugfs: fix crash in scsi_show_rq()

2017-11-07 Thread Ming Lei
On Tue, Nov 07, 2017 at 03:04:09PM +, John Garry wrote: > Hi Ming, > > On 07/11/2017 14:55, Ming Lei wrote: > > + strcpy(buf, "unknow"); > > typo? Yeah, will fix it in V2, thanks! -- Ming

Re: [PATCH] scsi_debugfs: fix crash in scsi_show_rq()

2017-11-07 Thread John Garry
Hi Ming, On 07/11/2017 14:55, Ming Lei wrote: > + strcpy(buf, "unknow"); typo? Thanks, John

[PATCH] scsi_debugfs: fix crash in scsi_show_rq()

2017-11-07 Thread Ming Lei
cmd->cmnd can be allocated/freed dynamically in case of T10_PI_TYPE2_PROTECTION, so we can't access it in scsi_show_rq() if 'SCpnt->cmnd != scsi_req(rq)->cmd', because this request can be freed any time. This patch trys to fix the following kernel crash when dumping request via block's debugfs

[PATCH] null_blk: add an usage for shared tags in documentation

2017-11-07 Thread Minwoo Im
add usage explanation for a shared_tags of commit 82f402fefa50f1675bf918bcd009981bd6b30ac8 ("null_blk: add support for shared tags") to this documentation. Signed-off-by: Minwoo Im --- Documentation/block/null_blk.txt | 5 + 1 file changed, 5 insertions(+) diff

[PATCH] null_blk: fix default values in documentation

2017-11-07 Thread Minwoo Im
null_blk.c has initial value of (1) nr_devices as 1. (2) completion_nsec as 10,000ns, not 10.000ns. documentation should be updated for fixes above. Signed-off-by: Minwoo Im --- Documentation/block/null_blk.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

Re: [PATCH V8 0/8] block/scsi: safe SCSI quiescing

2017-11-07 Thread Ming Lei
On Tue, Nov 07, 2017 at 01:32:44PM +0100, Oleksandr Natalenko wrote: > Hi Ming, Jens. > > What is the fate of this patchset please? Hi Oleksandr, Recently Bart is working on this patchset, and you may try to see if his V11 works for you: https://marc.info/?t=15094035109=1=2

Re: [PATCH V8 0/8] block/scsi: safe SCSI quiescing

2017-11-07 Thread Oleksandr Natalenko
Hi Ming, Jens. What is the fate of this patchset please? 03.10.2017 16:03, Ming Lei wrote: Hi Jens, Please consider this patchset for V4.15, and it fixes one kind of long-term I/O hang issue in either block legacy path or blk-mq. The current SCSI quiesce isn't safe and easy to trigger I/O

Re: [PATCH] SCSI: don't get target/host busy_count in scsi_mq_get_budget()

2017-11-07 Thread Ming Lei
On Mon, Nov 06, 2017 at 07:45:23PM +, Bart Van Assche wrote: > On Sat, 2017-11-04 at 08:19 -0600, Jens Axboe wrote: > > On 11/03/2017 07:55 PM, Ming Lei wrote: > > > It is very expensive to atomic_inc/atomic_dec the host wide counter of > > > host->busy_count, and it should have been avoided

[PATCH] blk-mq: put driver tag if dispatch budget can't be got

2017-11-07 Thread Ming Lei
We have to put the driver tag if dispatch budget can't be got, otherwise it might cause IO deadlock, especially in case that size of tags is very small. Signed-off-by: Ming Lei --- block/blk-mq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[General protection fault] in bio_integrity_advance

2017-11-07 Thread Yu Chen
Hi all, We are using 4.13.5-100.fc25.x86_64 and a panic was found during resume from hibernation, the backtrace is illustrated as below, would someone please take a look if this has already been fixed or is this issue still in the upstream kernel? thanks! [ 114.846213] PM: Using 3 thread(s) for