Skip to content

Commit 9de4a39

Browse files
mauelshaMikulas Patocka
authored andcommitted
dm raid: add support for resync w/o metadata devices
Target does not honour the "sync" argument when activated w/o metadata devices, e.g. with table line: "0 $(blockdev --getsz $data1) raid raid1 2 0 sync 2 - $data1 - $data2". Fix this to support temporary, transient raid devices useful for data duplication. Signed-off-by: Heinz Mauelshagen <[email protected]> Signed-off-by: Mikulas Patocka <[email protected]>
1 parent 75227ed commit 9de4a39

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/md/dm-raid.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2532,6 +2532,10 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
25322532
struct md_rdev *rdev, *freshest;
25332533
struct mddev *mddev = &rs->md;
25342534

2535+
/* Respect resynchronization requested with "sync" argument. */
2536+
if (test_bit(__CTR_FLAG_SYNC, &rs->ctr_flags))
2537+
set_bit(MD_ARRAY_FIRST_USE, &mddev->flags);
2538+
25352539
freshest = NULL;
25362540
rdev_for_each(rdev, mddev) {
25372541
if (test_bit(Journal, &rdev->flags))

0 commit comments

Comments
 (0)