Re: [PATCH] megaraid_sas: fix missing { } braces

2015-08-03 Thread Johannes Thumshirn
Hi Colin, Colin King writes: > From: Colin Ian King > > Static analysis by smatch indicated that there was a curly > braces issue: > > drivers/scsi/megaraid/megaraid_sas_base.c:6139 > megasas_mgmt_fw_ioctl() warn: curly braces intended? > > Add braces in the appropriate place so that kbuf_ar

Re: [TRIVIAL PATCH] block: Correct misuses of 0x%

2015-08-03 Thread yalin wang
> On Aug 4, 2015, at 10:27, Joe Perches wrote: > > On Tue, 2015-08-04 at 10:19 +0800, yalin wang wrote: >> Ping ? >>> On Aug 3, 2015, at 16:56, yalin wang wrote: >>> >>> On Aug 3, 2015, at 16:03, Joe Perches wrote: On Mon, 2015-08-03 at 15:25 +0800, yalin wang wrote: >>

Re: [Patch] scsi_ioctl: support persistent reserve commands for non-root user.

2015-08-03 Thread jiang . biao2
James Bottomley wrote on 2015/08/04 09:32:17: > On Tue, 2015-08-04 at 09:11 +0800, jiang.bi...@zte.com.cn wrote: > > scsi_ioctl: support persistent reserve commands through ioctl for > > non-root user. > > > > Scsi persistent reserve commands need to be used for non-root user in > > many scenari

Re: [TRIVIAL PATCH] block: Correct misuses of 0x%

2015-08-03 Thread Joe Perches
On Tue, 2015-08-04 at 10:19 +0800, yalin wang wrote: > Ping ? > > On Aug 3, 2015, at 16:56, yalin wang wrote: > > > > > >> On Aug 3, 2015, at 16:03, Joe Perches wrote: > >> > >> On Mon, 2015-08-03 at 15:25 +0800, yalin wang wrote: > On Aug 3, 2015, at 04:25, Joe Perches wrote: > >

Re: [TRIVIAL PATCH] block: Correct misuses of 0x%

2015-08-03 Thread yalin wang
Ping ? > On Aug 3, 2015, at 16:56, yalin wang wrote: > > >> On Aug 3, 2015, at 16:03, Joe Perches wrote: >> >> On Mon, 2015-08-03 at 15:25 +0800, yalin wang wrote: On Aug 3, 2015, at 04:25, Joe Perches wrote: Correct misuse of 0x%d in logging messages. >> [] >>> why not

Re: [Patch] scsi_ioctl: support persistent reserve commands for non-root user.

2015-08-03 Thread James Bottomley
On Tue, 2015-08-04 at 09:11 +0800, jiang.bi...@zte.com.cn wrote: > scsi_ioctl: support persistent reserve commands through ioctl for > non-root user. > > Scsi persistent reserve commands need to be used for non-root user in > many scenarios. > EPERM error will be returned by sg_io() when PERSISTEN

[Patch] scsi_ioctl: support persistent reserve commands for non-root user.

2015-08-03 Thread jiang . biao2
scsi_ioctl: support persistent reserve commands through ioctl for non-root user. Scsi persistent reserve commands need to be used for non-root user in many scenarios. EPERM error will be returned by sg_io() when PERSISTENT_RESERVE_OUT or PERSISTENT_RESERVE_IN command is sent through ioctl() for no

[PATCH] scsi/be2iscsi: Fix logical-not-parentheses compilation warning

2015-08-03 Thread Tomer Barletz
This fixes the following warning seen with GCC v5.1: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]. Signed-off-by: Tomer Barletz --- drivers/scsi/be2iscsi/be_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/

Re: [PATCH 1/6] libata: Do not retry commands with valid autosense

2015-08-03 Thread Hannes Reinecke
On 08/03/2015 07:01 PM, Tejun Heo wrote: > Hello, Hannes. > > On Mon, Aug 03, 2015 at 06:47:46PM +0200, Hannes Reinecke wrote: >> At the moment NCQ autosense is mostly used to provide the host with more >> details for a failed I/O. The typical case here is (no small surprise) >> ZAC disks, which u

