From c6eb7b7703ac4b3401b74f411c8c51ded214bf19 Mon Sep 17 00:00:00 2001 From: Horst Hummel Date: Sat, 3 Sep 2005 15:57:58 -0700 Subject: [PATCH] s390: deadlock in dasd_devmap Reintroduce a read-only copy of the devmap features in the device struct. This is necessary to solve a deadlock on the dasd_devmap_lock which is acquired by dasd_get_features called from the dasd tasklet. The current implementation of devmap doesn't allow to call any devmap function from interrupt or softirq context. Signed-off-by: Horst Hummel Signed-off-by: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/block/dasd_ioctl.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'drivers/s390/block/dasd_ioctl.c') diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index 980c555aa538..789595b3fa09 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c @@ -7,7 +7,7 @@ * Bugreports.to..: * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 * - * $Revision: 1.45 $ + * $Revision: 1.47 $ * * i/o controls for the dasd driver. */ @@ -296,7 +296,6 @@ dasd_ioctl_format(struct block_device *bdev, int no, long args) { struct dasd_device *device; struct format_data_t fdata; - int feature_ro; if (!capable(CAP_SYS_ADMIN)) return -EACCES; @@ -308,10 +307,7 @@ dasd_ioctl_format(struct block_device *bdev, int no, long args) if (device == NULL) return -ENODEV; - feature_ro = dasd_get_feature(device->cdev, DASD_FEATURE_READONLY); - if (feature_ro < 0) - return feature_ro; - if (feature_ro) + if (device->features & DASD_FEATURE_READONLY) return -EROFS; if (copy_from_user(&fdata, (void __user *) args, sizeof (struct format_data_t))) @@ -384,7 +380,7 @@ dasd_ioctl_information(struct block_device *bdev, int no, long args) struct dasd_device *device; struct dasd_information2_t *dasd_info; unsigned long flags; - int rc, feature_ro; + int rc; struct ccw_device *cdev; device = bdev->bd_disk->private_data; @@ -394,10 +390,6 @@ dasd_ioctl_information(struct block_device *bdev, int no, long args) if (!device->discipline->fill_info) return -EINVAL; - feature_ro = dasd_get_feature(device->cdev, DASD_FEATURE_READONLY); - if (feature_ro < 0) - return feature_ro; - dasd_info = kmalloc(sizeof(struct dasd_information2_t), GFP_KERNEL); if (dasd_info == NULL) return -ENOMEM; @@ -427,7 +419,8 @@ dasd_ioctl_information(struct block_device *bdev, int no, long args) (dasd_check_blocksize(device->bp_block))) dasd_info->format = DASD_FORMAT_NONE; - dasd_info->features |= feature_ro; + dasd_info->features |= + ((device->features & DASD_FEATURE_READONLY) != 0); if (device->discipline) memcpy(dasd_info->type, device->discipline->name, 4); -- cgit v1.2.1