[PATCHv2 RESEND 4/9] target: core_tpg_post_dellun can return void

2014-03-24 Thread Andy Grover
Nothing in it can raise an error. Signed-off-by: Andy Grover --- drivers/target/target_core_internal.h | 2 +- drivers/target/target_core_tpg.c | 5 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/target/target_core_internal.h b/drivers/target/target_core_inter

[PATCHv2 RESEND 0/9] target: Save memory on unused se_dev_entrys and se_luns

2014-03-24 Thread Andy Grover
Hi nab, hch, and all, This patchset reduces the amount of memory for se_dev_entry and se_lun arrays by waiting to allocate array members, and includes some related simplification patches too. This is a rework of a few patches I submitted in December in a larger series, but keeping it simple by sti

[PATCHv2 RESEND 8/9] target: Remove core_tpg_release_virtual_lun0 function

2014-03-24 Thread Andy Grover
Simple and just called from one place. Signed-off-by: Andy Grover --- drivers/target/target_core_tpg.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index a63a3d7..bc0299a 100644 --- a/drivers/targe

[PATCHv2 RESEND 5/9] target: Change core_dev_del_lun to take a se_lun instead of unpacked_lun

2014-03-24 Thread Andy Grover
Remove core_tpg_pre_dellun entirely, since we don't need to get/check a pointer we already have. Nothing else can return an error, so core_dev_del_lun can return void. Signed-off-by: Andy Grover --- drivers/target/target_core_device.c | 18 +--- drivers/target/target_core_f

[PATCHv2 RESEND 1/9] target: Add locking to some accesses to nacl.device_list

2014-03-24 Thread Andy Grover
Make sure all accesses of deve elements in device_list are protected. This will become critically important once device_list entries are potentially NULL. Reported-by: Christoph Hellwig Signed-off-by: Andy Grover --- drivers/target/target_core_device.c | 7 ++--- drivers/target/target

[PATCHv2 RESEND 2/9] target: Don't unlock/relock tpg_lun_lock in loop in add_node_to_devs

2014-03-24 Thread Andy Grover
It's not safe to unlock/relock in core_tpg_add_node_to_devs. Remove this. As a consequence, core_enable_device_list_for_node needs to be called with a lock held & irqs off. Add a comment mentioning this. Change spin_lock_irqs to spin_locks. Change error handling to goto-style. Also change the oth

[PATCHv2 RESEND 7/9] target: Allocate se_luns only when used

2014-03-24 Thread Andy Grover
Instead of allocating the tpg_lun_list and each member of the list when the tpg is created, make the list part of the parent struct, and use an element being non-NULL to indicate an active LUN. This will save memory if less than all the se_luns are actually configured. Now that things are actually

[PATCHv2 RESEND 9/9] target: Refactor core_enable_device_list_for_node

2014-03-24 Thread Andy Grover
Create helper functions to alloc a deve and to transition it from demo mode to explicit. Signed-off-by: Andy Grover --- drivers/target/target_core_device.c | 121 ++-- 1 file changed, 74 insertions(+), 47 deletions(-) diff --git a/drivers/target/target_core_devic

[PATCHv2 RESEND 6/9] target: Rename core_tpg_post_dellun to remove_lun

2014-03-24 Thread Andy Grover
A clearer name, now that pre_dellun is gone. Signed-off-by: Andy Grover --- drivers/target/target_core_device.c | 2 +- drivers/target/target_core_internal.h | 2 +- drivers/target/target_core_tpg.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/target/ta

[PATCHv2 RESEND 3/9] target: Allocate se_dev_entrys in device list only when used

2014-03-24 Thread Andy Grover
Remove TRANSPORT_LUNFLAGS_INITIATOR_ACCESS and just look at if a non-NULL value is in the node_acl->device_list for the given lun. Since usually nowhere near all se_dev_entrys are used, this nets a sizable reduction in memory use. In core_disable_device_list_for_node, move all calls to functions r

