Re: [PATCH 19/22] advansys: Remove comment around cmd_per_lun

2015-04-24 Thread Christoph Hellwig
On Fri, Apr 24, 2015 at 10:32:54AM +0200, Hannes Reinecke wrote: > Ancient, and pretty much obsolete by now. And still doesn't address the fixme. You probably should remove the cmd_per_lun setting entirely. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a

Re: [PATCH 22/22] advansys: Update to version 3.5 and remove compilation warning

2015-04-24 Thread Christoph Hellwig
> config SCSI_ADVANSYS > tristate "AdvanSys SCSI support" > - depends on SCSI && VIRT_TO_BUS && !ARM > + depends on SCSI && !ARM Care to remove the bogus call to dma_cache_sync and allow compiling on arm as well? -- To unsubscribe from this list: send the line "unsubscribe linux-scs

Re: [PATCH 19/23] advansys: Remove cmd_per_lun setting

2015-04-26 Thread Christoph Hellwig
On Sun, Apr 26, 2015 at 04:57:01PM +0200, Ondrej Zary wrote: > This patch breaks my setup: "modprobe advansys" hangs. > > It works when all other patches are applied except this one. Oh damn, looks like the code does have issues in this case. So let's just drop this change for now. Jusr curious

[PATCH v2] virtio_scsi: don't select CONFIG_BLK_DEV_INTEGRITY

2015-04-27 Thread Christoph Hellwig
T10 PI is just another optional feature, LLDDs should work without the infrastructure. Signed-off-by: Christoph Hellwig --- drivers/scsi/Kconfig | 1 - drivers/scsi/virtio_scsi.c | 11 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/Kconfig b

Re: [PATCH 3/3] scsi: proper state checking and module refcount handling in scsi_device_get

2015-04-29 Thread Christoph Hellwig
On Wed, Apr 29, 2015 at 10:17:59AM +0900, Akinobu Mita wrote: > This change broke ufs driver. I'd claim the ufs driver, or rather more specifily the ufs spec had already been broken. That whole concept of keeping references to scsi devices to send commands to for host state changes is just fundam

Re: [PATCH 01/12] scsi_transport_srp: Introduce srp_wait_for_queuecommand()

2015-04-30 Thread Christoph Hellwig
On Thu, Apr 30, 2015 at 10:56:42AM +0200, Bart Van Assche wrote: > Introduce the helper function srp_wait_for_queuecommand(). > Move the definition of scsi_request_fn_active(). This patch > does not change any functionality. A second call to > scsi_wait_for_queuecommand() will be introduced in the

[PATCH 1/9] dm-mpath: check kstrdup return value in parse_hw_handler

2015-04-30 Thread Christoph Hellwig
Signed-off-by: Christoph Hellwig --- drivers/md/dm-mpath.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 6395347..01e5f8e 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -732,6 +732,9 @@ static int parse_hw_handler

[PATCH 2/9] dm-mpath, scsi_dh: don't let dm detach device handlers

2015-04-30 Thread Christoph Hellwig
. Signed-off-by: Christoph Hellwig --- drivers/md/dm-mpath.c | 13 - drivers/scsi/device_handler/scsi_dh.c | 101 +- include/scsi/scsi_device.h| 1 - include/scsi/scsi_dh.h| 5 -- 4 files changed, 27 insertions

[PATCH 4/9] dm-mpath, scsi_dh: request scsi_dh modules in scsi_dh, not dm-mpath

2015-04-30 Thread Christoph Hellwig
This way we can reused the same code any attachment method, not just those requested from dm-mpath. Signed-off-by: Christoph Hellwig --- drivers/md/dm-mpath.c | 7 --- drivers/scsi/device_handler/scsi_dh.c | 35 ++- include/scsi/scsi_dh.h

[PATCH 8/8] scsi_dh: don't allow to detach device handlers at runtime

2015-05-10 Thread Christoph Hellwig
The I/O submission and completion pathes call into the device handler without any synchronization agains detachment. So disallow detaching device handlers at runtime. Signed-off-by: Christoph Hellwig Reviewed-by: Martin K. Petersen Reviewed-by: Hannes Reinecke --- drivers/scsi/scsi_dh.c | 5

Re: [PATCH 7/7] block: allocate block_pc data separate from struct request

2015-05-11 Thread Christoph Hellwig
On Wed, May 06, 2015 at 02:46:18PM +0300, Boaz Harrosh wrote: > > - memset(rq->__cmd, 0, sizeof(rq->__cmd)); > > + > > + rq->block_pc = kzalloc(sizeof(*rq->block_pc) + cmd_len, gfp); > > I wish you would not embed a dynamic allocation here for any > driver regardless. This extra allocation doe

Re: [PATCH 03/12] target/configfs: Convert mappedlun + SCSI MIBs to RCU reader

