Re: [PATCH 0/15] copy offload patches

2015-12-14 Thread Mikulas Patocka
On Thu, 10 Dec 2015, Martin K. Petersen wrote: > >>>>> "Mikulas" == Mikulas Patocka writes: > > Mikulas, > > Mikulas> This patch series adds copy offload (the XCOPY command) to the > Mikulas> block layer, SCSI subsystems and device mapper. &

[PATCH 1/15] block copy: initial XCOPY offload support

2015-12-10 Thread Mikulas Patocka
ues. The first value is a source byte offset, the second value is a destination byte offset, the third value is byte length. The forth value is written by the kernel and it represents the number of bytes that the kernel actually copied. Signed-off-by: Martin K. Petersen Signed-off-by: Mikula

[PATCH 3/15] block copy: report the amount of copied data

2015-12-10 Thread Mikulas Patocka
umber of copied sectors is equal to the number of requested sectors. On error (negative return code), the number of copied sectors is smaller than the number of requested sectors. The number of copied bytes is returned as a fourth uint64_t argument in the BLKCOPY ioctl. Signed-off-by:

[PATCH 2/15] block copy: use two bios

2015-12-10 Thread Mikulas Patocka
is no guarantee that the XCOPY command will succeed. If it doesn't succeed, the caller is supposed to perform the copy manually. Signed-off-by: Mikulas Patocka --- block/bio.c | 28 +++- block/blk-core.c | 41 block/blk-lib.c

[PATCH 4/15] block copy: use a timer to fix a theoretical deadlock

2015-12-10 Thread Mikulas Patocka
copy manually if XCOPY fails. Signed-off-by: Mikulas Patocka --- block/blk-lib.c | 31 +++ include/linux/blk_types.h |2 ++ 2 files changed, 33 insertions(+) Index: linux-4.3/block/blk-

[PATCH 5/15] block copy: use asynchronous notification

2015-12-10 Thread Mikulas Patocka
. Signed-off-by: Mikulas Patocka --- block/blk-lib.c | 148 +- block/ioctl.c |2 include/linux/blk_types.h |5 - include/linux/blkdev.h|2 4 files changed, 112 insertions(+), 45 deletions(-) Index: linux-4.4-rc4

[PATCH 8/15] block copy: introduce "copy_boundary" limits

2015-12-10 Thread Mikulas Patocka
not cross these boundaries. This patch introduces a new queue limit "copy_boundary", it is log2 of the boundary in sectors that the request must not cross. Device mapper will use this limit to propagate its requirements through the device stack. Signed-off-by: Mikulas Patocka ---

[PATCH 7/15] scsi xcopy: keep cache of failures

2015-12-10 Thread Mikulas Patocka
than 30 seconds after the last failure. Signed-off-by: Mikulas Patocka --- drivers/scsi/sd.c | 37 + 1 file changed, 37 insertions(+) Index: linux-4.4-rc4/drivers/scsi/sd.c === --- linux-4.4

[PATCH 6/15] scsi xcopy: suppress error messages

2015-12-10 Thread Mikulas Patocka
This patch suppresses error messages when copying between two arrays that support XCOPY each, but that cannot copy data between each other. Signed-off-by: Mikulas Patocka --- drivers/scsi/sd.c | 14 ++ 1 file changed, 14 insertions(+) Index: linux-4.4-rc4/drivers/scsi/sd.c

[PATCH 9/15] dm: implement copy

2015-12-10 Thread Mikulas Patocka
ned-off-by: Mikulas Patocka --- drivers/md/dm-table.c | 16 drivers/md/dm.c | 27 +++ include/linux/device-mapper.h |5 + 3 files changed, 48 insertions(+) Index: linux-4.4-rc4/drivers/md/d

[PATCH 10/15] dm linear: support copy

2015-12-10 Thread Mikulas Patocka
Support copy operation in the linear target. Signed-off-by: Mikulas Patocka --- drivers/md/dm-linear.c |1 + 1 file changed, 1 insertion(+) Index: linux-4.3-rc1/drivers/md/dm-linear.c === --- linux-4.3-rc1.orig/drivers/md/dm

[PATCH 11/15] dm stripe: support copy

2015-12-10 Thread Mikulas Patocka
Support the copy operation for the stripe target. In stripe_merge, we verify that the underlying device supports copy. If it doesn't, we can fail fast without any bio being contructed. Signed-off-by: Mikulas Patocka --- drivers/md/dm-stripe.c |1 + 1 file changed, 1 insertion(+)

