Skip to content

Commit 7370997

Browse files
Christoph Hellwigaxboe
authored andcommitted
partitions/ibm: fix non-DASD devices
Don't error out if the dasd_biodasdinfo symbol is not available. Cc: [email protected] Fixes: 26d7e28 ("s390/dasd: remove ioctl_by_bdev calls") Reported-by: Christian Borntraeger <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> Tested-by: Christian Borntraeger <[email protected]> Reviewed-by: Stefan Haberland <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 6d53a9f commit 7370997

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

block/partitions/ibm.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -305,8 +305,6 @@ int ibm_partition(struct parsed_partitions *state)
305305
if (!disk->fops->getgeo)
306306
goto out_exit;
307307
fn = symbol_get(dasd_biodasdinfo);
308-
if (!fn)
309-
goto out_exit;
310308
blocksize = bdev_logical_block_size(bdev);
311309
if (blocksize <= 0)
312310
goto out_symbol;
@@ -326,7 +324,7 @@ int ibm_partition(struct parsed_partitions *state)
326324
geo->start = get_start_sect(bdev);
327325
if (disk->fops->getgeo(bdev, geo))
328326
goto out_freeall;
329-
if (fn(disk, info)) {
327+
if (!fn || fn(disk, info)) {
330328
kfree(info);
331329
info = NULL;
332330
}
@@ -370,7 +368,8 @@ int ibm_partition(struct parsed_partitions *state)
370368
out_nogeo:
371369
kfree(info);
372370
out_symbol:
373-
symbol_put(dasd_biodasdinfo);
371+
if (fn)
372+
symbol_put(dasd_biodasdinfo);
374373
out_exit:
375374
return res;
376375
}

0 commit comments

Comments
 (0)