Re: Question on handling managed IRQs when hotplugging CPUs

2019-02-06 Thread Benjamin Block
amp;m=154831889001973&w=2 discusses some of them > also. > Especially the TMFs send via SCSI EH are a bit of a pain I guess, because they are entirely managed by the device drivers, but depending on the device driver they might not even qualify for the problem Hannes is seeing. -- With Best Rega

Re: [PATCH v4 0/6] Avoid that scsi-mq and dm-mq queue processing stalls sporadically

2017-04-12 Thread Benjamin Block
ar stuff happening. Beste Grüße / Best regards, - Benjamin Block -- Linux on z Systems Development / IBM Systems & Technology Group IBM Deutschland Research &

Re: [PATCH v4 0/6] Avoid that scsi-mq and dm-mq queue processing stalls sporadically

2017-04-13 Thread Benjamin Block
On Wed, Apr 12, 2017 at 06:11:25PM +, Bart Van Assche wrote: > On Wed, 2017-04-12 at 12:55 +0200, Benjamin Block wrote: > > On Fri, Apr 07, 2017 at 11:16:48AM -0700, Bart Van Assche wrote: > > > The six patches in this patch series fix the queue lockup I reported > >

Re: [PATCH 5/8] bsg: refactor bsg_ioctl

2018-11-13 Thread Benjamin Block
> 1 file changed, 72 insertions(+), 86 deletions(-) > Looks fine to me. Did ran the same small test-tool I ran against Jens' patches, nothing broke. Reviewed-by: Benjamin Block Tested-by: Benjamin Block -- With Best Regards, Benjamin Block / Linux on IBM Z Kernel Develop

Re: [PATCH 6/8] bsg-lib: handle bidi requests without block layer help

2018-11-13 Thread Benjamin Block
every using them? That seems wrong to me. There is other SCSI Command Sets than OSD that provide bidirectional commands, even SBC has some (i.e. X*WRITE*, COMPARE AND WRITE). -- With Best Regards, Benjamin Block / Linux on IBM Z Kernel Development IBM Systems & Technol

Re: [PATCH 6/8] bsg-lib: handle bidi requests without block layer help

2018-11-14 Thread Benjamin Block
On Wed, Nov 14, 2018 at 04:48:57PM +0100, Christoph Hellwig wrote: > On Tue, Nov 13, 2018 at 03:35:20PM +0100, Benjamin Block wrote: > > This seems like a non-obvious user-breakage. So apart from removing the > > in-kernel stuff that uses bidirectional commands you also forbid >

Re: bug: using smp_processor_id() in preemptible code in rr_select_path()

2016-08-07 Thread Benjamin Block
/2016 09:27 AM, Mike Snitzer wrote: > > >>>On Wed, Aug 03 2016 at 11:35am -0400, > > >>>Benjamin Block wrote: > > >>> > > >>>>Hej Mike, > > >>>> > > >>>>when running a debug-kernel today with severa

Re: [dm-devel] bug: using smp_processor_id() in preemptible code in rr_select_path()

2016-08-08 Thread Benjamin Block
/2016 09:27 AM, Mike Snitzer wrote: > > >>>On Wed, Aug 03 2016 at 11:35am -0400, > > >>>Benjamin Block wrote: > > >>> > > >>>>Hej Mike, > > >>>> > > >>>>when running a debug-kernel today with severa

Re: [dm-devel] bug: using smp_processor_id() in preemptible code in rr_select_path()

2016-08-08 Thread Benjamin Block
On 10:39 Mon 08 Aug , Jens Axboe wrote: > On 08/08/2016 10:32 AM, Benjamin Block wrote: > >On 12:06 Fri 05 Aug , Mike Snitzer wrote: > >>On Fri, Aug 05 2016 at 11:54am -0400, > >>Jens Axboe wrote: > >> > >>>On 08/05/2016 09:42 AM, Mike Sn

Re: [PATCH 9/9] bsg: split handling of SCSI CDBs vs transport requeues

