Set creation/change time (otime/ctime) for offline-created subvolumes and convertd root subvolume - #1157
Open
koraynilay wants to merge 2 commits into
Open
Set creation/change time (otime/ctime) for offline-created subvolumes and convertd root subvolume#1157koraynilay wants to merge 2 commits into
convertd root subvolume#1157koraynilay wants to merge 2 commits into
Conversation
…subvol Before this, btrfs-convert would leave the root subvol of the converted fs with 0 as both otime and ctime, showing "-" when using btrfs subvolume show /path. This patch uses the code from mkfs.btrfs's btrfs_create_tree_root() to set the otime/ctime to the root subvol and generate its UUID right away (instead of having to wait for btrfs_rebuild_uuid_tree(), not necessarily needed but cleaner). This way the timestamp of the filesystem conversion will be available in the "Creation time" field of btrfs subvolume show /path output, while the original ext* "Filesystem created" timestamp is available with stat as the mountpoint's birth time. Assisted-by: Claude:opus-4.6 antigravity-cli-1.1.7 Assisted-by: Gemini:3.1-pro antigravity-cli-1.1.7 Signed-off-by: koraynilay <koray.fra@gmail.com>
…d subvolumes Update common/root-tree-utils.c's btrfs_make_subvolume() to also generate a UUID and set otime and ctime of subvolumes created offline (if it's a normal subvolume). This is essentially the same change as commit 0cdfd08 ("btrfs-progs: convert: set creation/change time (otime/ctime) of root subvol") but that applies to: * mkfs.btrfs' --rootdir and --subvol options * btrfs-convert's ext2_saved subvolume Assisted-by: Gemini:3.1-pro antigravity-cli-1.1.7 Signed-off-by: koraynilay <koray.fra@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix
subvol->otimeandsubvol->ctimenot being set on:btrfs-convertd filesystemmkfs.btrfsusing--rootdirand--subvoloptionsext2_savedsubvolume of abtrfs-convert'd filesystemThanks