[sheepdog] [PATCH 1/2] md: purge directory only when md_add_disk() succeed

Liu Yuan namei.unix at gmail.com
Fri May 10 07:44:03 CEST 2013


在 2013-5-10 PM1:41,"MORITA Kazutaka" <morita.kazutaka at lab.ntt.co.jp>写道:
>
> At Fri, 10 May 2013 13:33:00 +0800,
> Liu Yuan wrote:
> >
> > @@ -608,13 +609,12 @@ static int do_plug_unplug(char *disks, bool plug)
> >       old_nr = md_nr_disks;
> >       path = strtok(disks, ",");
> >       do {
> > -             if (purge_directory(path) < 0)
> > -                     goto out;
> > -
> > -             if (plug)
> > -                     md_add_disk(path);
> > -             else
> > +             if (plug) {
> > +                     if (md_add_disk(path) && purge_directory(path) <
0)
> > +                                     goto out;
>
> Wrong indentation.
>
> What happens if md_add_disk() succeeds but purge_directory() fails?
> Should we call md_del_disk() against the added disk?
>

no, we dont plug any disks in that case
> Thanks,
>
> Kazutaka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/sheepdog/attachments/20130510/c83502ee/attachment-0004.html>


More information about the sheepdog mailing list