[sheepdog] [PATCH RFC] sheep: make the vid deletion proceduer correct order

MORITA Kazutaka morita.kazutaka at gmail.com
Thu Aug 22 03:12:49 CEST 2013


At Tue, 20 Aug 2013 10:13:50 +0900,
Hitoshi Mitake wrote:
> 
> At Tue, 20 Aug 2013 09:55:10 +0900,
> MORITA Kazutaka wrote:
> > 
> > At Mon, 19 Aug 2013 21:53:00 +0900,
> > Hitoshi Mitake wrote:
> > > 
> > > Current VDI deletion process deletes VDI in this order:
> > > 1. delete objects which belong to the VDI
> > > 2. notify deletion of the VDI for removing object list cache
> > > 3. clear inode object with zero
> > > 
> > > But this should be like this:
> > > 1. delete objects which belong to the VDI
> > > 2. clear inode object with zero
> > > 3. notify deletion of the VDI for removing object list cache
> > > 
> > > Because in the process of removing object list cache, existing of the VDI is
> > > checked with the name of the VDI is zero-cleared or not
> > > (objlist_deletion_work()). So objlist_deletion_work() would have a possibility
> > > of leaving the object list cache incorrectly. This patch makes the process
> > > correct order.
> > > 
> > > Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
> > > ---
> > > 
> > > BTW, I don't have a solid understanding of the VDI deletion process. I'd like to
> > > hear your comments.
> > > 
> > >  sheep/vdi.c |    6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > Looks good to me, but please add a test to reproduce the problem you
> > described in the commit log.
> 
> Thanks for your review. I'll add a new test for this problem in v2.

On the second thought, what this patch fixes is clearing a objlist
cache entry of the deleted vdi, and it looks difficult to test it with
our test.  Even if object list cache contains a wrong object, sheepdog
still works correctly.

This patch looks correct to me either way.  I've applied it, thanks.

Kazutaka



More information about the sheepdog mailing list