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 <mpato...@redhat.com> writes: > > Mikulas, > > Mikulas> This patch series adds copy offload (the XCOPY command) to the > Mikulas> block layer, SCSI su

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

2015-12-10 Thread Mikulas Patocka
wed. Signed-off-by: Mikulas Patocka <mpato...@redhat.com> --- 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/driv

[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 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 <mpato...@redhat.com> --- drivers/md/dm-kcopyd.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) Index: linu

[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 <mpato...@redhat.com> --- drivers/md/dm-stripe.c |1 + 1 file chan

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

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

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

2015-12-10 Thread Mikulas Patocka
ed-off-by: Mikulas Patocka <mpato...@redhat.com> --- Documentation/ABI/testing/sysfs-block |9 + block/bio.c |2 block/blk-core.c |5 block/blk-lib.c | 95 +++ block/blk-merge.c

[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 <mpato...@redhat.com> --- drivers/md/dm-linear.c |1 + 1 file changed, 1 insertion(+) Index: linux-4.3-rc1/drivers/md/dm-linear.c === --- lin

[PATCH 9/15] dm: implement copy

2015-12-10 Thread Mikulas Patocka
ned-off-by: Mikulas Patocka <mpato...@redhat.com> --- 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/driver

[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 <mpato...@redhat.com> --- drivers/scsi/sd.c | 37 + 1 file changed, 37 insertions(+) Index: linux-4.4-rc4/drivers/scs

[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 <mpato.

[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 <mpato...@redhat.com> --- drivers/scsi/sd.c | 14 ++ 1 file changed, 14 insertions(+) Index: linux-4

[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

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

2015-12-10 Thread Mikulas Patocka
that there 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 <mpato...@redhat.com> --- block/bio.c | 28 +++- block/blk-core.c | 41 blo

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

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

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

2015-12-10 Thread Mikulas Patocka
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: Mikulas Pato

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

2015-12-10 Thread Mikulas Patocka
. Signed-off-by: Mikulas Patocka <mpato...@redhat.com> --- 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 del

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

2015-11-11 Thread Mikulas Patocka
-by: Mikulas Patocka <mpato...@redhat.com> --- 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/

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

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

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

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-type] >

[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 mpato...@redhat.com Cc: sta...@vger.kernel.org --- drivers/scsi/sg.c | 10 -- 1 file changed, 8

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 patches in the following emails

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(LID1)

[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

[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 mpato...@redhat.com --- drivers/md/dm.c |6 -- include/linux/device-mapper.h | 15

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

2014-10-22 Thread Mikulas Patocka
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 mpato...@redhat.com Cc: sta...@vger.kernel.org --- block/blk-lib.c | 25 - 1 file changed, 12 insertions(+), 13

[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 mpato...@redhat.com --- drivers/md/dm.c | 24 +++- include/linux/device-mapper.h |2 ++ 2 files changed, 21 insertions(+), 5

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

2014-10-22 Thread Mikulas Patocka
that there 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 mpato...@redhat.com --- 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
-by: Mikulas Patocka mpato...@redhat.com --- Documentation/ABI/testing/sysfs-block |9 + block/bio.c |2 block/blk-core.c |5 block/blk-lib.c | 95 block/blk-merge.c |7 block

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

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

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

2014-10-22 Thread Mikulas Patocka
. Signed-off-by: Mikulas Patocka mpato...@redhat.com --- 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

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

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

[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 mpato...@redhat.com --- drivers/scsi/sd.c | 12 1 file changed, 12 insertions(+) Index: linux-3.18-rc1

[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 mpato...@redhat.com --- drivers/scsi/sd.c | 35 +++ 1 file changed, 35 insertions(+) Index: linux-3.18-rc1/drivers/scsi/sd.c

[PATCH 12/18] dm: implement copy

2014-10-22 Thread Mikulas Patocka
-off-by: Mikulas Patocka mpato...@redhat.com --- 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

[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 mpato...@redhat.com --- drivers/md/dm-linear.c |1 + 1 file changed, 1 insertion(+) Index: linux-3.16-rc4/drivers/md/dm-linear.c === --- linux-3.16

[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 mpato...@redhat.com --- drivers/md/dm-stripe.c | 11 ++- 1 file

[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-by: Mikulas

[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 mpato...@redhat.com --- drivers/md/dm-kcopyd.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) Index: linux-3.16-rc5

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

2014-10-22 Thread Mikulas Patocka
. Signed-off-by: Mikulas Patocka mpato...@redhat.com --- 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

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

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

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=xcopyid=0bdeed274e16b3038a851552188512071974eea8) with some bug fixes, ported

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. Mikulas --

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

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 device mapper. The patchset

[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=xcopyid=0bdeed274e16b3038a851552188512071974eea8, but it is changed significantly so

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

2014-07-15 Thread Mikulas Patocka
that there 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 mpato...@redhat.com --- block/bio.c | 26 ++- block/blk-core.c | 34 block/blk-lib.c

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

2014-07-15 Thread Mikulas Patocka
-by: Mikulas Patocka mpato...@redhat.com --- Documentation/ABI/testing/sysfs-block |9 + block/bio.c |2 block/blk-core.c |5 block/blk-lib.c | 95 block/blk-merge.c |7 block

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

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

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

2014-07-15 Thread Mikulas Patocka
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: Mikulas Patocka mpato

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

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

[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 mpato...@redhat.com --- block/blk-lib.c | 152 -- block/ioctl.c |2 include/linux/blk_types.h |5 - include/linux/blkdev.h|2 4 files

[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 mpato...@redhat.com --- drivers/md/dm.c

[PATCH 7/15] dm: remove num_write_bios

2014-07-15 Thread Mikulas Patocka
, but 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 Patocka mpato

[PATCH 9/15] dm: implement copy

2014-07-15 Thread Mikulas Patocka
-off-by: Mikulas Patocka mpato...@redhat.com --- 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

[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 mpato...@redhat.com --- drivers/md/dm-linear.c |1 + 1 file changed, 1 insertion(+) Index: linux-3.16-rc4/drivers/md/dm-linear.c === --- linux-3.16

[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 mpato...@redhat.com --- drivers/md/dm-stripe.c | 11 ++- 1 file

[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-by: Mikulas

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

2014-07-15 Thread Mikulas Patocka
. Signed-off-by: Mikulas Patocka mpato...@redhat.com --- 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

[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 mpato...@redhat.com --- drivers/md/dm-kcopyd.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) Index: linux-3.16-rc5

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

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

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

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 BLKZEROOUT ioctl). The crash

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 events happen: * iscsit_del_np is called

[PATCH] target: fix deadlock on unload

2014-06-23 Thread Mikulas Patocka
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 mpato...@redhat.com Cc: sta...@vger.kernel.org --- drivers

[PATCH] target: fix memory leak on XCOPY

2014-05-17 Thread Mikulas Patocka
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 mpato...@redhat.com Cc: sta...@vger.kernel.org # 3.12+ --- drivers

[PATCH] kref: warn on uninitialized kref

2014-05-17 Thread Mikulas Patocka
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 mpato...@redhat.com --- include/linux/kref.h |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: linux-3.15

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 called

[PATCH v2] kref: warn on uninitialized kref

2014-05-17 Thread Mikulas Patocka
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 mpato...@redhat.com --- include/linux/kref.h |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) Index: linux-3.15

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_spinlock_irqsave was called which

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 the patch that I sent, that prevents

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 backing

[PATCH] block devices: validate block device capacity

2014-01-30 Thread Mikulas Patocka
and modifies the drivers brd, ide-gd, dm, sd to use it. Signed-off-by: Mikulas Patocka mpato...@redhat.com --- block/genhd.c | 23 +++ drivers/block/brd.c | 15 +++ drivers/ide/ide-gd.c |8 drivers/md/dm-ioctl.c

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 unsigned

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 bit offsets for block devices on 32 bit. It sounds like

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 filesystems

[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 mpato...@redhat.com Cc: sta...@vger.kernel.org --- drivers/scsi/sg.c |2 ++ 1 file changed, 2 insertions(+) Index: linux-3.13/drivers/scsi/sg.c

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 mpato...@redhat.com Cc: sta...@vger.kernel.org

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. Signed-off-by: Mikulas Patocka mpato

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. Signed-off-by: Mikulas Patocka mpato

[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 mpato...@redhat.com 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

[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 mpato...@redhat.com --- arch/ia64/hp/sim/simscsi.c | 34 ++ 1 file changed, 2 insertions(+), 32 deletions(-) Index: linux-2.6-ia64/arch/ia64/hp/sim

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 snit...@redhat.com 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 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 the tip

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 mpato...@redhat.com wrote: 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

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

2013-04-05 Thread Mikulas Patocka
micha...@cs.wisc.edu 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 device and path failure happens at the same time. I think

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

2013-04-02 Thread Mikulas Patocka
concurrently. This patch adds a mutex to fix the race. Signed-off-by: Mikulas Patocka mpato...@redhat.com --- 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_emc.c

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

2013-02-26 Thread Mikulas Patocka
Acked-by: Mikulas Patocka mpato...@redhat.com 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:[810fe754] [810fe754