Re: blk-mq vs kmemleak

2015-08-03 Thread Catalin Marinas
On Mon, Aug 03, 2015 at 06:05:59PM +0100, Bart Van Assche wrote: > On 08/03/2015 03:43 AM, Catalin Marinas wrote: > > The pages allocated for struct request contain pointers to other slab > > allocations (via ops->init_request). Since kmemleak does not track/scan > > page allocations, the slab obje

Re: blk-mq vs kmemleak

2015-08-03 Thread Bart Van Assche
On 08/03/2015 03:43 AM, Catalin Marinas wrote: The pages allocated for struct request contain pointers to other slab allocations (via ops->init_request). Since kmemleak does not track/scan page allocations, the slab objects will be reported as leaks (false positives). This patch adds kmemleak cal

Re: [PATCH 1/6] libata: Do not retry commands with valid autosense

2015-08-03 Thread Tejun Heo
Hello, Hannes. On Mon, Aug 03, 2015 at 06:47:46PM +0200, Hannes Reinecke wrote: > At the moment NCQ autosense is mostly used to provide the host with more > details for a failed I/O. The typical case here is (no small surprise) > ZAC disks, which use autosense to inform the host about > a malforme

Re: [PATCH 1/6] libata: Do not retry commands with valid autosense

2015-08-03 Thread Tejun Heo
Hello, James. On Mon, Aug 03, 2015 at 09:44:06AM -0700, James Bottomley wrote: > I'm not arguing that *this* patch is the best way to do it. You asked > *why* autosense and that's what I answered. I think there's time to Heh, that was mostly me being confused. I was thinking NCQ autosense was

Re: [PATCH 1/6] libata: Do not retry commands with valid autosense

2015-08-03 Thread Hannes Reinecke
On 08/03/2015 05:55 PM, Tejun Heo wrote: > Hello, James. > > On Mon, Aug 03, 2015 at 08:42:43AM -0700, James Bottomley wrote: >> I'd think it would be the same reason as all modern transports: it's >> faster and allows processing of sense data in-band. Under the old >> regime, the device is effec

Re: [PATCH 1/6] libata: Do not retry commands with valid autosense

2015-08-03 Thread James Bottomley
On Mon, 2015-08-03 at 11:55 -0400, Tejun Heo wrote: > Hello, James. > > On Mon, Aug 03, 2015 at 08:42:43AM -0700, James Bottomley wrote: > > I'd think it would be the same reason as all modern transports: it's > > faster and allows processing of sense data in-band. Under the old > > regime, the d

[PATCH 0/2] SCSI: fix bug in scsi_dev_info_list lookup

2015-08-03 Thread Alan Stern
James: Giulio Bernardi recently reported a problem (the second Logical Unit of his SATA-USB docking station was not being detected) which we traced down to a bug in the matching code in scsi_devinfo.c. The entire search algorithm (including the bug) is present in two separate routines of that so

[PATCH 2/2] SCSI: fix bug in scsi_dev_info_list matching

