diff options
author | Horst Hummel <horst.hummel@de.ibm.com> | 2005-09-04 02:57:58 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 11:06:26 +0400 |
commit | c6eb7b7703ac4b3401b74f411c8c51ded214bf19 (patch) | |
tree | 1cb3563cb83f80347dbc3e4bd30c4635d401e87a /drivers/s390/block/dasd_ioctl.c | |
parent | 942eaabd5d77522223a311ed9bddaaa3cefde27d (diff) | |
download | linux-c6eb7b7703ac4b3401b74f411c8c51ded214bf19.tar.xz |
[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 <horst.hummel@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/block/dasd_ioctl.c')
-rw-r--r-- | drivers/s390/block/dasd_ioctl.c | 17 |
1 files changed, 5 insertions, 12 deletions
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..: <Linux390@de.ibm.com> * (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); |