2017-10-19 Thread Benjamin Block
ex 736a1f4f9676..4889bd432382 100644 > --- a/drivers/scsi/scsi_transport_sas.c > +++ b/drivers/scsi/scsi_transport_sas.c > @@ -228,7 +228,6 @@ static int sas_bsg_initialize(struct Scsi_Host *shost, > struct sas_rphy *rphy) >*/ > blk_queue_bounce_limit(q, BLK_BOUNCE_

Re: [PATCH 9/9] bsg: split handling of SCSI CDBs vs transport requeues

2017-10-20 Thread Benjamin Block
On Fri, Oct 20, 2017 at 06:26:30PM +0200, Christoph Hellwig wrote: > On Thu, Oct 19, 2017 at 05:59:33PM +0200, Benjamin Block wrote: > > > +#define ptr64(val) ((void __user *)(uintptr_t)(val)) > > > > Better to reflect the special property, that it is a user pointer, in &

Re: [PATCH 9/9] bsg: split handling of SCSI CDBs vs transport requeues

2017-10-24 Thread Benjamin Block
n the source. Driver makes use of it, but only reading as far as I could make out after browsing the code for a bit. I did a quick test with that change in place and that seems to work fine now. As far as my tests go, they behave as they did before.

[RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-09 Thread Benjamin Block
(null) INFO: lockdep is turned off. Last Breaking-Event-Address: [<03ff801e41d6>] zfcp_fc_ct_job_handler+0x3e/0x48 [zfcp] Kernel panic - not syncing: Fatal exception in interrupt To prevent this, allocate a buffer when the BSG blk-request is setup, and before it is queued for LLD processi

[RFC PATCH 6/6] bsg: reduce unnecessary arguments for blk_complete_sgv4_hdr_rq()

2017-08-09 Thread Benjamin Block
Since struct bsg_command is now used in every calling case, we don't need separation of arguments anymore that are contained in the same bsg_command. Signed-off-by: Benjamin Block --- block/bsg.c | 20 +--- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/

[RFC PATCH 4/6] bsg: refactor ioctl to use regular BSG-command infrastructure for SG_IO

2017-08-09 Thread Benjamin Block
SG_IO. A complete unification is not possible, as it then would also enqueue SG_IO commands in the BGS devices's command list, but this is only for the read- and write-calls. Signed-off-by: Benjamin Block --- block/bsg.c | 60 1 fi

[RFC PATCH 5/6] bsg: reduce unnecessary arguments for bsg_map_hdr()

2017-08-09 Thread Benjamin Block
Since struct bsg_command is now used in every calling case, we don't need separation of arguments anymore that are contained in the same bsg_command. Signed-off-by: Benjamin Block --- block/bsg.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/block/bs

[RFC PATCH 3/6] bsg: scsi-transport: add compile-tests to prevent reply-buffer overflows

2017-08-09 Thread Benjamin Block
. To make it easier to notice accidental violations add an explicit compile- time check that tests whether the implementations' reply buffer is at most as large as bsg_job's. To do so, we have to move the size-define from bsg.c to a common header. Signed-off-by: Benjamin Blo

[RFC PATCH 0/6] bsg: fix regression resulting in panics when sending commands via BSG and some sanity cleanups

2017-08-09 Thread Benjamin Block
390/zfcp-hbaapi.html) and some custom code to test the read/write interface of BSG. Reviews are more than welcome :) Beste Grüße / Best regards, - Benjamin Block Benjamin Block (6): bsg: fix kernel

[RFC PATCH 2/6] bsg: assign sense_len instead of fixed SCSI_SENSE_BUFFERSIZE

2017-08-09 Thread Benjamin Block
ply. * * ... */ Signed-off-by: Benjamin Block --- block/bsg-lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/bsg-lib.c b/block/bsg-lib.c index c4513b23f57a..c7c2c6bbb5ae 100644 --- a/block/bsg-lib.c +++ b/block/bsg-lib.c @@ -147,8 +147,8 @@ static int bsg_create_

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-10 Thread Benjamin Block
uld be best if we fix the possible panics every user of this is gonna experience and after that we can still think about improving it further beyond what the rest of the patch set already does, if that is necessary. Beste Grüße / Best regard

Re: [RFC PATCH 4/6] bsg: refactor ioctl to use regular BSG-command infrastructure for SG_IO

2017-08-10 Thread Benjamin Block
On Thu, Aug 10, 2017 at 10:24:56AM +0200, Johannes Thumshirn wrote: > On Wed, Aug 09, 2017 at 04:11:18PM +0200, Benjamin Block wrote: > > + return 0 == (bc->hdr.flags & BSG_FLAG_Q_AT_TAIL); > > return !(bc->hdr.flags & BSG_FLAG_Q_AT_TAIL); and make the function r

