linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* questions regarding fsync in btrfs
@ 2014-01-25  0:09 Aastha Mehta
  2014-01-25 15:21 ` Josef Bacik
  0 siblings, 1 reply; 4+ messages in thread
From: Aastha Mehta @ 2014-01-25  0:09 UTC (permalink / raw)
  To: linux-btrfs

Hello,

I would like to clarify a bit on how the fsync works in btrfs. The log
tree journals only the metadata of the files that have been modified
prior to the fsync, correct? It does not log the data extents of
files, which are directly sync'ed to the disk. Also, if I understand
correctly, fsync and fdatasync are the same thing in btrfs currently.
Is it more like fsync or fdatasync?

What exactly happens once a file inode is in the tree log? Does it
mean it is guaranteed to be persisted on disk, or is it already on
disk? I see two flags in btrfs_sync_file -
BTRFS_INODE_HAS_ASYNC_EXTENT and BTRFS_INODE_NEEDS_FULL_SYNC. I do not
fully understand them. After full sync, what does log_dentry_safe and
sync_log do?

Finally, Wikipedia says that "the items in the log tree are replayed
and deleted at the next full tree commit or (if there was a system
crash) at the next remount". Even if there is no crash, why is there a
need to replay the log?

Thanks,
Aastha.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-29 17:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-25  0:09 questions regarding fsync in btrfs Aastha Mehta
2014-01-25 15:21 ` Josef Bacik
2014-01-29 16:42   ` Aastha Mehta
2014-01-29 17:04     ` Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).