[PATCH 12/15] dm kcopyd: introduce the function submit_job

2015-12-10 Thread Mikulas Patocka
We move some code to a function submit_job. It is needed for the next patch that calls submit_job from another place. Signed-off-by: Mikulas Patocka --- drivers/md/dm-kcopyd.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) Index: linux-3.16-rc5/drivers/md/dm

[PATCH 15/15] dm kcopyd: call copy offload with asynchronous callback

2015-12-10 Thread Mikulas Patocka
submitted the requests and copy_offload_callback is called when the copy operation finishes. Signed-off-by: Mikulas Patocka --- drivers/md/dm-kcopyd.c | 33 ++--- 1 file changed, 14 insertions(+), 19 deletions(-) Index: linux-3.16-rc5/drivers/md/dm-kcopyd.c

[PATCH 13/15] dm kcopyd: support copy offload

2015-12-10 Thread Mikulas Patocka
This patch adds copy offload support to dm-kcopyd. If copy offload fails, copying is performed using dm-io, just like before. There is a module parameter "copy_offload" that can be set to enable or disable this feature. It can be used to test performance of copy offload. Signed-off-b

[PATCH 14/15] dm kcopyd: change mutex to spinlock

2015-12-10 Thread Mikulas Patocka
allowed. Signed-off-by: Mikulas Patocka --- drivers/md/dm-kcopyd.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) Index: linux-3.16-rc5/drivers/md/dm-kcopyd.c === --- linux-3.16-rc5.orig/drivers/md/dm-kcopyd.c 20

[PATCH 0/15] copy offload patches

2015-12-10 Thread Mikulas Patocka
Hi This patch series adds copy offload (the XCOPY command) to the block layer, SCSI subsystems and device mapper. The principle of operation is this: We create two bios with REQ_COPY flag, one for read and one for write. The bios have no data pages and they both point to the same bio_copy str

[PATCH 4.1 v2] target-core: fix return without a value

2015-11-11 Thread Mikulas Patocka
ned-off-by: Mikulas Patocka --- drivers/target/target_core_pr.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-4.1.13/drivers/target/target_core_pr.c === --- linux-4.1.13.orig/drivers/target/target_core_pr.c

Re: [PATCH 4.1] target-core: fix return without a value

2015-11-11 Thread Mikulas Patocka
On Tue, 10 Nov 2015, Greg Kroah-Hartman wrote: > On Tue, Nov 10, 2015 at 06:31:47PM -0500, Mikulas Patocka wrote: > > > > > > On Tue, 10 Nov 2015, Greg Kroah-Hartman wrote: > > > > > On Tue, Nov 10, 2015 at 01:32:10PM -0500, Mikulas Patocka wrote: &g

Re: [PATCH 4.1] target-core: fix return without a value

2015-11-10 Thread Mikulas Patocka
On Tue, 10 Nov 2015, Greg Kroah-Hartman wrote: > On Tue, Nov 10, 2015 at 01:32:10PM -0500, Mikulas Patocka wrote: > > Fix the warning drivers/target/target_core_pr.c:332:3: warning: 'return' > > with no value, in function returning non-void [-Wreturn

[PATCH 4.1] target-core: fix return without a value

2015-11-10 Thread Mikulas Patocka
a value to the function core_scsi3_pr_seq_non_holder that returns int. Signed-off-by: Mikulas Patocka --- drivers/target/target_core_pr.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux-4.1.13/drivers/target/target

[PATCH] sg: fix overflow in timeout calculation

2015-02-09 Thread Mikulas Patocka
USER_HZ may be greater than HZ and in that case arithmetics tries to calculate the maximum accepted timeout overflows. We need to use INT_MAX in this case. Signed-off-by: Mikulas Patocka Cc: sta...@vger.kernel.org --- drivers/scsi/sg.c | 10 -- 1 file changed, 8 insertions(+), 2

Re: [PATCH 4/18] block copy: initial XCOPY offload support

2014-10-31 Thread Mikulas Patocka
On Wed, 22 Oct 2014, Douglas Gilbert wrote: > See below ... > > Perhaps you are checking somewhere else ... EXTENDED_COPY > opcode (0x83) has had service actions since SPC-4 rev 34 > (February 2012). By the time SPC-4 becomes standardized > this command will most likely be called EXTENDED COPY(

Re: [dm-devel] [PATCH 0/18] SCSI XCOPY support for the kernel and device mapper

2014-10-31 Thread Mikulas Patocka
On Sun, 26 Oct 2014, Bart Van Assche wrote: > On 10/22/14 15:24, Mikulas Patocka wrote: > > I uploaded the new version of SCSI/device-mapper XCOPY patches here: > > http://people.redhat.com/~mpatocka/patches/kernel/xcopy/series.html > > > > I am also sending the patc

[PATCH 18/18] dm kcopyd: call copy offload with asynchronous callback

2014-10-22 Thread Mikulas Patocka
submitted the requests and copy_offload_callback is called when the copy operation finishes. Signed-off-by: Mikulas Patocka --- drivers/md/dm-kcopyd.c | 33 ++--- 1 file changed, 14 insertions(+), 19 deletions(-) Index: linux-3.16-rc5/drivers/md/dm-kcopyd.c

[PATCH 17/18] dm kcopyd: change mutex to spinlock

2014-10-22 Thread Mikulas Patocka
allowed. Signed-off-by: Mikulas Patocka --- drivers/md/dm-kcopyd.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) Index: linux-3.16-rc5/drivers/md/dm-kcopyd.c === --- linux-3.16-rc5.orig/drivers/md/dm-kcopyd.c 20

[PATCH 15/18] dm kcopyd: introduce the function submit_job

2014-10-22 Thread Mikulas Patocka
We move some code to a function submit_job. It is needed for the next patch that calls submit_job from another place. Signed-off-by: Mikulas Patocka --- drivers/md/dm-kcopyd.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) Index: linux-3.16-rc5/drivers/md/dm

