Skip to contentSkip to conversation

btrfs-progs: optionally restore metadata

PATCH Applied Dan Merillat 2 participants 3 messages Apr 21, 2015 – Apr 23, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 btrfs-progs: optionally restore metadata

As long as the inode is intact, the file metadata can be restored. Directory data is restored at the end of search_dir. Errors are checked and returned, unless ignore_errors is requested.

---
 Documentation/btrfs-restore.txt |   3 ++
 cmds-restore.c                  | 114 +++++++++++++++++++++++++++++++++++++++-
 2 files changed, 116 insertions(+), 1 deletion(-)
Documentation/btrfs-restore.txt +3 -0
index 20fc366..a4e4d37 100644
@@ -29,6 +29,9 @@ get snapshots, btrfs restore skips snapshots in default.
 -x::
 get extended attributes.
 
+-m|--metadata::
+set owner, permissions, access time and modify time.
+
 -v::
 verbose.
 
cmds-restore.c +113 -1

177 lines not on this page · raw message

Signature · 1 line
2.1.4
Applied
#1 lore raw
Quoted 5 lines · Dan Merillat

As long as the inode is intact, the file metadata can be restored. Directory data is restored at the end of search_dir. Errors are checked and returned, unless ignore_errors is requested.

Applied, thanks.

In future patches, please stick to the coding style used in progs ([1]), I've fixed spacing around "=", comments and moved declarations before the statements.

[1] https://www.kernel.org/doc/Documentation/CodingStyle

cmds-restore.c int cmd_restore(int argc, char **argv) · line 1279

Quoted 6 lines
cmds-restore.c +2 -0
@@ -1168,10 +1275,12 @@ int cmd_restore(int argc, char **argv)
 		static const struct option long_options[] = {
 			{ "path-regex", 1, NULL, 256},
 			{ "dry-run", 0, NULL, 'D'},
+			{ "metadata", 0, NULL, 'm'},
+			{ "debug-regex", 0, NULL, 257},

This was unused and I've removed it.

#2 lore raw
Quoted 7 lines · David Sterba

Applied, thanks.

In future patches, please stick to the coding style used in progs ([1]), I've fixed spacing around "=", comments and moved declarations before the statements.

[1] https://www.kernel.org/doc/Documentation/CodingStyle

I'll try to clean it up more next time around.

Quoted 8 lines

cmds-restore.c int cmd_restore(int argc, char **argv) · line 1279

Quoted 6 lines
cmds-restore.c +2 -0
@@ -1168,10 +1275,12 @@ int cmd_restore(int argc, char **argv)
              static const struct option long_options[] = {
                      { "path-regex", 1, NULL, 256},
                      { "dry-run", 0, NULL, 'D'},
+                     { "metadata", 0, NULL, 'm'},
+                     { "debug-regex", 0, NULL, 257},

This was unused and I've removed it.

That's cruft and I thought I removed it from the patch, sorry.

Got your symlink code, I'll look at that today.