On Tue, Dec 8, 2009 at 7:05 PM, Josef Bacik <josef@xxxxxxxxxx> wrote: > On Mon, Dec 07, 2009 at 02:25:50PM -0800, Sage Weil wrote: >> When you create a new snap or subvol, first a new ROOT_ITEM is created >> while everything commits, and then the referring directory entry is set up >> (with a correspond ROOT_BACKREF). >> >> First, if you say 'btrfsctl -s foo .' and then 'reboot -f -n' before the >> next regularly scheduled commit, the snap is created, but lost.. there's >> no reference. Second, the unreferenced ROOT_ITEM is never cleaned up. >> >> Are there any existing plans for this? It would be nice if the reference >> could be committed as well the first time around. That probably requires >> a bit of futzing to determine what the root objectid is going to be >> beforehand, then adding the link in the namespace, then flushing things >> out and updating the root item in the right order? >> > > We could probably use the orphan code for this. Just create an orphan item for > the snapshot and then delete it when the snapshot is fully created that way if > somebody does reboot -fn we cleanup the root item and such. Thanks, > It would be nice to have atomic behavior. Perhaps something similar to rename with its atomicity guarantees could help? Regards, Andrey > Josef > -- > To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