Re: [RFC PATCH 5/6] bsg: reduce unnecessary arguments for bsg_map_hdr()

2017-08-10 Thread Benjamin Block
On Thu, Aug 10, 2017 at 11:35:31AM +0200, Christoph Hellwig wrote: > On Wed, Aug 09, 2017 at 04:11:19PM +0200, Benjamin Block wrote: > > Since struct bsg_command is now used in every calling case, we don't > > need separation of arguments anymore that are contained in the

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-10 Thread Benjamin Block
On Fri, Aug 11, 2017 at 12:10:38AM +0200, Benjamin Block wrote: > On Thu, Aug 10, 2017 at 11:32:17AM +0200, Christoph Hellwig wrote: > > We can't use an on-stack buffer for the sense data, as drivers will > > dma to it. So we should reuse the SCSI init_rq_fn() for the B

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-11 Thread Benjamin Block
n Sep 17 00:00:00 2001 > From: Christoph Hellwig > Date: Fri, 11 Aug 2017 11:03:29 +0200 > Subject: bsg-lib: allocate sense data for each request > > Since we split the scsi_request out of the request the driver is supposed > to provide storage fo

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-11 Thread Benjamin Block
On Fri, Aug 11, 2017 at 04:36:49PM +0200, Christoph Hellwig wrote: > On Fri, Aug 11, 2017 at 03:49:29PM +0200, Benjamin Block wrote: > > On Fri, Aug 11, 2017 at 11:14:15AM +0200, Christoph Hellwig wrote: > > > But patch 1 still creates an additional copy of the sense data for &

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-11 Thread Benjamin Block
On Fri, Aug 11, 2017 at 05:35:53PM +0200, Christoph Hellwig wrote: > On Fri, Aug 11, 2017 at 05:32:03PM +0200, Benjamin Block wrote: > > So when the bsg interface is used with something different than the > > bsg-lib request queue? > > Yes. > > > I haven't act

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-14 Thread Benjamin Block
ta, which is used as reply buffer in bsg. > > Reported-by: Steffen Maier > Signed-off-by: Benjamin Block > Fixes: 82ed4db499b8 ("block: split scsi_request out of struct request") > Cc: #4.11+ > --- > block/bsg-lib.c | 51 > +++

Re: [RFC PATCH 1/6] bsg: fix kernel panic resulting from missing allocation of a reply-buffer

2017-08-14 Thread Benjamin Block
On Sun, Aug 13, 2017 at 04:39:40PM +0200, Christoph Hellwig wrote: > On Fri, Aug 11, 2017 at 06:01:42PM +0200, Benjamin Block wrote: > > When the BSG interface is used with bsg-lib, and the user sends a > > Bidirectional command - so when he gives an input- and output-buffer > &g

[PATCH v2 0/1] bsg: fix regression resulting in panics when sending commands via BSG

2017-08-23 Thread Benjamin Block
' for-next. Reviews are more than welcome :) Beste Grüße / Best regards, - Benjamin Block Benjamin Block (1): bsg-lib: fix kernel panic resulting from missing allocation of reply

[PATCH v2 1/1] bsg-lib: fix kernel panic resulting from missing allocation of reply-buffer

2017-08-23 Thread Benjamin Block
n of a buffer for the reply-data. This means, struct bsg_job is not allocated separately anymore, but as part of struct request allocation - similar to struct scsi_cmd. Reflect this in the function names that used to handle creation/destruction of struct bsg_job. Reported-by: Steffen Maier Suggested-

Re: [PATCH v2 1/1] bsg-lib: fix kernel panic resulting from missing allocation of reply-buffer

2017-08-24 Thread Benjamin Block
t doesn't really itself destroy the job-struct anymore. If there are other thing amiss I can change that along with them, if it bothers poeple. Beste Grüße / Best regards, - Benjamin Block

Re: [PATCH 1/2] bsg-lib: fix kernel panic resulting from missing allocation of reply-buffer

2017-09-06 Thread Benjamin Block
On Wed, Sep 06, 2017 at 08:07:43AM -0600, Jens Axboe wrote: > On 09/06/2017 07:44 AM, Christoph Hellwig wrote: > > From: Benjamin Block > > > > Since we split the scsi_request out of struct request bsg fails to > > provide a reply-buffer for the drivers. This was d

