On Fri, Sep 25, 2009 at 10:10 PM, Sage Weil <s...@newdream.net> wrote: > So, the btrfs user transaction ioctls work like so > > ioctl(fd, BTRFS_IOC_TRANS_START); > /* do many operations: write(), setxattr(), rmdir(), whatever. */ > ioctl(fd, BTRFS_IOC_TRANS_END); /* or close(fd); */ ... > The second problem is that the application may die between START and > END. The current ioctls are "safe" in that the transaction handle is > closed when the struct file is released, so the fs won't get wedged if > you say segfault. On the other hand, they're "unsafe" in that a process > that is killed or segfaults will result in an imcomplete transaction > making it to disk, which leaves the file system in an inconsistent state > (from the point of view of the application).
With COW, where a transaction is incomplete due to application exit without closing the transaction, is there a way to drop the reference/'deallocate' the new tree nodes, thus moving back to the prior state? Presumably the new tree nodes would get linked in when the transaction is closed. -- Daniel J Blueman -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html