Re: [PATCH 13/20] scsi: zfcp: Manual replacement of the deprecated strlcpy() with return values

2021-02-22 Thread Benjamin Block
rspn_req->rspn.fr_name_len = FC_SYMBOLIC_NAME_SIZE - 1; else rspn_req->rspn.fr_name_len = len; > > sg_init_one(&fc_req->sg_req, rspn_req, sizeof(*rspn_req)); > sg_init_one(&fc_req->sg_rsp, rspn_rsp, sizeof(*rspn_

Re: [PATCH v2] scsi: zfcp: move the position of put_device

2020-12-14 Thread Benjamin Block
ject in both functions. > > And add comments after put_device to make codes clearer. > > Suggested-by: Steffen Maier > Suggested-by: Benjamin Block > Signed-off-by: Qinglang Miao > --- > v2: add comments after put_device as Steffen suggested. > > drivers/s390/scsi/

Re: [PATCH] scsi: zfcp: fix use-after-free in zfcp_unit_remove

2020-11-26 Thread Benjamin Block
On Thu, Nov 26, 2020 at 08:07:32PM +0800, Qinglang Miao wrote: > 在 2020/11/26 17:42, Benjamin Block 写道: > > On Thu, Nov 26, 2020 at 09:13:53AM +0100, Cornelia Huck wrote: > > > On Thu, 26 Nov 2020 09:27:41 +0800 > > > Qinglang Miao wrote: > > > > 在 2020/11/2

Re: [PATCH] scsi: zfcp: fix use-after-free in zfcp_unit_remove

2020-11-26 Thread Benjamin Block
On Thu, Nov 26, 2020 at 09:13:53AM +0100, Cornelia Huck wrote: > On Thu, 26 Nov 2020 09:27:41 +0800 > Qinglang Miao wrote: > > > 在 2020/11/26 1:06, Benjamin Block 写道: > > > On Fri, Nov 20, 2020 at 03:48:54PM +0800, Qinglang Miao wrote: > > >> kfree(port) is

Re: [PATCH] scsi: zfcp: fix use-after-free in zfcp_unit_remove

2020-11-25 Thread Benjamin Block
gt; } > > - put_device(&unit->dev); > - > device_unregister(&unit->dev); > > return 0; Same as in the other mail for `zfcp_sysfs_port_remove_store()`. We explicitly get a new ref in `_zfcp_unit_find()`, so we also need to put that away again.

Re: [PATCH] scsi: zfcp: fix use-after-free in zfcp_sysfs_port_remove_store

2020-11-25 Thread Benjamin Block
is indeed strange, now that I think about it. But just removing it and then having a dangling reference also seems wrong - we do get one explicitly in `zfcp_get_port_by_wwpn()`. My first thought would be to move it after the `device_unregister()` call, and before the `out:` label. -- Best Regards, B

Re: [PATCH 2/2] scsi: register sysfs for scsi/iscsi workqueues

2020-06-23 Thread Benjamin Block
lun. > > It looks ok if those are not ordered, but I would get their review to make > sure. I am not aware of any temporal requirements of those LUN-scans, so I think making them not explicitly ordered shouldn't hurt us. The target scan itself is protected again by `shost->scan_mut

[PATCH v2 1/2] scsi: replace GFP_ATOMIC with GFP_KERNEL for allocations in scsi_scan.c

2019-02-21 Thread Benjamin Block
ances of reclaim. Signed-off-by: Benjamin Block --- drivers/scsi/scsi_scan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index dd0d516f65e2..53380e07b40e 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers

[PATCH v2 2/2] scsi: whitespace cleanup in scsi_scan.c

2019-02-21 Thread Benjamin Block
Noticed during editing that vim would remove some trailing spaces. Signed-off-by: Benjamin Block --- drivers/scsi/scsi_scan.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 53380e07b40e..7e1a6c3dd42c

Re: [PATCH] scsi: replace GFP_ATOMIC with GFP_KERNEL for sdev allocation

2019-02-20 Thread Benjamin Block
On Wed, Feb 20, 2019 at 11:11:31AM -0800, Bart Van Assche wrote: > On Wed, 2019-02-20 at 19:48 +0100, Benjamin Block wrote: > > We had a test-report where, under memory pressure, adding LUNs to the > > systems would fail (the tests add LUNs strictly in sequence): > > Hi Ben

[PATCH] scsi: replace GFP_ATOMIC with GFP_KERNEL for sdev allocation

2019-02-20 Thread Benjamin Block
es no sleeping, as far as I could see. Additionally, the code that allocates the block queue for the device later (scsi_mq_alloc_queue()) already uses GFP_KERNEL. So replace it, and give the allocation a bit of a better chance to succeed, with more ways of reclaim. Signed-off-by: Benjamin

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] s390: zfcp_aux: remove unnecessary null pointer check before mempool_destroy

