On Mon, 16 Jun 2025, hei...@redhat.com wrote:
> From: Heinz Mauelshagen <hei...@redhat.com>
>
> 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 <hei...@redhat.com>
> ---
> drivers/md/dm-raid.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
> index 99e15a005bfb..435b366224f0 100644
> --- a/drivers/md/dm-raid.c
> +++ b/drivers/md/dm-raid.c
> @@ -2532,6 +2532,10 @@ static int analyse_superblocks(struct dm_target *ti,
> struct raid_set *rs)
> struct md_rdev *rdev, *freshest;
> struct mddev *mddev = &rs->md;
>
> + /* Respect resynchronization requested with "sync" argument. */
> + if (test_bit(__CTR_FLAG_SYNC, &rs->ctr_flags))
> + set_bit(MD_ARRAY_FIRST_USE, &mddev->flags);
> +
> freshest = NULL;
> rdev_for_each(rdev, mddev) {
> if (test_bit(Journal, &rdev->flags))
> --
> 2.49.0
Applied, thanks.
Mikulas