2015-05-12 Thread Christoph Hellwig
On Tue, May 12, 2015 at 10:09:23PM -0700, Nicholas A. Bellinger wrote: > > Why do we still need TRANSPORT_LUNFLAGS_INITIATOR_ACCESS? Isn't deve > > being not-NULL enough? > > > > Yep, I think this can go as well. Dropping now. Also might be worth to add a helper that has the ->se_lun_acl check

Re: [PATCH 01/12] target: Convert se_node_acl->device_list[] to RCU hlist

2015-05-18 Thread Christoph Hellwig
On Mon, May 18, 2015 at 11:05:47PM -0700, Nicholas A. Bellinger wrote: > > [ 12.830576] kernel BUG at ../drivers/target/target_core_device.c:337! > > > > How did you hit this..? tcm_node --block iblock_0/array /dev/sda line=$(tcm_loop --createnexus=0) wwn=$(echo $line | awk '{print $15}') tcm

Re: [PATCH 09/12] target: Convert se_portal_group->tpg_lun_list[] to RCU hlist

2015-05-18 Thread Christoph Hellwig
On Tue, May 12, 2015 at 09:25:33AM +, Nicholas A. Bellinger wrote: > From: Nicholas Bellinger > > This patch converts the fixed size se_portal_group->tpg_lun_list[] > to use modern RCU with hlist_head in order to support an arbitary > number of se_lun ports per target endpoint. > > It includ

Re: [PATCH 01/12] target: Convert se_node_acl->device_list[] to RCU hlist

2015-05-21 Thread Christoph Hellwig
On Tue, May 19, 2015 at 08:22:31AM +0200, Christoph Hellwig wrote: > On Mon, May 18, 2015 at 11:05:47PM -0700, Nicholas A. Bellinger wrote: > > > [ 12.830576] kernel BUG at ../drivers/target/target_core_device.c:337! > > > > > > > How did you hit this..? >

Re: [PATCH-v2 0/9] target: se_node_acl + se_lun RCU conversions

2015-05-22 Thread Christoph Hellwig
Can you put up a git branch with these? Without that or a known good baseline it's hard to test, or even to do a deep review. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.or

Re: [PATCH-v2 1/9] target: Convert se_node_acl->device_list[] to RCU hlist