2015-08-03 Thread Alan Stern
The "compatible" matching algorithm used for looking up old-style blacklist entries in a scsi_dev_info_list is buggy. The core of the algorithm looks like this: if (memcmp(devinfo->vendor, vendor, min(max, strlen(devinfo->vendor

[PATCH 1/2] SCSI: refactor device-matching code in scsi_devinfo.c

2015-08-03 Thread Alan Stern
In drivers/scsi/scsi_devinfo.c, the scsi_dev_info_list_del_keyed() and scsi_get_device_flags_keyed() routines contain a large amount of duplicate code for finding vendor/product matches in a scsi_dev_info_list. This patch factors out the duplicate code and puts it in a separate function, scsi_dev_

Re: [PATCH 1/6] libata: Do not retry commands with valid autosense

2015-08-03 Thread Tejun Heo
Hello, James. On Mon, Aug 03, 2015 at 08:42:43AM -0700, James Bottomley wrote: > I'd think it would be the same reason as all modern transports: it's > faster and allows processing of sense data in-band. Under the old > regime, the device is effectively frozen until you collect the data. > Under

Re: [PATCH 1/6] libata: Do not retry commands with valid autosense

2015-08-03 Thread James Bottomley
On Mon, 2015-08-03 at 11:18 -0400, Tejun Heo wrote: > Adding a bit. > > On Mon, Aug 03, 2015 at 11:04:28AM -0400, Tejun Heo wrote: > > Ugh... so this is from NCQ autosense thing. Now ATA devices reports > > sense data too which trumps AC_ERR_DEV so libata EH decides to retry > > even when the dev

Re: [PATCH libata/for-4.2-fixes] libata: disable NCQ autosense

2015-08-03 Thread Tejun Heo
On Mon, Aug 03, 2015 at 11:16:21AM -0400, Tejun Heo wrote: > From 8c0fa3e7ca99b0d6d96cb2cf194a912f643da7c5 Mon Sep 17 00:00:00 2001 > From: Tejun Heo > Date: Mon, 3 Aug 2015 11:10:45 -0400 > > fe7173c206de ("libata: Implement support for sense data reporting") > and subsequent patches enabled NCQ

Re: [PATCH 0/6] ZAC host-aware device support

2015-08-03 Thread James Bottomley
On Mon, 2015-08-03 at 09:24 +0200, Hannes Reinecke wrote: > On 08/02/2015 06:11 PM, James Bottomley wrote: > > On Fri, 2015-07-31 at 15:02 +0200, Hannes Reinecke wrote: > >> Hi all, > >> > >> here is a patchset for adding ZAC host-aware device support to libata. > >> Main bits are translations for

Re: blk-mq vs kmemleak

2015-08-03 Thread Catalin Marinas
On Mon, Aug 03, 2015 at 02:33:27PM +0100, Christoph Hellwig wrote: > On Mon, Aug 03, 2015 at 11:43:09AM +0100, Catalin Marinas wrote: > > The simplest would be to add a kmemleak_not_leak() annotation in > > scsi_init_request(), though you would hide real leaks (if any). > > > > A better way could

Re: [PATCH 1/6] libata: Do not retry commands with valid autosense

2015-08-03 Thread Tejun Heo
Adding a bit. On Mon, Aug 03, 2015 at 11:04:28AM -0400, Tejun Heo wrote: > Ugh... so this is from NCQ autosense thing. Now ATA devices reports > sense data too which trumps AC_ERR_DEV so libata EH decides to retry > even when the device indicates unrecoverable error. Urgh... we > shouldn't be ta

[PATCH libata/for-4.2-fixes] libata: disable NCQ autosense

2015-08-03 Thread Tejun Heo
>From 8c0fa3e7ca99b0d6d96cb2cf194a912f643da7c5 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Mon, 3 Aug 2015 11:10:45 -0400 fe7173c206de ("libata: Implement support for sense data reporting") and subsequent patches enabled NCQ autosense reporting; unfortunately, this breaks libata EH behavior fo

Re: [PATCH 1/6] libata: Do not retry commands with valid autosense

2015-08-03 Thread Tejun Heo
Hello, On Mon, Aug 03, 2015 at 09:31:57AM +0200, Hannes Reinecke wrote: > The whole point of the autosense feature is that you do _not_ > have to fall back to the original trial-and-error libata EH, > but know exactly what the problem is. Plus any retry will be giving > us (in most cases) exactly

[PATCH] megaraid_sas: fix missing { } braces

2015-08-03 Thread Colin King
From: Colin Ian King Static analysis by smatch indicated that there was a curly braces issue: drivers/scsi/megaraid/megaraid_sas_base.c:6139 megasas_mgmt_fw_ioctl() warn: curly braces intended? Add braces in the appropriate place so that kbuf_arr[i] gets set to NULL only when we need to. Als

[PATCH] [SCSI] bfa: fix missing { } braces

2015-08-03 Thread Colin King
From: Colin Ian King Static analysis by smatch indicated that there was a curly braces issue: drivers/scsi/bfa/bfa_ioc.c:3668 bfa_cb_sfp_state_query() warn: curly braces intended? drivers/scsi/bfa/bfa_ioc.c:3671 bfa_cb_sfp_state_query() warn: inconsistent indenting drivers/scsi/b

Re: blk-mq vs kmemleak

2015-08-03 Thread Christoph Hellwig
On Mon, Aug 03, 2015 at 11:43:09AM +0100, Catalin Marinas wrote: > The simplest would be to add a kmemleak_not_leak() annotation in > scsi_init_request(), though you would hide real leaks (if any). > > A better way could be to inform kmemleak of these pages, something like > below (compile-tested

Re: blk-mq vs kmemleak

2015-08-03 Thread Catalin Marinas
Hi Bart, On Sat, Aug 01, 2015 at 01:37:02AM +0100, Bart Van Assche wrote: > On 07/08/2015 01:17 AM, Christoph Hellwig wrote: > > On Tue, Jul 07, 2015 at 06:59:37AM -0700, Bart Van Assche wrote: > >> Please note that my test was run with CONFIG_SLUB_DEBUG=y which causes a > >> red > >> zone to be

Re: [TRIVIAL PATCH] block: Correct misuses of 0x%

2015-08-03 Thread yalin wang
> On Aug 3, 2015, at 16:03, Joe Perches wrote: > > On Mon, 2015-08-03 at 15:25 +0800, yalin wang wrote: >>> On Aug 3, 2015, at 04:25, Joe Perches wrote: >>> >>> Correct misuse of 0x%d in logging messages. >>> > [] >> why not use like this : dev_dbg(&h->pdev->dev, " Max outstanding >> comma

Re: [TRIVIAL PATCH] block: Correct misuses of 0x%

2015-08-03 Thread Joe Perches
On Mon, 2015-08-03 at 15:25 +0800, yalin wang wrote: > > On Aug 3, 2015, at 04:25, Joe Perches wrote: > > > > Correct misuse of 0x%d in logging messages. > > [] > why not use like this : dev_dbg(&h->pdev->dev, " Max outstanding > commands = %#x\n” ? > %#x will add 0x prefix automatically .

Re: [PATCH 1/6] libata: Do not retry commands with valid autosense

2015-08-03 Thread Hannes Reinecke
On 08/02/2015 05:44 PM, Tejun Heo wrote: > Hello, > > On Fri, Jul 31, 2015 at 03:02:03PM +0200, Hannes Reinecke wrote: >> If a failed command has a valid autosense there is no need to >> retry it on the ATA level; at best we're incurring the same >> error again. So rather not retry it here, but le

Re: [TRIVIAL PATCH] block: Correct misuses of 0x%

2015-08-03 Thread yalin wang
> On Aug 3, 2015, at 04:25, Joe Perches wrote: > > Correct misuse of 0x%d in logging messages. > > Signed-off-by: Joe Perches > --- > drivers/block/DAC960.c | 4 ++-- > drivers/block/cciss.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/block/DAC960.c b/dr

Re: [PATCH 0/6] ZAC host-aware device support

2015-08-03 Thread Hannes Reinecke
On 08/02/2015 06:11 PM, James Bottomley wrote: > On Fri, 2015-07-31 at 15:02 +0200, Hannes Reinecke wrote: >> Hi all, >> >> here is a patchset for adding ZAC host-aware device support to libata. >> Main bits are translations for ZBC IN and ZBC OUT; others are the >> required plumbing like generatin

Re: [TRIVIAL PATCH] block: Correct misuses of 0x%

2015-08-03 Thread Johannes Thumshirn
Joe Perches writes: > Correct misuse of 0x%d in logging messages. > > Signed-off-by: Joe Perches > --- > drivers/block/DAC960.c | 4 ++-- > drivers/block/cciss.c | 2 +- > 2 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c > index