mirror of
https://github.com/torvalds/linux.git
synced 2026-08-01 03:59:40 +02:00
Merge tag 'md-6.14-20250124' of https://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux into block-6.14
Pull MD fix from Song: "Fix a md-cluster regression introduced in the 6.12 release." * tag 'md-6.14-20250124' of https://git.kernel.org/pub/scm/linux/kernel/git/mdraid/linux: md/md-bitmap: Synchronize bitmap_get_stats() with bitmap lifetime
This commit is contained in:
commit
e9d8c87396
|
|
@ -2355,7 +2355,10 @@ static int bitmap_get_stats(void *data, struct md_bitmap_stats *stats)
|
|||
|
||||
if (!bitmap)
|
||||
return -ENOENT;
|
||||
|
||||
if (bitmap->mddev->bitmap_info.external)
|
||||
return -ENOENT;
|
||||
if (!bitmap->storage.sb_page) /* no superblock */
|
||||
return -EINVAL;
|
||||
sb = kmap_local_page(bitmap->storage.sb_page);
|
||||
stats->sync_size = le64_to_cpu(sb->sync_size);
|
||||
kunmap_local(sb);
|
||||
|
|
|
|||
|
|
@ -8376,6 +8376,10 @@ static int md_seq_show(struct seq_file *seq, void *v)
|
|||
return 0;
|
||||
|
||||
spin_unlock(&all_mddevs_lock);
|
||||
|
||||
/* prevent bitmap to be freed after checking */
|
||||
mutex_lock(&mddev->bitmap_info.mutex);
|
||||
|
||||
spin_lock(&mddev->lock);
|
||||
if (mddev->pers || mddev->raid_disks || !list_empty(&mddev->disks)) {
|
||||
seq_printf(seq, "%s : ", mdname(mddev));
|
||||
|
|
@ -8451,6 +8455,7 @@ static int md_seq_show(struct seq_file *seq, void *v)
|
|||
seq_printf(seq, "\n");
|
||||
}
|
||||
spin_unlock(&mddev->lock);
|
||||
mutex_unlock(&mddev->bitmap_info.mutex);
|
||||
spin_lock(&all_mddevs_lock);
|
||||
|
||||
if (mddev == list_last_entry(&all_mddevs, struct mddev, all_mddevs))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user