s390/dasd: Fix the leak of references on DASD discipline module
Subsystems (3)
PATCH 1/1 s390/dasd: Fix the leak of references on DASD discipline module
In dasd_destroy_partitions() instead of fput() use its synchronous version __fput_sync(). Otherwise, dasd_delete_device() can be called before dasd_release(), which makes the last one not release the captured resources, as the associated dasd_device doesn't longer exist. In particular, the reference to dasd_eckd_mod is not dropped, reasons why the module cannot be unloaded.
Steps to reproduce the problem:
\# lsmod | grep dasddasd_eckd_mod 180224 0
\# echo 1 > /sys/bus/ccw/devices/0.0.ef01/online
\# echo 0 > /sys/bus/ccw/devices/0.0.ef01/online
\# lsmod | grep dasddasd_eckd_mod 180224 1
Fixes c8e108d80cd8 ("s390: port block device access to file")
Reviewed-by Stefan Haberland <[email protected]>
Tested-by Volkan Unal <[email protected]>
Signed-off-by Eduard Shishkin <[email protected]>
--- drivers/s390/block/dasd_genhd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/s390/block/dasd_genhd.c +1 -1
@@ -213,7 +213,7 @@ void dasd_destroy_partitions(struct dasd_block *block)mutex_unlock (&file_bdev (bdev_file)->bd_disk->open_mutex);/* Matching blkdev_put to the blkdev_get in dasd_scan_partitions. */ -fput (bdev_file); +__fput_sync (bdev_file); }int dasd_gendisk_init (void )
Signature · 1 line
2.48.1