[PATCH 16/18] dm kcopyd: support copy offload

2014-10-22 Thread Mikulas Patocka
This patch adds copy offload support to dm-kcopyd. If copy offload fails, copying is performed using dm-io, just like before. There is a module parameter "copy_offload" that can be set to enable or disable this feature. It can be used to test performance of copy offload. Signed-off-b

[PATCH 14/18] dm stripe: support copy

2014-10-22 Thread Mikulas Patocka
Support the copy operation for the stripe target. In stripe_merge, we verify that the underlying device supports copy. If it doesn't, we can fail fast without any bio being contructed. Signed-off-by: Mikulas Patocka --- drivers/md/dm-stripe.c | 11 ++- 1 file changed, 10 inser

[PATCH 13/18] dm linear: support copy

2014-10-22 Thread Mikulas Patocka
Support copy operation in the linear target. Signed-off-by: Mikulas Patocka --- drivers/md/dm-linear.c |1 + 1 file changed, 1 insertion(+) Index: linux-3.16-rc4/drivers/md/dm-linear.c === --- linux-3.16-rc4.orig/drivers/md

[PATCH 12/18] dm: implement copy

2014-10-22 Thread Mikulas Patocka
ned-off-by: Mikulas Patocka --- drivers/md/dm-table.c |9 + drivers/md/dm.c | 42 +++--- include/linux/device-mapper.h |5 + 3 files changed, 53 insertions(+), 3 deletions(-) Index: linux-3.18-rc1/drivers/md/d

[PATCH 11/18] scsi xcopy: keep cache of failures

2014-10-22 Thread Mikulas Patocka
than 30 seconds after the last failure. Signed-off-by: Mikulas Patocka --- drivers/scsi/sd.c | 35 +++ 1 file changed, 35 insertions(+) Index: linux-3.18-rc1/drivers/scsi/sd.c === --- linux-3.18

[PATCH 9/18] block copy: use asynchronous notification

2014-10-22 Thread Mikulas Patocka
. Signed-off-by: Mikulas Patocka --- block/blk-lib.c | 152 -- block/ioctl.c |2 include/linux/blk_types.h |5 - include/linux/blkdev.h|2 4 files changed, 114 insertions(+), 47 deletions(-) Index: linux-3.18-rc1

[PATCH 8/18] block copy: use merge_bvec_fn for copies

2014-10-22 Thread Mikulas Patocka
mapper stack. Signed-off-by: Mikulas Patocka --- block/blk-lib.c | 37 + 1 file changed, 37 insertions(+) Index: linux-3.16-rc5/block/blk-lib.c === --- linux-3.16-rc5.orig/block/blk-lib.c 2014

[PATCH 10/18] scsi xcopy: suppress error messages

2014-10-22 Thread Mikulas Patocka
This patch suppresses error messages when copying between two arrays that support XCOPY each, but that cannot copy data between each other. Signed-off-by: Mikulas Patocka --- drivers/scsi/sd.c | 12 1 file changed, 12 insertions(+) Index: linux-3.18-rc1/drivers/scsi/sd.c

