<p dir="ltr"><br>
在 2013-5-10 PM1:49,"MORITA Kazutaka" <<a href="mailto:morita.kazutaka@lab.ntt.co.jp">morita.kazutaka@lab.ntt.co.jp</a>>写道:<br>
><br>
> At Fri, 10 May 2013 13:44:03 +0800,<br>
> Liu Yuan wrote:<br>
> ><br>
> > > At Fri, 10 May 2013 13:33:00 +0800,<br>
> > > Liu Yuan wrote:<br>
> > > ><br>
> > > > @@ -608,13 +609,12 @@ static int do_plug_unplug(char *disks, bool plug)<br>
> > > > old_nr = md_nr_disks;<br>
> > > > path = strtok(disks, ",");<br>
> > > > do {<br>
> > > > - if (purge_directory(path) < 0)<br>
> > > > - goto out;<br>
> > > > -<br>
> > > > - if (plug)<br>
> > > > - md_add_disk(path);<br>
> > > > - else<br>
> > > > + if (plug) {<br>
> > > > + if (md_add_disk(path) && purge_directory(path) <<br>
> > 0)<br>
> > > > + goto out;<br>
> > ><br>
> > > Wrong indentation.<br>
> > ><br>
> > > What happens if md_add_disk() succeeds but purge_directory() fails?<br>
> > > Should we call md_del_disk() against the added disk?<br>
> > ><br>
> ><br>
> > no, we dont plug any disks in that case<br>
><br>
> But md_add_disk() increments md_nr_disks in the case. I think we need<br>
> at least some clean-up operations to decrement md_nr_disks.</p>
<p dir="ltr">ah, yeah, we need to call del_disk</p>