[PATCH trivial 1/3] megaraid_sas: Spelling s/intance/instance/

2014-03-24 Thread Geert Uytterhoeven
From: Geert Uytterhoeven Signed-off-by: Geert Uytterhoeven Cc: Neela Syam Kolli Cc: linux-scsi@vger.kernel.org --- drivers/scsi/megaraid/megaraid_sas_base.c |2 +- drivers/scsi/megaraid/megaraid_sas_fusion.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/driver

Re: please fix FUSION (Was: [v3.13][v3.14][Regression]kthread:makekthread_create()killable)

2014-03-24 Thread Oleg Nesterov
On 03/22, James Bottomley wrote: > > OK, the fix from the SCSI point of view is to make the mpt teardown path > actually work. The whole thing looks to be a complete mess because > there's another place where it will do the wrong thing in > mptscsih_remove(). You always have to call mpt_detach()

[PATCH 6/6] blk-integrity: refactor various routines

2014-03-24 Thread Darrick J. Wong
Refactor blk-integrity.c to avoid duplicating similar functions, and remove all users of pi_buf, since it's really only there to handle the (common) case where the kernel auto-generates all the PI data. Signed-off-by: Darrick J. Wong --- fs/bio-integrity.c | 120 +--

[PATCH 5/6] PI IO extension: advertise possible userspace flags

2014-03-24 Thread Darrick J. Wong
Expose possible userland flags to the new PI IO extension so that userspace can discover what flags exist. Signed-off-by: Darrick J. Wong --- Documentation/ABI/testing/sysfs-block | 14 ++ Documentation/block/data-integrity.txt | 22 + block/blk-integrity.c

[PATCH 1/6] fs/bio-integrity: remove duplicate code

2014-03-24 Thread Darrick J. Wong
Frøm: Gu Zheng Most code of function bio_integrity_verify and bio_integrity_generate is the same, so introduce a help function bio_integrity_generate_verify() to remove the duplicate code. Signed-off-by: Gu Zheng --- fs/bio-integrity.c | 83 +++

[PATCH 3/6] aio/dio: enable PI passthrough

2014-03-24 Thread Darrick J. Wong
Provide an IO extension handler that attaches PI data from the io extension structure to a kiocb, then teach directio how to attach the pages representing the PI buffer directly to a bio. Signed-off-by: Darrick J. Wong --- Documentation/block/data-integrity.txt | 11 fs/aio.c

[PATCH 4/6] PI IO extension: allow user to ask kernel to fill in parts of the protection info

2014-03-24 Thread Darrick J. Wong
Since userspace can now pass PI buffers through to the block integrity provider, provide a means for userspace to specify a flags argument with the PI buffer. The initial user for this will be sd_dif, which will enable user programs to ask the kernel to fill in whichever fields they don't want to

[PATCH 2/6] io: define an interface for IO extensions

2014-03-24 Thread Darrick J. Wong
Define a generic interface to allow userspace to attach metadata to an IO operation. This interface will be used initially to implement protection information (PI) pass through, though it ought to be usable by anyone else desiring to extend the IO interface. It should not be difficult to modify t

[RFC PATCH DONOTMERGE v2 0/6] userspace PI passthrough via AIO/DIO

2014-03-24 Thread Darrick J. Wong
This RFC provides a rough implementation of a mechanism to allow userspace to attach protection information (e.g. T10 DIF) data to a disk write and to receive the information alongside a disk read. There's a new "IO extension" interface wherein we define a structure (per zab's comments on the v2 se

Re: [RESEND][PATCH 1/2] lib/scatterlist: Make ARCH_HAS_SG_CHAIN an actual Kconfig

2014-03-24 Thread Russell King - ARM Linux
On Sat, Mar 22, 2014 at 03:59:11PM -0700, James Bottomley wrote: > On Sat, 2014-03-22 at 22:52 +, Russell King - ARM Linux wrote: > > And I'm disagreeing with that statement which implies that it's something > > that is an architecture wide property for any particular architecture. > > > > Rig