[PATCH 7/18] block copy: use a timer to fix a theoretical deadlock

2014-10-22 Thread Mikulas Patocka
copy manually if XCOPY fails. Signed-off-by: Mikulas Patocka --- block/blk-lib.c | 27 +++ include/linux/blk_types.h |2 ++ 2 files changed, 29 insertions(+) Index: linux-3.16-rc5/block/blk-

[PATCH 6/18] block copy: report the amount of copied data

2014-10-22 Thread Mikulas Patocka
umber of copied sectors is equal to the number of requested sectors. On error (negative return code), the number of copied sectors is smaller than the number of requested sectors. The number of copied bytes is returned as a fourth uint64_t argument in the BLKCOPY ioctl. Signed-off-by:

[PATCH 2/18] dm: introduce dm_ask_for_duplicate_bios

2014-10-22 Thread Mikulas Patocka
This function can be used if the target needs to receive another duplicate of the current bio. Signed-off-by: Mikulas Patocka --- drivers/md/dm.c | 24 +++- include/linux/device-mapper.h |2 ++ 2 files changed, 21 insertions(+), 5 deletions(-) Index

[PATCH 5/18] block copy: use two bios

2014-10-22 Thread Mikulas Patocka
is no guarantee that the XCOPY command will succeed. If it doesn't succeed, the caller is supposed to perform the copy manually. Signed-off-by: Mikulas Patocka --- block/bio.c | 26 ++- block/blk-core.c | 34 block/blk-lib.c

[PATCH 4/18] block copy: initial XCOPY offload support

2014-10-22 Thread Mikulas Patocka
ues. The first value is a source byte offset, the second value is a destination byte offset, the third value is byte length. The forth value is written by the kernel and it represents the number of bytes that the kernel actually copied. Signed-off-by: Martin K. Petersen Signed-off-by: Mikula

[PATCH 3/18] blk-lib: fix error reporting

2014-10-22 Thread Mikulas Patocka
This patch changes bio_batch->flags to an error field and stores the last error there - so that the error is reported accurately and it isn't ignored. Signed-off-by: Mikulas Patocka Cc: sta...@vger.kernel.org --- block/blk-lib.c | 25 - 1 file changed, 12 insertion

[PATCH 1/18] dm: remove num_write_bios

2014-10-22 Thread Mikulas Patocka
). num_write_bios is unused, so we remove it. Note that we deliberately leave the for loop in __clone_and_map_data_bio - it will be used in the next patch. Signed-off-by: Mikulas Patocka --- drivers/md/dm.c |6 -- include/linux/device-mapper.h | 15 --- 2 files changed

[PATCH 0/18] SCSI XCOPY support for the kernel and device mapper

2014-10-22 Thread Mikulas Patocka
Hi I uploaded the new version of SCSI/device-mapper XCOPY patches here: http://people.redhat.com/~mpatocka/patches/kernel/xcopy/series.html I am also sending the patches in the following emails. Mikulas -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a me

Re: [PATCH 1/15] block copy: initial XCOPY offload support

2014-08-05 Thread Mikulas Patocka
On Mon, 4 Aug 2014, Pavel Machek wrote: > On Tue 2014-07-15 15:34:47, Mikulas Patocka wrote: > > This is Martin Petersen's xcopy patch > > (https://git.kernel.org/cgit/linux/kernel/git/mkp/linux.git/commit/?h=xcopy&id=0bdeed274e16b3038a851552188512071974eea8) > >

Re: [PATCH 1/15] block copy: initial XCOPY offload support

2014-07-18 Thread Mikulas Patocka
On Fri, 18 Jul 2014, Tomas Henzl wrote: > > + if (src_sector + nr_sects < src_sector || > > + dst_sector + nr_sects < dst_sector) > > + return -EINVAL; > > Hi Mikulas, > this^ is meant as an overflow test or what is the reason? > Thanks, Tomas Yes. It is a test for overflow.

[PATCH 15/15] dm kcopyd: call copy offload with asynchronous callback

2014-07-15 Thread Mikulas Patocka
submitted the requests and copy_offload_callback is called when the copy operation finishes. Signed-off-by: Mikulas Patocka --- drivers/md/dm-kcopyd.c | 33 ++--- 1 file changed, 14 insertions(+), 19 deletions(-) Index: linux-3.16-rc5/drivers/md/dm-kcopyd.c

