block: revert "block: fix bd_size_lock use"
authorDamien Le Moal <damien.lemoal@wdc.com>
Mon, 1 Mar 2021 03:04:02 +0000 (12:04 +0900)
committerJens Axboe <axboe@kernel.dk>
Mon, 1 Mar 2021 03:12:02 +0000 (20:12 -0700)
With the removal of the skd driver, using IRQ safe locking of a bdev
bd_size_lock spinlock to protect the bdev inode size is not necessary
anymore as there is no other known driver using this lock under an IRQ
disabled context (e.g. calling set_capacity() with IRQ disabled).
Revert commit 0fe37724f8e7 ("block: fix bd_size_lock use") which
introduced the IRQ safe change.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c
block/partitions/core.c

index fcc5301..c55e8f0 100644 (file)
@@ -45,11 +45,10 @@ static void disk_release_events(struct gendisk *disk);
 void set_capacity(struct gendisk *disk, sector_t sectors)
 {
        struct block_device *bdev = disk->part0;
-       unsigned long flags;
 
-       spin_lock_irqsave(&bdev->bd_size_lock, flags);
+       spin_lock(&bdev->bd_size_lock);
        i_size_write(bdev->bd_inode, (loff_t)sectors << SECTOR_SHIFT);
-       spin_unlock_irqrestore(&bdev->bd_size_lock, flags);
+       spin_unlock(&bdev->bd_size_lock);
 }
 EXPORT_SYMBOL(set_capacity);
 
index f3d9ff2..1a75589 100644 (file)
@@ -88,11 +88,9 @@ static int (*check_part[])(struct parsed_partitions *) = {
 
 static void bdev_set_nr_sectors(struct block_device *bdev, sector_t sectors)
 {
-       unsigned long flags;
-
-       spin_lock_irqsave(&bdev->bd_size_lock, flags);
+       spin_lock(&bdev->bd_size_lock);
        i_size_write(bdev->bd_inode, (loff_t)sectors << SECTOR_SHIFT);
-       spin_unlock_irqrestore(&bdev->bd_size_lock, flags);
+       spin_unlock(&bdev->bd_size_lock);
 }
 
 static struct parsed_partitions *allocate_partitions(struct gendisk *hd)