On 7/14/20 2:03 PM, Stefan Haberland wrote: > During initialization of the DASD DIAG driver a request is issued > that has a bio structure that resides on the stack. With virtually > mapped kernel stacks this bio address might be in virtual storage > which is unsuitable for usage with the diag250 call. > In this case the device can not be set online using the DIAG > discipline and fails with -EOPNOTSUP. > In the system journal the following error message is presented: > > dasd: X.X.XXXX Setting the DASD online with discipline DIAG failed > with rc=-95 > > Fix by allocating the bio structure instead of having it on the stack. > > Fixes: ce3dc447493f ("s390: add support for virtually mapped kernel stacks") > Cc: stable@xxxxxxxxxxxxxxx #4.20 > Signed-off-by: Stefan Haberland <sth@xxxxxxxxxxxxx> > Reviewed-by: Peter Oberparleiter <oberpar@xxxxxxxxxxxxx> > --- > drivers/s390/block/dasd_diag.c | 25 +++++++++++++++++-------- > 1 file changed, 17 insertions(+), 8 deletions(-) > > diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c > index facb588d09e4..069d6b39cacf 100644 > --- a/drivers/s390/block/dasd_diag.c > +++ b/drivers/s390/block/dasd_diag.c > @@ -319,7 +319,7 @@ dasd_diag_check_device(struct dasd_device *device) > struct dasd_diag_characteristics *rdc_data; > struct vtoc_cms_label *label; > struct dasd_block *block; > - struct dasd_diag_bio bio; > + struct dasd_diag_bio *bio; > unsigned int sb, bsize; > blocknum_t end_block; > int rc; > @@ -395,29 +395,36 @@ dasd_diag_check_device(struct dasd_device *device) > rc = -ENOMEM; > goto out; > } > + bio = kzalloc(sizeof(*bio), GFP_KERNEL); > + if (bio == NULL) { > + DBF_DEV_EVENT(DBF_WARNING, device, "%s", > + "No memory to allocate initialization bio"); > + rc = -ENOMEM; > + goto out_label; > + } Just curious, any reason this isn't just using bio_alloc()? -- Jens Axboe