Is the possible cross-talking between unrelated file-descriptors on bsg-device by design?

2017-09-19 Thread Benjamin Block
ng talk short question, is that intended? Beste Grüße / Best regards, - Benjamin Block -- Linux on z Systems Development / IBM Systems & Technology Group IBM Deutschland Research & Deve

[PATCH 1/1] bsg-lib: fix use-after-free under memory-pressure

2017-09-21 Thread Benjamin Block
ssing allocation of reply-buffer") Cc: # 4.11+ Signed-off-by: Benjamin Block --- Notes: I did test this on zFCP with FC CT commands send via the ioctl() and write() system-call. That did work fine. But I would very much appreciate if anyone could run this against an other HBA or e

Re: Is the possible cross-talking between unrelated file-descriptors on bsg-device by design?

2017-09-21 Thread Benjamin Block
On Tue, Sep 19, 2017 at 02:16:26PM -0400, Douglas Gilbert wrote: > On 2017-09-19 10:56 AM, Benjamin Block wrote: > > Hello linux-block, > > > > I wrote some tests recently to test patches against bsg.c and bsg-lib.c, > > and while writing those I noticed something str

Re: [PATCH 1/1] bsg-lib: fix use-after-free under memory-pressure

2017-09-25 Thread Benjamin Block
g names and name the new helper bsg_initialize_rq; > OK, I can change that. Beste Grüße / Best regards, - Benjamin Block > > Except for that the patch looks fine to me: > > Reviewed-by: Christoph Hellwig > -- Linux on

[PATCH v2 1/1] bsg-lib: fix use-after-free under memory-pressure

2017-10-01 Thread Benjamin Block
iously done in bsg_init_rq(), and will also do it when the request is taken from the emergency-pool of the backing mempool. Fixes: 50b4d485528d ("bsg-lib: fix kernel panic resulting from missing allocation of reply-buffer") Cc: # 4.11+ Reviewed-by: Christoph Hellwig Signed-off-

Re: [PATCH 6/9] bsg-lib: introduce a timeout field in struct bsg_job

2017-10-16 Thread Benjamin Block
x b1be0233ce35..402223c95ce1 100644 > --- a/include/linux/bsg-lib.h > +++ b/include/linux/bsg-lib.h > @@ -44,6 +44,8 @@ struct bsg_job { > > struct kref kref; > > + unsigned int timeout; > + > /* Transpo

Re: [PATCH 7/9] bsg-lib: remove bsg_job.req

2017-10-16 Thread Benjamin Block
g-lib.h b/include/linux/bsg-lib.h > index 402223c95ce1..08762d297cbd 100644 > --- a/include/linux/bsg-lib.h > +++ b/include/linux/bsg-lib.h > @@ -40,7 +40,6 @@ struct bsg_buffer { > struct bsg_job { > struct scsi_request sreq; > struct device *dev; > - stru

Re: [PATCH 8/9] block: pass full fmode_t to blk_verify_command

2017-10-16 Thread Benjamin Block
mand(cmd, filp->f_mode & FMODE_WRITE); > + return blk_verify_command(cmd, filp->f_mode); > } > > static int > diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h > index 02fa42d24b52..75fe9d45ead1 100644 > --- a/include/linux/blkdev.h > +++ b/inc

Re: [PATCH] block: free sched's request pool in blk_cleanup_queue

2019-06-06 Thread Benjamin Block
Fatal exception: panic_on_oops run blktests block/003 at 2019-06-06 14:44:56 When I tried to reproduced this with this patch, it went away (at least all of blktest/block ran w/o crash). I don't feel competent enough to review this patch right now, but it would be good if we get somethin

Re: [PATCH V2 0/2] block/scsi/dm-rq: fix leak of request private data in dm-mpath

2019-07-26 Thread Benjamin Block
, see the following link: > > https://lore.kernel.org/linux-block/f122e8f2-5ede-2d83-9ca0-bc713ce66...@huawei.com/T/#t > > V2: > - run .cleanup_rq() in blk_mq_free_request(), as suggested by Mike -- With Best Regards, Benjamin Block / Linux on IBM Z Kernel Development IBM Syste