2018-09-09 Thread Benjamin Block
mempool_destroy(adapter->pool.erp_req); > + mempool_destroy(adapter->pool.scsi_req); > + mempool_destroy(adapter->pool.scsi_abort); > + mempool_destroy(adapter->pool.qtcb_pool); > + mempool_destroy(adapter->pool.status_read_req); > + mempool_destroy(adapter->pool.sr_

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

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

[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

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

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

[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_

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

[PATCH] MAINTAINERS: Add myself to S390 ZFCP DRIVER as a co-maintainer

2017-07-28 Thread Benjamin Block
I have been working with Steffen on zFCP for quite a while now and we decided adding me as a co-maintainer might be a good thing. Acked-by: Steffen Maier Signed-off-by: Benjamin Block --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index

Re: A bug in scsi_alloc_target of drivers/scsi/scsi_scan.c

2017-05-16 Thread Benjamin Block
ed in 12fb8c1574d7d in 2010, see the commit message there. Beste Grüße / Best regards, - Benjamin Block > > diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c > index 81d

Re: [PATCH 21/29] drivers, s390: convert fc_fcp_pkt.ref_cnt from atomic_t to refcount_t

2017-03-06 Thread Benjamin Block
Yes please, I was extremely confused for a moment here. Beste Grüße / Best regards, - Benjamin Block -- Linux on z Systems Development / IBM Systems & Technology Group IBM Deutschland Rese

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: [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: 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: [PATCH] SCSI-zfcp: Delete unnecessary checks before the function call "mempool_destroy"

2015-12-04 Thread Benjamin Block
_destroy(adapter->pool.scsi_abort); > + mempool_destroy(adapter->pool.qtcb_pool); > + mempool_destroy(adapter->pool.status_read_req); > + mempool_destroy(adapter->pool.sr_data); > + mempool_destroy(adapter->pool.gid_pn); > } > >

Re: [PATCH] ACPI: Run fixed button devices' notify callback in the process context

2014-08-22 Thread Benjamin Block
On 08/22/2014 07:33 PM, Rafael J. Wysocki wrote: > On Friday, August 22, 2014 03:37:55 PM Lan Tianyu wrote: >> Currently fixed button devices' notify callbacks are running in the >> interrupt context. It's not necessary and prevent calling functions >> with mutex lock(E,G evaluating ACPI method). O

Re: BUG: lockdep (inconsistent usage) in netlink

2014-08-21 Thread Benjamin Block
On 08/21/2014 08:52 PM, Benjamin Block wrote: > Hello, > > while rebooting one of my dev-machines I stumbled over this > lockdep-mess-up: > >> = >> [ INFO: inconsistent lock state ] >> 3.17.0-rc1-1-g

BUG: lockdep (inconsistent usage) in netlink

2014-08-21 Thread Benjamin Block
looks all to be very general functions and my best guess is, netlink_poll() needs to be irq-save. Thing is, the corresponding code is quite old and I can't really bisec it, because the none-reproducibility. There is only the small ipv6-fib patch applied, I send in earlier today (https://lkml.org/lk

[PATCH v2] net: ipv6: fib: don't sleep inside atomic lock

2014-08-21 Thread Benjamin Block
x185/0x220 > [] ? mutex_unlock+0xe/0x10 > [] ? netlink_insert+0xbc/0xe0 > [] ? netlink_autobind.isra.30+0x125/0x150 > [] ? netlink_autobind.isra.30+0x60/0x150 > [] ? netlink_bind+0x159/0x230 > [] ? might_fault+0x5a/0xb0 > [] ? SYSC_bind+0x7e/0xd0 > [] __sys_sendmsg+0x4d/0x80 > [] S

Re: [PATCH] net: ipv6: fib: don't sleep inside atomic lock

2014-08-21 Thread Benjamin Block
On 14:54 Thu 21 Aug , Hannes Frederic Sowa wrote: > On Mi, 2014-08-20 at 18:16 +0200, Benjamin Block wrote: > > The function fib6_commit_metrics() allocates a piece of memory in mode > > GFP_KERNEL while holding an atomic lock from higher up in the stack, in > > the

[PATCH] net: ipv6: fib: don't sleep inside atomic lock

2014-08-20 Thread Benjamin Block
x185/0x220 > [] ? mutex_unlock+0xe/0x10 > [] ? netlink_insert+0xbc/0xe0 > [] ? netlink_autobind.isra.30+0x125/0x150 > [] ? netlink_autobind.isra.30+0x60/0x150 > [] ? netlink_bind+0x159/0x230 > [] ? might_fault+0x5a/0xb0 > [] ? SYSC_bind+0x7e/0xd0 > [] __sys_sendmsg+0x4d/0x80 > [] S