Skip to content

Commit 0f47227

Browse files
damien-lemoalaxboe
authored andcommitted
block: revert "block: fix bd_size_lock use"
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 0fe3772 ("block: fix bd_size_lock use") which introduced the IRQ safe change. Signed-off-by: Damien Le Moal <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent fe07bfd commit 0f47227

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

block/genhd.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ static void disk_release_events(struct gendisk *disk);
4545
void set_capacity(struct gendisk *disk, sector_t sectors)
4646
{
4747
struct block_device *bdev = disk->part0;
48-
unsigned long flags;
4948

50-
spin_lock_irqsave(&bdev->bd_size_lock, flags);
49+
spin_lock(&bdev->bd_size_lock);
5150
i_size_write(bdev->bd_inode, (loff_t)sectors << SECTOR_SHIFT);
52-
spin_unlock_irqrestore(&bdev->bd_size_lock, flags);
51+
spin_unlock(&bdev->bd_size_lock);
5352
}
5453
EXPORT_SYMBOL(set_capacity);
5554

block/partitions/core.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,9 @@ static int (*check_part[])(struct parsed_partitions *) = {
8888

8989
static void bdev_set_nr_sectors(struct block_device *bdev, sector_t sectors)
9090
{
91-
unsigned long flags;
92-
93-
spin_lock_irqsave(&bdev->bd_size_lock, flags);
91+
spin_lock(&bdev->bd_size_lock);
9492
i_size_write(bdev->bd_inode, (loff_t)sectors << SECTOR_SHIFT);
95-
spin_unlock_irqrestore(&bdev->bd_size_lock, flags);
93+
spin_unlock(&bdev->bd_size_lock);
9694
}
9795

9896
static struct parsed_partitions *allocate_partitions(struct gendisk *hd)

0 commit comments

Comments
 (0)