On Sat, Feb 13, 2010 at 3:25 AM, Sander <sander@xxxxxxxxxxx> wrote: > Mike Fedyk wrote (ao): >> On Fri, Feb 12, 2010 at 8:32 AM, Josef Bacik <josef@xxxxxxxxxx> wrote: >> > Creating a file is a metadata operation, and _any_ metadata operation has to be >> > committed to disk when the transaction commits in order to maintain a coherent >> > fs. ??Thanks, >> >> What I still don't understand though is that the create could have >> taken up to 30 seconds to commit and the same for the few bytes of >> data, but a few ms later a snapshot was made and the metadata change >> was there and the data change was not. Could it have happened that >> the snapshot would not have the newly created file and this was just a >> timing issue that should not be relied upon? >> >> I'm just wondering why that file was there at all. > > I would say that is because the moment the file got created, the > resulting metadata was commited immediately. The data not yet. > Josef explained it to me on IRC. Meta-data changes like file creation get added to the current transaction and snapshots start a new transaction so that is why the empty file is in the snapshot. The file is empty because with delayed allocation, the data has not hit the filesystem yet and thus has no representation in filesystem operations like snapshots. -- 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