[PATCH 12/15] dm kcopyd: introduce the function submit_job

2014-07-15 Thread Mikulas Patocka
We move some code to a function submit_job. It is needed for the next patch that calls submit_job from another place. Signed-off-by: Mikulas Patocka --- drivers/md/dm-kcopyd.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) Index: linux-3.16-rc5/drivers/md/dm

[PATCH 14/15] dm kcopyd: change mutex to spinlock

2014-07-15 Thread Mikulas Patocka
allowed. Signed-off-by: Mikulas Patocka --- drivers/md/dm-kcopyd.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) Index: linux-3.16-rc5/drivers/md/dm-kcopyd.c === --- linux-3.16-rc5.orig/drivers/md/dm-kcopyd.c 20

[PATCH 13/15] dm kcopyd: support copy offload

2014-07-15 Thread Mikulas Patocka
This patch adds copy offload support to dm-kcopyd. If copy offload fails, copying is performed using dm-io, just like before. There is a module parameter "copy_offload" that can be set to enable or disable this feature. It can be used to test performance of copy offload. Signed-off-b

[PATCH 11/15] dm stripe: support copy

2014-07-15 Thread Mikulas Patocka
Support the copy operation for the stripe target. In stripe_merge, we verify that the underlying device supports copy. If it doesn't, we can fail fast without any bio being contructed. Signed-off-by: Mikulas Patocka --- drivers/md/dm-stripe.c | 11 ++- 1 file changed, 10 inser

[PATCH 10/15] dm linear: support copy

2014-07-15 Thread Mikulas Patocka
Support copy operation in the linear target. Signed-off-by: Mikulas Patocka --- drivers/md/dm-linear.c |1 + 1 file changed, 1 insertion(+) Index: linux-3.16-rc4/drivers/md/dm-linear.c === --- linux-3.16-rc4.orig/drivers/md

[PATCH 9/15] dm: implement copy

2014-07-15 Thread Mikulas Patocka
ned-off-by: Mikulas Patocka --- drivers/md/dm-table.c |9 + drivers/md/dm.c | 42 +++--- include/linux/device-mapper.h |5 + 3 files changed, 53 insertions(+), 3 deletions(-) Index: linux-3.16-rc5/drivers/md/d

[PATCH 8/15] dm: introduce dm_ask_for_duplicate_bios

