Re: [PATCH 5/6] Check write journal in incremental

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 28, 2015 at 4:27 PM, Song Liu <songliubraving@xxxxxx> wrote:
> If journal device is missing, do not start the array, and shows:
>
> ./mdadm -I /dev/sdf
> mdadm: journal device is missing, not safe to start yet.
>
> The array will be started when the journal device is attached with -I
>
> ./mdadm -I /dev/sdb1
> mdadm: /dev/sdb1 attached to /dev/md/0_0, which has been started.
>
> To force start without journal device:
>
> ./mdadm -I /dev/sdf --run
> mdadm: Trying to run with missing journal device
> mdadm: /dev/sdf attached to /dev/md/0_0, which has been started.
>
> Signed-off-by: Shaohua Li <shli@xxxxxx>
> Signed-off-by: Song Liu <songliubraving@xxxxxx>
> ---
>  Incremental.c | 31 +++++++++++++++++++++++++++----
>  1 file changed, 27 insertions(+), 4 deletions(-)
>
> diff --git a/Incremental.c b/Incremental.c
> index 304cc6d..74905e3 100644
> --- a/Incremental.c
> +++ b/Incremental.c
> @@ -35,7 +35,7 @@
>
>  static int count_active(struct supertype *st, struct mdinfo *sra,
>                         int mdfd, char **availp,
> -                       struct mdinfo *info);
> +                       struct mdinfo *info, int *journal_device_missing);
>  static void find_reject(int mdfd, struct supertype *st, struct mdinfo *sra,
>                         int number, __u64 events, int verbose,
>                         char *array_name);
> @@ -104,6 +104,7 @@ int Incremental(struct mddev_dev *devlist, struct context *c,
>         struct map_ent target_array;
>         int have_target;
>         char *devname = devlist->devname;
> +       int journal_device_missing = 0;
>
>         struct createinfo *ci = conf_get_create_info();
>
> @@ -518,7 +519,7 @@ int Incremental(struct mddev_dev *devlist, struct context *c,
>         sysfs_free(sra);
>         sra = sysfs_read(mdfd, NULL, (GET_DEVS | GET_STATE |
>                                     GET_OFFSET | GET_SIZE));
> -       active_disks = count_active(st, sra, mdfd, &avail, &info);
> +       active_disks = count_active(st, sra, mdfd, &avail, &info, &journal_device_missing);
>         if (enough(info.array.level, info.array.raid_disks,
>                    info.array.layout, info.array.state & 1,
>                    avail) == 0) {
> @@ -548,10 +549,12 @@ int Incremental(struct mddev_dev *devlist, struct context *c,
>         }
>
>         map_unlock(&map);
> -       if (c->runstop > 0 || active_disks >= info.array.working_disks) {
> +       if (c->runstop > 0 || (!journal_device_missing && active_disks >= info.array.working_disks)) {

A minor comment, and I'd defer to Neil's opinion, but I think this is
asking for mdu_array_info_t to grow a "journal_disks" attribute.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux