Skip to content

Commit 08f0677

Browse files
committed
Merge tag 'for-6.9/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
Pull device mapper fixes from Mike Snitzer: - Fix 6.9 regression so that DM device removal is performed synchronously by default. Asynchronous removal has always been possible but it isn't the default. It is important that synchronous removal be preserved, otherwise it is an interface change that breaks lvm2. - Remove errant semicolon in drivers/md/dm-vdo/murmurhash3.c * tag 'for-6.9/dm-fixes-3' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm: dm: restore synchronous close of device mapper block device dm vdo murmurhash: remove unneeded semicolon
2 parents 52034ca + 48ef0ba commit 08f0677

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

drivers/md/dm-vdo/murmurhash3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void murmurhash3_128(const void *key, const int len, const u32 seed, void *out)
137137
break;
138138
default:
139139
break;
140-
};
140+
}
141141
}
142142
/* finalization */
143143

drivers/md/dm.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ static struct table_device *open_table_device(struct mapped_device *md,
765765
return td;
766766

767767
out_blkdev_put:
768-
fput(bdev_file);
768+
__fput_sync(bdev_file);
769769
out_free_td:
770770
kfree(td);
771771
return ERR_PTR(r);
@@ -778,7 +778,13 @@ static void close_table_device(struct table_device *td, struct mapped_device *md
778778
{
779779
if (md->disk->slave_dir)
780780
bd_unlink_disk_holder(td->dm_dev.bdev, md->disk);
781-
fput(td->dm_dev.bdev_file);
781+
782+
/* Leverage async fput() if DMF_DEFERRED_REMOVE set */
783+
if (unlikely(test_bit(DMF_DEFERRED_REMOVE, &md->flags)))
784+
fput(td->dm_dev.bdev_file);
785+
else
786+
__fput_sync(td->dm_dev.bdev_file);
787+
782788
put_dax(td->dm_dev.dax_dev);
783789
list_del(&td->list);
784790
kfree(td);

0 commit comments

Comments
 (0)