[sheepdog] [PATCH v3 3/3] journal: new journal flag JF_DELETE_OBJ for deleting object

Liu Yuan namei.unix at gmail.com
Mon Apr 15 09:31:01 CEST 2013

On 04/14/2013 11:54 PM, Hitoshi Mitake wrote:
> Current journal implementation doesn't consider such a case:
> 1. make new journal for new object creation
> 2. actual creation of the object
> 3. delete object
> 4. crash
> After such a sequence, the journaling mechanism recovers the deleted
> object. This behavior isn't valid. This patch implements the new
> journal flag: JF_DELETE_OBJ. If the journaling mechanism finds an
> entry with this flag during recovery process, it deletes an
> corresponding object.

IIUC, SD won't allow remove VDI while VDI is used by VM. So we don't
need code to handle situation.

But after discard operation is supported, this situation might happen. I
am highly unsure of it because this means following operations series in VM:

 1. write some file with O_SYNC that causes the creation of new object
 2. just after the write, then remove this file.
 3. FS issue a discard command to release this newly created object
 4. sheep crashes with journal entry logs the 'create' operation only

What do you you think? Is this practical (happens for real)?


More information about the sheepdog mailing list