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?

Thanks,

Kazutaka
-- 
sheepdog mailing list
sheepdog@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to