<p dir="ltr"><br>
在 2013-6-20 AM11:45,"MORITA Kazutaka" <<a href="mailto:morita.kazutaka@lab.ntt.co.jp">morita.kazutaka@lab.ntt.co.jp</a>>写道:<br>
><br>
> At Thu, 20 Jun 2013 10:53:45 +0800,<br>
> Liu Yuan wrote:<br>
> ><br>
> > This is observed by the following bug:<br>
> ><br>
> > Jun 18 21:55:11 [rw] default_link(377) failed to link from<br>
> > /mnt/ST2000DM001-1CH164_W1E2N5GM/obj/.stale/0002e519000054f1.21 to<br>
> > /mnt/ST2000DM001-1CH164_W1E2N5GM/obj/0002e519000054f1, File exists<br>
> > Jun 18 21:55:11 [rw] err_to_sderr(96) oid=2e519000054f1, File exists<br>
> > Jun 18 21:55:11 [main] remove_disk(319) /mnt/ST2000DM001-1CH164_W1E2N5GM/obj from multi-disk array<br>
> ><br>
> > Reported-by: Valerio Pachera <<a href="mailto:sirio81@gmail.com">sirio81@gmail.com</a>><br>
> > Signed-off-by: Liu Yuan <<a href="mailto:namei.unix@gmail.com">namei.unix@gmail.com</a>><br>
> > ---<br>
> >  sheep/plain_store.c |    9 ++++++++-<br>
> >  1 file changed, 8 insertions(+), 1 deletion(-)<br>
> ><br>
> > diff --git a/sheep/plain_store.c b/sheep/plain_store.c<br>
> > index 272a402..8e80a1f 100644<br>
> > --- a/sheep/plain_store.c<br>
> > +++ b/sheep/plain_store.c<br>
> > @@ -374,11 +374,18 @@ int default_link(uint64_t oid, uint32_t tgt_epoch)<br>
> >       get_stale_obj_path(oid, tgt_epoch, stale_path);<br>
> ><br>
> >       if (link(stale_path, path) < 0) {<br>
> > +             /*<br>
> > +              * Recovery thread and main thread might try to recover the<br>
> > +              * same object and we might get EEXIST in such case.<br>
><br>
> Which function recovers the object in the main thread?<br>
></p>
<p dir="ltr">sd_move_object</p>
<p dir="ltr">> Thanks,<br>
><br>
> Kazutaka<br>
><br>
><br>
> > +              */<br>
> > +             if (errno == EEXIST)<br>
> > +                     goto out;<br>
> > +<br>
> >               sd_eprintf("failed to link from %s to %s, %m", stale_path,<br>
> >                          path);<br>
> >               return err_to_sderr(path, oid, errno);<br>
> >       }<br>
> > -<br>
> > +out:<br>
> >       return SD_RES_SUCCESS;<br>
> >  }<br>
> ><br>
> > --<br>
> > 1.7.9.5<br>
> ><br>
> > --<br>
> > sheepdog mailing list<br>
> > <a href="mailto:sheepdog@lists.wpkg.org">sheepdog@lists.wpkg.org</a><br>
> > <a href="http://lists.wpkg.org/mailman/listinfo/sheepdog">http://lists.wpkg.org/mailman/listinfo/sheepdog</a><br>
</p>