2014-07-15 Thread Mikulas Patocka
[ this isn't connected to XCOPY, but it is requires for the following device mapper patches to apply cleanly ] This function can be used if the target needs to receive another duplicate of the current bio. Signed-off-by: Mikulas Patocka --- drivers/md/dm.c |

[PATCH 7/15] dm: remove num_write_bios

2014-07-15 Thread Mikulas Patocka
ut it is not useable due to a race condition (see the description of e2e74d617eadc15f601983270c4f4a6935c5a943). num_write_bios is unused, so we remove it. Note that we deliberately leave the for loop in __clone_and_map_data_bio - it will be used in the next patch. Signed-off-by: Mikulas Pa

[PATCH 6/15] block copy: use asynchronous notification

2014-07-15 Thread Mikulas Patocka
not need process context for each of them. Signed-off-by: Mikulas Patocka --- block/blk-lib.c | 152 -- block/ioctl.c |2 include/linux/blk_types.h |5 - include/linux/blkdev.h|2 4 files changed, 114 insertions

[PATCH 5/15] block copy: use merge_bvec_fn for copies

2014-07-15 Thread Mikulas Patocka
mapper stack. Signed-off-by: Mikulas Patocka --- block/blk-lib.c | 37 + 1 file changed, 37 insertions(+) Index: linux-3.16-rc5/block/blk-lib.c === --- linux-3.16-rc5.orig/block/blk-lib.c 2014

[PATCH 3/15] block copy: report the amount of copied data

2014-07-15 Thread Mikulas Patocka
umber of copied sectors is equal to the number of requested sectors. On error (negative return code), the number of copied sectors is smaller than the number of requested sectors. The number of copied bytes is returned as a fourth uint64_t argument in the BLKCOPY ioctl. Signed-off-by:

[PATCH 4/15] block copy: use a timer to fix a theoretical deadlock

2014-07-15 Thread Mikulas Patocka
copy manually if XCOPY fails. Signed-off-by: Mikulas Patocka --- block/blk-lib.c | 27 +++ include/linux/blk_types.h |2 ++ 2 files changed, 29 insertions(+) Index: linux-3.16-rc5/block/blk-

[PATCH 1/15] block copy: initial XCOPY offload support

2014-07-15 Thread Mikulas Patocka
ues. The first value is a source byte offset, the second value is a destination byte offset, the third value is byte length. The forth value is written by the kernel and it represents the number of bytes that the kernel actually copied. Signed-off-by: Martin K. Petersen Signed-off-by: Mikula

[PATCH 2/15] block copy: use two bios

2014-07-15 Thread Mikulas Patocka
is no guarantee that the XCOPY command will succeed. If it doesn't succeed, the caller is supposed to perform the copy manually. Signed-off-by: Mikulas Patocka --- block/bio.c | 26 ++- block/blk-core.c | 34 block/blk-lib.c

[PATCH 0/15] SCSI XCOPY support for the kernel and device mapper

2014-07-15 Thread Mikulas Patocka
This patch series makes it possible to use SCSI XCOPY offload for the block layer and device mapper. It is based on Martin Petersen's work https://git.kernel.org/cgit/linux/kernel/git/mkp/linux.git/commit/?h=xcopy&id=0bdeed274e16b3038a851552188512071974eea8, but it is changed significantly so tha

Re: ANNOUNCE: SCSI XCOPY support for the kernel and device mapper

2014-07-15 Thread Mikulas Patocka
On Tue, 15 Jul 2014, Christoph Hellwig wrote: > On Tue, Jul 15, 2014 at 02:33:13PM -0400, Mikulas Patocka wrote: > > Hi > > > > I annouce that I released the first version of a patch set that makes it > > possible to use SCSI XCOPY offload for the block layer and

ANNOUNCE: SCSI XCOPY support for the kernel and device mapper

2014-07-15 Thread Mikulas Patocka
Hi I annouce that I released the first version of a patch set that makes it possible to use SCSI XCOPY offload for the block layer and device mapper. The patchset is at http://people.redhat.com/~mpatocka/patches/kernel/xcopy/series.html It requires kernel version at least 3.16-rc4. It was test

Re: Crash on WRITE SAME

2014-07-02 Thread Mikulas Patocka
On Wed, 2 Jul 2014, Christoph Hellwig wrote: > On Wed, Jul 02, 2014 at 02:05:14PM -0400, Mikulas Patocka wrote: > > Hi Sagi > > > > Your commit d77e65350f2d82dfa0557707d505711f5a43c8fd causes crash on SCSI > > WRITE SAME command (it can be triggered by issuing the

Crash on WRITE SAME

2014-07-02 Thread Mikulas Patocka
Hi Sagi Your commit d77e65350f2d82dfa0557707d505711f5a43c8fd causes crash on SCSI WRITE SAME command (it can be triggered by issuing the BLKZEROOUT ioctl). The crash happens in iscsi_tcp_segment_done because sg_next returns NULL. Before that commit, there was this code in iscsi_prep_scsi_cmd_pd

Re: [PATCH] target: fix deadlock on unload

2014-06-27 Thread Mikulas Patocka
On Thu, 26 Jun 2014, Nicholas A. Bellinger wrote: > Hi Mikulas, > > On Mon, 2014-06-23 at 13:42 -0400, Mikulas Patocka wrote: > > target: fix deadlock on unload > > > > On uniprocessor preemptible kernel, target core deadlocks on unload. The > > following even

[PATCH] target: fix deadlock on unload

2014-06-23 Thread Mikulas Patocka
de was racy even before. This patch fixes the problem. Using kthread_should_stop to stop the np_thread is unreliable, so we test np_thread_state instead. If np_thread_state equals ISCSI_NP_THREAD_SHUTDOWN, the thread exits. Signed-off-by: Mikulas Patocka Cc: sta...@vger.kernel.org --- driv

Re: [PATCH v2] kref: warn on uninitialized kref

2014-05-17 Thread Mikulas Patocka
On Sat, 17 May 2014, Bart Van Assche wrote: > On 05/17/14 14:38, Mikulas Patocka wrote: > > I found a memory leak in iSCSI target that was caused by kref initialized > > to zero (the memory object was allocated with kzalloc, kref_init was not > > called and kref_put_spinlo

[PATCH v2] kref: warn on uninitialized kref

2014-05-17 Thread Mikulas Patocka
ist in other kernel areas, so I submit this patch that adds a check to kref.h. If the value is zero or negative, we can assume that it is uninitialized and we warn about it. Signed-off-by: Mikulas Patocka --- include/linux/kref.h |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Inde

Re: [PATCH] kref: warn on uninitialized kref

2014-05-17 Thread Mikulas Patocka
On Sat, 17 May 2014, Mateusz Guzik wrote: > On Sat, May 17, 2014 at 06:53:17AM -0400, Mikulas Patocka wrote: > > I found a memory leak in iSCSI target that was caused by kref initialized > > to zero (the memory object was allocated with kzalloc, kref_init was not

[PATCH] kref: warn on uninitialized kref

2014-05-17 Thread Mikulas Patocka
ist in other kernel areas, so I submit this patch that adds a check to kref.h. If the value is zero or negative, we can assume that it is uninitialized and we warn about it. Signed-off-by: Mikulas Patocka --- include/linux/kref.h |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Inde

[PATCH] target: fix memory leak on XCOPY

2014-05-17 Thread Mikulas Patocka
so it will correctly initialize cmd_kref). It can be easily verified that all code that calls target_get_sess_cmd also calls transport_init_se_cmd earlier, thus moving kref_init shouldn't introduce any new problems. Signed-off-by: Mikulas Patocka Cc: sta...@vger.kernel.org # 3.12+ ---

Re: [PATCH] block devices: validate block device capacity

2014-02-03 Thread Mikulas Patocka
On Mon, 3 Feb 2014, Christoph Hellwig wrote: > On Fri, Jan 31, 2014 at 03:20:17AM -0500, Mikulas Patocka wrote: > > So if you think you can support 16TiB devices and leave pgoff_t 32-bit, > > send a patch that does it. > > > > Until you make it, you should apply

Re: [PATCH] block devices: validate block device capacity

2014-01-31 Thread Mikulas Patocka
On Thu, 30 Jan 2014, James Bottomley wrote: > > So, if you want 64-bit page offsets, you need to increase pgoff_t size, > > and that will increase the limit for both files and block devices. > > No. The point is the page cache mapping of the device uses a > manufactured inode saved in the bac

Re: [PATCH] block devices: validate block device capacity

2014-01-30 Thread Mikulas Patocka
On Thu, 30 Jan 2014, James Bottomley wrote: > > A device may be accessed direcly (by opening /dev/sdX) and it creates a > > mapping too - thus, the size of a mapping limits the size of a block > > device. > > Right, that's what I suspected below. We can't damage large block > support on file

Re: [PATCH] block devices: validate block device capacity

2014-01-30 Thread Mikulas Patocka
On Thu, 30 Jan 2014, James Bottomley wrote: > On Thu, 2014-01-30 at 18:10 -0500, Mikulas Patocka wrote: > > > > On Thu, 30 Jan 2014, James Bottomley wrote: > > > > > Why is this? the whole reason for CONFIG_LBDAF is supposed to be to > > > allow 64

Re: [PATCH] block devices: validate block device capacity

2014-01-30 Thread Mikulas Patocka
On Thu, 30 Jan 2014, James Bottomley wrote: > Why is this? the whole reason for CONFIG_LBDAF is supposed to be to > allow 64 bit offsets for block devices on 32 bit. It sounds like > there's somewhere not using sector_t ... or using it wrongly which needs > fixing. The page cache uses unsigne

[PATCH] block devices: validate block device capacity

2014-01-30 Thread Mikulas Patocka
rivers test that the device size fits in sector_t, but this test is not sufficient on 32-bit architectures. This patch introduces a new function validate_disk_capacity that tests if the disk capacity is OK for the current kernel and modifies the drivers brd, ide-gd, dm, sd to use it. Signed-off

Re: [PATCH] sg: fix integer overflow (fwd)

2014-01-24 Thread Mikulas Patocka
On Fri, 24 Jan 2014, Mikulas Patocka wrote: > > > On Fri, 24 Jan 2014, James Bottomley wrote: > > > On Fri, 2014-01-24 at 11:34 -0500, Mikulas Patocka wrote: > > > On alpha, USER_HZ may be higher than HZ. This results in integer overflow > > > in MULDIV.

Re: [PATCH] sg: fix integer overflow

2014-01-24 Thread Mikulas Patocka
On Fri, 24 Jan 2014, Mikulas Patocka wrote: > > > On Fri, 24 Jan 2014, James Bottomley wrote: > > > On Fri, 2014-01-24 at 11:34 -0500, Mikulas Patocka wrote: > > > On alpha, USER_HZ may be higher than HZ. This results in integer overflow > > > in MULDIV.

Re: [PATCH] sg: fix integer overflow

2014-01-24 Thread Mikulas Patocka
On Fri, 24 Jan 2014, James Bottomley wrote: > On Fri, 2014-01-24 at 11:34 -0500, Mikulas Patocka wrote: > > On alpha, USER_HZ may be higher than HZ. This results in integer overflow > > in MULDIV. > > > > Signed-off-by: Mikulas Patocka > > Cc: sta...@vger.ker

[PATCH] sg: fix integer overflow

2014-01-24 Thread Mikulas Patocka
On alpha, USER_HZ may be higher than HZ. This results in integer overflow in MULDIV. Signed-off-by: Mikulas Patocka Cc: sta...@vger.kernel.org --- drivers/scsi/sg.c |2 ++ 1 file changed, 2 insertions(+) Index: linux-3.13/drivers/scsi/sg.c

[PATCH 4/5] ia64 simscsi: fix race condition and simplify the code

2014-01-23 Thread Mikulas Patocka
can be completed directly from the requets routine. So I removed the tasklet code. Signed-off-by: Mikulas Patocka --- arch/ia64/hp/sim/simscsi.c | 34 ++ 1 file changed, 2 insertions(+), 32 deletions(-) Index: linux-2.6-ia64/arch/ia64/hp/sim/simscsi.c

[PATCH] sym53c8xx_2: Set DID_REQUEUE return code when aborting squeue.

2014-01-23 Thread Mikulas Patocka
FULL anytime and it is up to the host to retry. Signed-off-by: Mikulas Patocka Cc: sta...@vger.kernel.org --- drivers/scsi/sym53c8xx_2/sym_hipd.c |4 1 file changed, 4 insertions(+) Index: linux-2.6.36-rc5-fast/drivers/scsi/sym53c8xx_2/sym_hipd.c

Re: [dm-devel] SCSI's heuristics for enabling WRITE SAME still need work [was: dm mpath: disable WRITE SAME if it fails]

2013-09-24 Thread Mikulas Patocka
On Fri, 20 Sep 2013, Mike Snitzer wrote: > On Thu, Sep 19 2013 at 12:13pm -0400, > Mike Snitzer wrote: > > > Workaround the SCSI layer's problematic WRITE SAME heuristics by > > disabling WRITE SAME in the DM multipath device's queue_limits if an > > underlying device disabled it. > > ... >

Re: [PATCH 2/2] dm mpath: attach scsi_dh during table resume

2013-04-25 Thread Mikulas Patocka
On Thu, 25 Apr 2013, Mike Snitzer wrote: > On Thu, Apr 25 2013 at 9:48am -0400, > Mikulas Patocka wrote: > > > > > > > On Mon, 22 Apr 2013, Mike Snitzer wrote: > > > > > I spoke with Hannes at LSF, to address the potential crashes in the >

Re: [PATCH 2/2] dm mpath: attach scsi_dh during table resume

2013-04-25 Thread Mikulas Patocka
On Mon, 22 Apr 2013, Mike Snitzer wrote: > I spoke with Hannes at LSF, to address the potential crashes in the > endio path (e.g. stpg_endio) we'd have to bump the scsi_dh_data kref > where appropriate (e.g. for ALUA kref_get in submit_stpg and kref_put in > stpg_endio). > > But that is just th

Re: [dm-devel] [PATCH] scsi-dh-emc: fix activate vs set_params race

2013-04-05 Thread Mikulas Patocka
, at 7:11 PM, Mike Christie wrote: > > > On 04/02/2013 07:09 PM, Mikulas Patocka wrote: > >> Hi > >> > >> This fixes a possible race in scsi_dh_emc. It is untested because I don't > >> have the hardware. It could happen when we reload a multipath dev

[PATCH] scsi-dh-emc: fix activate vs set_params race

2013-04-02 Thread Mikulas Patocka
alled concurrently. This patch adds a mutex to fix the race. Signed-off-by: Mikulas Patocka --- drivers/scsi/device_handler/scsi_dh_emc.c | 11 +++ 1 file changed, 11 insertions(+) Index: linux-3.9-rc5-fast/drivers/scsi/device_handler/scsi_dh_

Re: [PATCH] dm: do not replace bioset for request-based dm

2013-02-26 Thread Mikulas Patocka
Acked-by: Mikulas Patocka On Tue, 26 Feb 2013, Jun'ichi Nomura wrote: > This patch fixes a regression introduced in v3.8, which causes oops > like this when dm-multipath is used: > > general protection fault: [#1] SMP > RIP: 0010:[] [] mempool_free+0x