[sheepdog] [PATCH] dog: don't set copy_policy for inode update of 'vdi write/create'
MORITA Kazutaka
morita.kazutaka at gmail.com
Thu Oct 10 06:20:17 CEST 2013
At Wed, 9 Oct 2013 23:51:26 +0800,
Liu Yuan wrote:
>
> On Thu, Oct 10, 2013 at 12:28:00AM +0900, MORITA Kazutaka wrote:
> > At Wed, 9 Oct 2013 18:51:27 +0800,
> > Liu Yuan wrote:
> > >
> > > inode object isn't erasure coded but replicated.
> >
> > Is this a cleanup patch? IIUC, is_erasure_oid() in sheep returns
> > false against vdi objects, so I thought that it's not problem to set
> > copy_policy for inode update.
> >
>
> Not exactly, without this patch, vdi write will always fail because
> is_erasure_req() will return true for inode object and will panic sheep.
Ah, I see.
How about adding
if (is_vdi_obj(req->rq.obj.oid))
return false;
to is_erasure_req()?
> >
> > There are other sd_write_object() calls against vdi objects in
> > vdi_snapshot(), vdi_clone(), vdi_resize(), and many other places in
> > dog/vdi.c.
>
> It seems we'd better introduce sd_write_inode_{data,inode} helpers unless we
> find a better way to handle this problem. How do you think?
I think it complicates code a lot. Setting copy_policy to zero in
sd_write_obj() for inode objects looks simpler to me. However, I
think it looks much better to solve this problem in the sheep side.
Thanks,
Kazutaka
More information about the sheepdog
mailing list