Skip to content

Commit c2670cf

Browse files
committed
Merge tag 'md-6.11-20240612' of git://git.kernel.org/pub/scm/linux/kernel/git/song/md into for-6.11/block
Pull MD updates from Song: "The major changes in this PR are: - sync_action fix and refactoring, by Yu Kuai; - Various small fixes by Christoph Hellwig, Li Nan, and Ofir Gal." * tag 'md-6.11-20240612' of git://git.kernel.org/pub/scm/linux/kernel/git/song/md: md/raid5: avoid BUG_ON() while continue reshape after reassembling md: pass in max_sectors for pers->sync_request() md: factor out helpers for different sync_action in md_do_sync() md: replace last_sync_action with new enum type md: use new helpers in md_do_sync() md: don't fail action_store() if sync_thread is not registered md: remove parameter check_seq for stop_sync_thread() md: replace sysfs api sync_action with new helpers md: factor out helper to start reshape from action_store() md: add new helpers for sync_action md: add a new enum type sync_action md: rearrange recovery_flags md/md-bitmap: fix writing non bitmap pages md/raid1: don't free conf on raid0_run failure md/raid0: don't free conf on raid0_run failure md: make md_flush_request() more readable md: fix deadlock between mddev_suspend and flush bio md: change the return value type of md_write_start to void md: do not delete safemode_timer in mddev_suspend
2 parents 83a7eef + 305a517 commit c2670cf

File tree

8 files changed

+435
-285
lines changed

8 files changed

+435
-285
lines changed

drivers/md/dm-raid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3542,7 +3542,7 @@ static void raid_status(struct dm_target *ti, status_type_t type,
35423542
recovery = rs->md.recovery;
35433543
state = decipher_sync_action(mddev, recovery);
35443544
progress = rs_get_progress(rs, recovery, state, resync_max_sectors);
3545-
resync_mismatches = (mddev->last_sync_action && !strcasecmp(mddev->last_sync_action, "check")) ?
3545+
resync_mismatches = mddev->last_sync_action == ACTION_CHECK ?
35463546
atomic64_read(&mddev->resync_mismatches) : 0;
35473547

35483548
/* HM FIXME: do we want another state char for raid0? It shows 'D'/'A'/'-' now */

drivers/md/md-bitmap.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ static int __write_sb_page(struct md_rdev *rdev, struct bitmap *bitmap,
227227
struct block_device *bdev;
228228
struct mddev *mddev = bitmap->mddev;
229229
struct bitmap_storage *store = &bitmap->storage;
230+
unsigned int bitmap_limit = (bitmap->storage.file_pages - pg_index) <<
231+
PAGE_SHIFT;
230232
loff_t sboff, offset = mddev->bitmap_info.offset;
231233
sector_t ps = pg_index * PAGE_SIZE / SECTOR_SIZE;
232234
unsigned int size = PAGE_SIZE;
@@ -269,11 +271,9 @@ static int __write_sb_page(struct md_rdev *rdev, struct bitmap *bitmap,
269271
if (size == 0)
270272
/* bitmap runs in to data */
271273
return -EINVAL;
272-
} else {
273-
/* DATA METADATA BITMAP - no problems */
274274
}
275275

276-
md_super_write(mddev, rdev, sboff + ps, (int) size, page);
276+
md_super_write(mddev, rdev, sboff + ps, (int)min(size, bitmap_limit), page);
277277
return 0;
278278
}
279279

0 commit comments

Comments
 (0)