2015-05-22 Thread Christoph Hellwig
> - spin_lock_irqsave(&se_sess->se_node_acl->device_list_lock, flags); > - se_cmd->se_deve = se_sess->se_node_acl->device_list[unpacked_lun]; > - if (se_cmd->se_deve->lun_flags & TRANSPORT_LUNFLAGS_INITIATOR_ACCESS) { > - struct se_dev_entry *deve = se_cmd->se_deve; > - > +

Re: [PATCH-v2 2/9] target/pr: Use atomic bitop for se_dev_entry->pr_reg reservation check

2015-05-22 Thread Christoph Hellwig
On Fri, May 22, 2015 at 06:11:04AM +, Nicholas A. Bellinger wrote: > + clear_bit(1, &orig->pr_reg); Can you call it ->flags and give the bit a meaningful name? > diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c > index c0b593a..d29b39c 100644 > --- a/drivers/

Re: [PATCH-v2 4/9] target/pr: cleanup core_scsi3_pr_seq_non_holder

2015-05-22 Thread Christoph Hellwig
Oh, you've actually go it - still would make sense to move it the beginning of the series. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH-v2 5/9] target: Convert se_portal_group->tpg_lun_list[] to RCU hlist

2015-05-22 Thread Christoph Hellwig
> This patch converts the fixed size se_portal_group->tpg_lun_list[] > to use modern RCU with hlist_head in order to support an arbitary > number of se_lun ports per target endpoint. > > It includes dropping core_tpg_alloc_lun() from core_dev_add_lun(), > and calling it directly from target_fabric

Re: [PATCH-v2 1/9] target: Convert se_node_acl->device_list[] to RCU hlist

2015-05-22 Thread Christoph Hellwig
On Fri, May 22, 2015 at 01:55:30AM -0700, Nicholas A. Bellinger wrote: > > This update will now be racy, ditto for the read/write_bytes update > > later. > > This should become an atomic_long_t increment, yes..? Yes. > Yes, this helper is from your patch above. > > Considering there is a single

Re: [PATCH-v2 2/9] target/pr: Use atomic bitop for se_dev_entry->pr_reg reservation check

2015-05-22 Thread Christoph Hellwig
On Fri, May 22, 2015 at 02:05:57AM -0700, Nicholas A. Bellinger wrote: > On Fri, 2015-05-22 at 10:26 +0200, Christoph Hellwig wrote: > > On Fri, May 22, 2015 at 06:11:04AM +, Nicholas A. Bellinger wrote: > > > + clear_bit(1, &orig->pr_reg); > > > > Can y

Re: [PATCH-v2 2/9] target/pr: Use atomic bitop for se_dev_entry->pr_reg reservation check

2015-05-22 Thread Christoph Hellwig
> > -/* > - * this function can be called with struct se_device->dev_reservation_lock > - * when register_move = 1 > - */ > static void __core_scsi3_add_registration( > struct se_device *dev, > struct se_node_acl *nacl, > @@ -1023,6 +1021,7 @@ static void __core_scsi3_add_registratio

Re: [PATCH 2/4] target: Drop lun_sep_lock for se_lun->lun_se_dev RCU usage

2015-05-22 Thread Christoph Hellwig
> @@ -683,7 +679,7 @@ void core_tpg_remove_lun( > dev->export_count--; > spin_unlock(&dev->se_port_lock); > > - lun->lun_se_dev = NULL; > + rcu_assign_pointer(lun->lun_se_dev, NULL); > } What guarantees that the se_device stays around for

Re: [RFC 0/2] target: Add TFO->complete_irq queue_work bypass

2015-06-03 Thread Christoph Hellwig
This makes lockdep very unhappy, rightly so. If you execute one end_io function inside another you basŃ–cally nest every possible lock taken in the I/O completion path. Also adding more work to the hardirq path generally isn't a smart idea. Can you explain what issues you were seeing and how much

Re: [RFC 0/2] target: Add TFO->complete_irq queue_work bypass

2015-06-09 Thread Christoph Hellwig
On Thu, Jun 04, 2015 at 12:06:09AM -0700, Nicholas A. Bellinger wrote: > So I've been using tcm_loop + RAMDISK backends for prototyping, but this > patch is intended for vhost-scsi so it can avoid the unnecessary > queue_work() context switch within target_complete_cmd() for all backend > driver ty

Re: Merging mpt2sas/mpt3sas code base

2015-06-09 Thread Christoph Hellwig
Hi Sathya, please start your effort per your plans. I don't think we'll need separate binaries as we should be fine with a MODULE_ALIAS and registering two misc devices. But compared to the overall effort that's a fairly minor descision which we can revisit while going ahead. Keeping the user i

Re: [RFC 1/2] target: Add support for fabric IRQ completion

2015-06-09 Thread Christoph Hellwig
> diff --git a/drivers/target/target_core_tpg.c > b/drivers/target/target_core_tpg.c > index 3fbb0d4..aa08d6b 100644 > --- a/drivers/target/target_core_tpg.c > +++ b/drivers/target/target_core_tpg.c > @@ -37,6 +37,7 @@ > > #include > #include > +#include > #include > > #include "target

Re: [PATCH 1/1] [PATCH] block: Add blk_max_rw_sectors limit

2015-06-17 Thread Christoph Hellwig
On Tue, Jun 16, 2015 at 06:46:14PM -0400, Martin K. Petersen wrote: > > Brian, > > I only have minor nits wrt. your patch since you did what I asked. > However, now that I'm less jet lagged and blurry eyed I wonder if > the tweak below wouldn't suffice? This would be my preferred version as well

Re: [PATCH 0/8] tcm_loop updates

2015-06-18 Thread Christoph Hellwig
What's the benefit of the SAS transport class writeout? I honestly always saw tcm_loop as a simple loopback driver, with the different transport IDs in the PR code as a gimmick. Note that vhost and xen-blkback copies that style and I did plan to consolidate it in common code. -- To unsubscribe fr

Re: [PATCH 7/8] target_core_alua: disallow READ_CAPACITY when in standby

2015-06-18 Thread Christoph Hellwig
On Thu, Jun 18, 2015 at 11:43:41AM +0200, Hannes Reinecke wrote: > Strictly speaking SPC doesn't require READ CAPACITY and friends > to be supported while in the port is in standby. But it does allow it. We should always aim to implement the best possible behavior instead of aiming for the worst.

Re: [PATCH 8/8] target: display 'write_protect' attribute for demo-mode LUNs

2015-06-18 Thread Christoph Hellwig
On Thu, Jun 18, 2015 at 11:43:42AM +0200, Hannes Reinecke wrote: > When LUNs are mapped with a demo-mode initiator we're missing > the 'write_protect' attribute to set a LUN read-only. I don't think it's a good idea as-is. The target core clearly differenciates between demo mode and production mo

Re: Merging se_dev_entry and se_lun?

2015-06-18 Thread Christoph Hellwig
On Fri, Jun 19, 2015 at 08:40:23AM +0200, Hannes Reinecke wrote: > Having a list here implies that 'se_lun' can have _several_ > se_dev_entry structure attached to it, which I found rather curious. > > Can you give me an example where this might be the case? > Or can we replace the list with a sim

Re: [PATCH resend] mpt2sas: setpci reset kernel panic fix

2015-06-19 Thread Christoph Hellwig
> @@ -79,7 +79,8 @@ static int _scsih_scan_finished(struct Scsi_Host *shost, > unsigned long time); > > /* global parameters */ > LIST_HEAD(mpt2sas_ioc_list); > - > +/* global ioc lock for list operations */ > +spinlock_t gioc_lock; > /* local parameters */ > static u8 scsi_io_cb_idx = -1; >

Re: [PATCH 4/6] target: Send UA on ALUA target port group change

2015-06-19 Thread Christoph Hellwig
> --- a/drivers/target/target_core_alua.c > +++ b/drivers/target/target_core_alua.c > @@ -1880,12 +1880,19 @@ static void core_alua_put_tg_pt_gp_from_name( > static void __target_attach_tg_pt_gp(struct se_lun *lun, > struct t10_alua_tg_pt_gp *tg_pt_gp) > { > + struct se_dev_entr

Re: [PATCH 5/6] target: Send UA upon LUN RESET tmr completion

2015-06-19 Thread Christoph Hellwig
On Thu, Jun 11, 2015 at 10:01:28AM +0200, Hannes Reinecke wrote: > SAM mandates that an BUS DEVICE RESET FUNCTION OCCURRED > UA needs to be send after a LUN RESET tmr has completed. > > Signed-off-by: Hannes Reinecke > --- > drivers/target/target_core_transport.c | 11 +++ > 1 file chang

Re: [PATCH 6/6] target: Send UA when changing LUN inventory

2015-06-19 Thread Christoph Hellwig
> + hlist_for_each_entry_rcu(tmp, &nacl->lun_entry_hlist, link) { > + if (tmp == new) > + continue; > + core_scsi3_ua_allocate(tmp, 0x3F, > + ASCQ_3FH_REPORTED_LUNS_DATA_HAS_CHANGED); > +

Re: [PATCH 4/6] target: Send UA on ALUA target port group change

2015-06-19 Thread Christoph Hellwig
On Fri, Jun 19, 2015 at 03:09:34PM +0200, Hannes Reinecke wrote: > This harks back to my previous mail: > Under which circumstances will there be more than one se_dev_entry > structures in lun_deve_list? > Isn't there a 1:1 relationship? No. See my answer to your previous mail. -- To unsubscribe

Re: integrate scsi_dh better into the scsi core V2

2015-06-19 Thread Christoph Hellwig
Feel free to take over the series as your ALUA changes rely on it. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in

Re: Merging se_dev_entry and se_lun?

2015-06-19 Thread Christoph Hellwig
On Fri, Jun 19, 2015 at 03:21:27PM +0200, Hannes Reinecke wrote: > > Each initiator has it's own dev entry. > > > But isn't 'se_lun' per initiator, too? No. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in

Re: [PATCH] sd: Fix maximum I/O size for BLOCK_PC requests

2015-06-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/1] we added changes in fnic driver patch 1.6.0.16 to acquire io_req_lock in fnic_queuecommand() before issuing I/O so that io completion is serialized. But when releasing the lock we chec

2015-07-03 Thread Christoph Hellwig
Please use a descriptive one line Subject line and put the rest of your changelog into the message body. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 1/6] Add refcount to sas_device struct

2015-07-03 Thread Christoph Hellwig
On Mon, Jun 08, 2015 at 08:50:51PM -0700, Calvin Owens wrote: > These objects can be referenced concurrently throughout the driver, we > need a way to make sure threads can't delete them out from under each > other. > > Signed-off-by: Calvin Owens Thsi doesn't make sense without users of the ref

Re: [PATCH 2/6] Refactor code to use new sas_device refcount

2015-07-03 Thread Christoph Hellwig
> > +struct _sas_device * > +mpt2sas_scsih_sas_device_get_by_sas_address_nolock(struct MPT2SAS_ADAPTER > *ioc, > +u64 sas_address) Any chance to use a shorter name for this function? E.g. __mpt2sas_get_sdev_by_addr ? > +{ > + struct _sas_device *sas_device; > + > + BUG_ON(!spin_is_

Re: [PATCH 4/6] Add refcount to fw_event_work struct

2015-07-03 Thread Christoph Hellwig
On Mon, Jun 08, 2015 at 08:50:54PM -0700, Calvin Owens wrote: > The fw_event_work struct is concurrently referenced at shutdown, so > add a refcount to protect it. Same comment here - a refcount that isn't used isn't useful, please fold into the next patch. -- To unsubscribe from this list: send

Re: [PATCH 5/6] Refactor code to use new fw_event refcount

2015-07-03 Thread Christoph Hellwig
On Mon, Jun 08, 2015 at 08:50:55PM -0700, Calvin Owens wrote: > This refactors the fw_event code to use the new refcount. I spent some time looking over this code because it's so convoluted. In general I think code should either embeed one work_struct (and it really doesn't seem to need a delayed

Re: [PATCH 6/6] Fix unsafe fw_event_list usage

2015-07-03 Thread Christoph Hellwig
On Mon, Jun 08, 2015 at 08:50:56PM -0700, Calvin Owens wrote: > Since the fw_event deletes itself from the list, cleanup_queue() can > walk onto garbage pointers or walk off into freed memory. > > This refactors the code in _scsih_fw_event_cleanup_queue() to not > iterate over the fw_event_list wi

Re: [PATCH 3/6] Fix unsafe sas_device_list usage

2015-07-03 Thread Christoph Hellwig
On Mon, Jun 08, 2015 at 08:50:53PM -0700, Calvin Owens wrote: > We cannot iterate over the list without holding a lock for the entire > duration, or we risk corrupting random memory if items are added or > deleted as we iterate. > > This refactors code such that it always holds the lock when itera

Re: [PATCH] virtio scsi: fix unused variable warning

2015-07-03 Thread Christoph Hellwig
rot; >^ > > Signed-off-by: Stephen Rothwell Thanks, this looks good: Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH RFC] target: Use scsi helpers to build the sense data correctly

2015-07-03 Thread Christoph Hellwig
On Mon, Jun 29, 2015 at 06:05:25PM +0300, Sagi Grimberg wrote: > Instead of open coding the sense buffer construction, use > scsi scsi_build_sense_buffer() and scsi_set_sense_information() > helpers. > > This patch also fixes wrong setting of descriptor format sense data > for t10-pi integrity err

Re: [PATCH 09/11] qla2xxx: Added interface to send ELS commands from driver.

2015-07-03 Thread Christoph Hellwig
Why is this a binary attribute? Needs an interface specific in Documentation/ABI/ to start with, and a Ccto stable seems very aggressive. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://v

Re: [PATCHv1] mpt2sas: setpci reset kernel oops fix

2015-07-03 Thread Christoph Hellwig
On Thu, Jun 25, 2015 at 04:24:22PM +0530, Nagarajkumar Narayanan wrote: > This patch contains the fix for kernel oops on issuing setpci reset > along with sysfs, cli access > > spinlock initialization modified to DEFINE_SPINLOCK as per the > comments for previous version of the patch Why is the p

Re: [PATCH] scsi: storvsc: make INQUIRY response SPC-compliant

2015-07-03 Thread Christoph Hellwig
On Wed, Jul 01, 2015 at 11:04:08AM +0200, Vitaly Kuznetsov wrote: > SPC-2/3/4 specs state that "The standard INQUIRY data (see table ...) > shall contain at least 36 bytes". Hyper-V host doesn't always honor this > requirement, e.g. when there is no physical device present at a particular > LUN hos

Re: [PATCH v2 1/3] target: Inline transport_get_sense_codes()

2015-07-06 Thread Christoph Hellwig
ks good, Reviewed-by: Christoph Hellwig Sagi: if you send on Barts patches you probably should add your signoff as well. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v2 2/3] target: Split transport_send_check_condition_and_sense()

2015-07-06 Thread Christoph Hellwig
> +static void translate_sense_reason(struct se_cmd *cmd, int r) > +{ Can you please pass the sense_reason_t argument to this function and do all the __force int casting inside this function? -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majo

Re: [PATCH v2 3/3] target: Use scsi helpers to build the sense data correctly

2015-07-06 Thread Christoph Hellwig
On Mon, Jul 06, 2015 at 11:02:27AM +0300, Sagi Grimberg wrote: > Instead of open coding the sense buffer construction, use > scsi scsi_build_sense_buffer() and scsi_set_sense_information() > helpers which moved to scsi_common. > > This patch also fixes wrong setting of descriptor format sense data

Re: [PATCH v1 Resend] mpt2sas: setpci reset kernel oops fix

2015-07-08 Thread Christoph Hellwig
On Wed, Jul 08, 2015 at 11:17:47AM +0530, Nagarajkumar Narayanan wrote: > Note: pci_access_mutex is used only if nytro warpdrive cards > (ioc->is_warpdrive based on device id) are used > as we could not test this case with other SAS2 HBA cards > We can remove this check if this behaviour confirme

Re: blk-mq vs kmemleak

2015-07-08 Thread Christoph Hellwig
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 allocated before and after each block of allocated memory. Could > that explain the kmalloc-96 objects ? 96 is almost guaranteed to be the se

Re: [PATCH v3 2/5] target: Split transport_send_check_condition_and_sense()

2015-07-08 Thread Christoph Hellwig
> + if (r == (__force int)TCM_CHECK_CONDITION_UNIT_ATTENTION) { You probably want to compare reason here to avoid the cast. Otherwise looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a mess

Re: [PATCH v3 3/5] scsi: Move sense handling routines to scsi_common

2015-07-08 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v3 4/5] target: Use scsi helpers to build the sense data correctly

2015-07-08 Thread Christoph Hellwig
udes should be fixed up the same way, but that's a different story). Otherwise looks good: Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH v3 5/5] target: Fix wrong setting of sense format for PI errors

2015-07-08 Thread Christoph Hellwig
On Mon, Jul 06, 2015 at 04:15:08PM +0300, Sagi Grimberg wrote: > PI errors should be reported in a descriptor format sense data. > Fix that by adding a desc_format flag to struct sense_info and pass > it to scsi_build_sense_buffer() to do the right thing. Do we really need the additional flag? We

Re: [PATCH v3 5/5] target: Fix wrong setting of sense format for PI errors

2015-07-08 Thread Christoph Hellwig
On Wed, Jul 08, 2015 at 01:36:04PM +0300, Sagi Grimberg wrote: > We don't have any other information today, but sector is not the only > information that is requires a descriptor format, so maybe it will be a > bit awkward to condition the descriptor format on the sector info? The only reason why

Re: [PATCH v3 5/5] target: Fix wrong setting of sense format for PI errors

2015-07-08 Thread Christoph Hellwig
On Wed, Jul 08, 2015 at 12:59:18PM +0200, Hannes Reinecke wrote: > Actually it's controlled by the D_SENSE bit in the Control mode page > (that's bit[2] of byte 2 in the control mode page). > Which is currently set to '0', ie we will be returning fixed sense > information. > _If_ we were to report

Re: [PATCH 3/5] scsi: Add 'access_state' attribute

2015-07-09 Thread Christoph Hellwig
On Wed, Jul 08, 2015 at 01:09:46PM +0200, Hannes Reinecke wrote: > Add an 'access_state' attribute to display the LUN access state. Should we just reuse the ALUA values here as they part of the spec and map the legacy implemetation values to it? I'd also really love to store the access_state vari

Re: [PATCH 10/10] scsi_dh: move 'dh_state' sysfs attribute to generic code

2015-07-09 Thread Christoph Hellwig
On Wed, Jul 08, 2015 at 11:07:05AM +0200, Hannes Reinecke wrote: > As scsi_dh.c is now always compiled in we should be moving > the 'dh_state' attribute to the generic code. > > Signed-off-by: Hannes Reinecke Looks fine, but a few coding style nitpicks: > + if (!sdev->handler) { > +

Re: [PATCH] scsi: Fix sense information setting in fixed sized format

2015-07-11 Thread Christoph Hellwig
On Wed, Jul 08, 2015 at 06:00:03PM +0300, Sagi Grimberg wrote: > In fixed size sense format the information field is a four byte > field. This looks correct to me, Reviewed-by: Christoph Hellwig But: this will truncate > 32bit sector numbers. Maybe we need to enable descriptor for

Re: [PATCH 1/2] mpt2sas: Refcount sas_device objects and fix unsafe list usage

2015-07-12 Thread Christoph Hellwig
; > Additionally, we cannot iterate over the sas_device_list without > holding the lock, or we risk corrupting random memory if items are > added or deleted as we iterate. This patch refactors _scsih_probe_sas() > to use the sas_device_list in a safe way. > > Cc: Christoph Hellw

Re: [PATCH 2/2] mpt2sas: Refcount fw_events and fix unsafe list usage

2015-07-12 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] fix host max depth checking for the 'queue_depth' sysfs interface

2015-07-14 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig I wonder if we should start to gradually phase out these tuables in the host template. It's not really more complicated to set them directly in the host anyway. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" i

Re: [PATCH 3/3] target: Return descriptor format sense data

2015-07-14 Thread Christoph Hellwig
On Sun, Jul 12, 2015 at 01:37:03PM +0300, Sagi Grimberg wrote: > Fixed size sense data information field is only 32 bits which > means the sector (64 bits) information will be truncated. > > Move to descriptor format sense data to correctly report full > sector information. I think this needs to

Re: [PATCH 3/3] target: Return descriptor format sense data

2015-07-14 Thread Christoph Hellwig
On Tue, Jul 14, 2015 at 02:59:51PM +0300, Sagi Grimberg wrote: > diff --git a/include/target/target_core_backend.h > b/include/target/target_core_backend.h > index 1e5c8f9..6ce370f 100644 > --- a/include/target/target_core_backend.h > +++ b/include/target/target_core_backend.h > @@ -3,6 +3,9 @@ >

Re: [PATCH v1 1/4] scsi: Fix wrong additional sense length in descriptor format

2015-07-15 Thread Christoph Hellwig
; > Signed-off-by: Sagi Grimberg > Reviewed-by: Hannes Reinecke > Reviewed-by: Martin K. Petersen Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kerne

Re: [PATCH v1 2/4] scsi: Protect against buffer possible overflow in scsi_set_sense_information

2015-07-15 Thread Christoph Hellwig
i target and libata. > > Reported-by: Hannes Reinecke > Signed-off-by: Sagi Grimberg > Reviewed-by: Martin K. Petersen > Cc: Tejun Heo Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a

Re: [PATCH v1 3/4] target: Return descriptor format sense data in case the LU spans 64bit sectors

2015-07-15 Thread Christoph Hellwig
ense data to > correctly report sector information. > > Reported-by: Christoph Hellwig > Signed-off-by: Sagi Grimberg Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kerne

Re: [PATCH v1 4/4] libiscsi: Use scsi helper to set information descriptor

2015-07-15 Thread Christoph Hellwig
On Wed, Jul 15, 2015 at 10:55:39AM +0300, Sagi Grimberg wrote: > In case encountered a PI error, use scsi_set_sense_information > instead of open coding information descriptor format. > > Signed-off-by: Sagi Grimberg Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe fr

Re: [PATCH] dm-mpath: always return reservation conflict

2015-07-15 Thread Christoph Hellwig
An array can't issue a reservation, the initiator needs to register it. Right now the only way to do it is through SG_IO passthrough, which is a best luck effort it I/O isn't also using SG_IO and can't be properly supported because of that. However I will submit an in-kernel reservation API soon

Re: [dm-devel] [PATCH] dm-mpath: always return reservation conflict

2015-07-16 Thread Christoph Hellwig
On Thu, Jul 16, 2015 at 05:07:03AM +, Christophe Varoqui wrote: > For reference the opensvc crm does use type 5 pr, and aims for all paths > registered. It still does not make use of the multipathd pr janitoring > features, and uses sg_persist directly for pr status and actions. The type doesn

Re: [PATCH 1/2] target: remove unused lun_flags field from se_lun

2015-07-21 Thread Christoph Hellwig
Looks good, but what's up with your From lines: On Mon, Jul 20, 2015 at 04:29:49PM -0700, Spencer Baugh wrote: > From: Spencer Baugh > > From: Chris Zankel plus another address for you in the actual email From line. Who did actually write this patch? -- To unsubscribe from this list: send th

Re: [PATCH 2/2] target: remove initiatorname field in se_acl_lun

2015-07-21 Thread Christoph Hellwig
Looks good too, but same From: issue as the last patch. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] scsi: fix memory leak with scsi-mq

2015-07-21 Thread Christoph Hellwig
Thanks Tony, this looks good to me. In the long run I'll see how we can hide these implementation details in the lib/scatterlist.c code instead of burdening it on the users. Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" i

Re: [PATCH] target: add support for START_STOP_UNIT SCSI opcode

2015-07-23 Thread Christoph Hellwig
NVALID_CDB_FIELD; The mix of || and | here is odd, why not just: if (!(cdb[1] & 1) || cdb[2] || cdb[3]) > + if (!(cdb[4] & 1) || ((cdb[4] & 2) | (cdb[4] & 4))) Same here. But except for this nitpicking the patch looks good: Reviewed-by: Christoph Hellwig -- To unsu

Re: [PATCH] target: improve unsupported opcode message

2015-07-23 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] target: respond to unknown initiators with sensible REPORT LUNS list length

2015-07-23 Thread Christoph Hellwig
On Wed, Jul 22, 2015 at 03:08:17PM -0700, Spencer Baugh wrote: > done: > + /* > + * If no real LUNs are accessible, report an allocation length > + * of 1 LUN to account for virtual LUN 0. > + */ > + if (lun_count == 0) > + lun_count = 1; > + Shouldn't the code

Re: [PATCH] target: allow underflow/overflow for PR OUT etc. commands

2015-07-23 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig (altough normal Linux style would be to add parenthesis around the logial and) -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.

Re: [PATCH] qla2xxx: Return the fabric command state for non-task management requests

2015-07-23 Thread Christoph Hellwig
On Tue, Jul 21, 2015 at 03:07:55PM -0700, Spencer Baugh wrote: > From: Dilip Kumar Uppugandla > > Invoking get_cmd_state for qla2xxx always returns 0. Instead change it > to return the actual fabric state from qla_tgt_cmd. This will help with > debugging. I think the ->get_cmd_state callback sho

Re: [PATCH] target: fix crash in cmd tracing when cmd didn't match a LUN

2015-07-24 Thread Christoph Hellwig
On Thu, Jul 23, 2015 at 03:19:32PM -0700, Spencer Baugh wrote: > From: Alexei Potashnik > > If command didn't match a LUN and we're sending check condition, the > target_cmd_complete ftrace point will crash because it assumes that > cmd->t_task_cdb has been set. > > The fix will temporarily set

Re: [PATCH 1/5] scsi: rescan VPD attributes

2015-07-24 Thread Christoph Hellwig
On Wed, Jul 08, 2015 at 01:09:44PM +0200, Hannes Reinecke wrote: > +++ b/drivers/scsi/device_handler/scsi_dh_alua.c > @@ -264,8 +264,11 @@ static int alua_check_vpd(struct scsi_device *sdev, > struct alua_dh_data *h) > int device_id_size, device_id_type = 0; > struct alua_port_group *t

Re: [PATCH 1/5] scsi: rescan VPD attributes

2015-07-24 Thread Christoph Hellwig
On Fri, Jul 24, 2015 at 04:40:42PM +0200, Hannes Reinecke wrote: > Yeah, possibly. After all, the variable isn't expected to change > under rcu_read_lock(). Actually it can and will change, that's the point. But if you use a local variable you keep a single version of it, which won't be freed unt

Re: [PATCH 4/5] scsi_dh_alua: add 'state' callback function

2015-07-24 Thread Christoph Hellwig
As per the comment on patch 3 I'd rather expose the ALUA state in the core SCSI code. But having this alua_state attribute in core SCSI code sounds fine to me. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majord

Re: [PATCH 04/20] scsi_dh_alua: Improve error handling

2015-07-24 Thread Christoph Hellwig
This seems to be a bit of a catchall. Can you split the logging changes from actual error code logic changes and describe the latter in more detail? -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH 07/20] scsi_dh_alua: Pass buffer as function argument

