[sheepdog] [PATCH 1/2] md: purge directory only when md_add_disk() succeed
MORITA Kazutaka
morita.kazutaka at lab.ntt.co.jp
Fri May 10 10:18:54 CEST 2013
At Fri, 10 May 2013 14:41:33 +0800,
Liu Yuan wrote:
>
> static inline void calculate_vdisks(struct disk *disks, int nr_disks,
> @@ -608,13 +609,15 @@ 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))
> + if (purge_directory(path) < 0) {
> + md_del_disk(path);
> + goto out;
> + }
Still wrong indentation.
Thanks,
Kazutaka
More information about the sheepdog
mailing list