2015-07-24 Thread Christoph Hellwig
mp;rq->cmd[6]); This is unrelated to the rest of the patch, can you split it out, maybe together with other get/put_unaligned conversions? Otherwise looks good: Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a mes

Re: [PATCH 08/20] scsi_dh_alua: Make stpg synchronous

2015-07-24 Thread Christoph Hellwig
> - memset(h->buff, 0, stpg_len); > - h->buff[4] = TPGS_STATE_OPTIMIZED & 0x0f; > - h->buff[6] = (h->group_id >> 8) & 0xff; > - h->buff[7] = h->group_id & 0xff; > + memset(stpg_data, 0, stpg_len); > + stpg_data[4] = TPGS_STATE_OPTIMIZED & 0x0f; > + put_unaligned_be16(gro

Re: [PATCH 09/20] scsi_dh_alua: switch to scsi_execute()

2015-07-24 Thread Christoph Hellwig
Seems like this should use scsi_execute_req_flags instead so that it doesn't have to deal with the raw sense buffer. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordom

Re: [PATCH 11/20] scsi_dh_alua: Use separate alua_port_group structure

2015-07-24 Thread Christoph Hellwig
On Wed, Jul 08, 2015 at 11:06:09AM +0200, Hannes Reinecke wrote: > + pg = kzalloc(sizeof(struct alua_port_group), GFP_KERNEL); > + if (!pg) { > + sdev_printk(KERN_WARNING, sdev, > + "%s: kzalloc port group failed\n", > + ALUA_DH_NA

Re: [PATCH 12/20] scsi_dh_alua: allocate RTPG buffer separately

2015-07-24 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 13/20] scsi_dh_alua: simplify sense code handling

2015-07-24 Thread Christoph Hellwig
0x0a) > + err = SCSI_DH_RETRY; > + if (sense_hdr.sense_key == UNIT_ATTENTION) else if or just but cases in the same condition for clarity? Otherwise looks fine: Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe l

Re: [PATCH 14/20] scsi_dh_alua: parse target device id

2015-07-24 Thread Christoph Hellwig
On Wed, Jul 08, 2015 at 11:06:12AM +0200, Hannes Reinecke wrote: > Parse VPD descriptor to figure out the device identification. > As devices might implement several descriptors the order > of preference is: > - NAA IEE Registered Extended > - EUI-64 based 16-byte > - EUI-64 based 12-byte > - NAA I

Re: [PATCH 16/20] scsi_dh_alua: Use workqueue for RTPG

2015-07-24 Thread Christoph Hellwig
> + charwork_q_name[264]; create_workqueue and friends now accept printf-like format string, so there is no need for this temporary buffer. > + int error; > + struct completion init_complete; Please rename error to init_error and only ass

Re: [PATCH] qla2xxx: Return the fabric command state for non-task management requests

2015-07-24 Thread Christoph Hellwig
Which debug printk do you care about? I'd much prefer having a trace point inside the driver which could even pretty print it instead of the hack where a driver defined binary value is printed by the core. -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a me

  1   2   3   4   5   6   7   8   9   10   >