Skip to contentSkip to conversation

btrfs-progs: restore: Avoid SYMLINK messages

PATCH In review Marcos Paulo de Souza 2 participants 2 messages Mar 19, 2020 – Mar 26, 2020 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs-progs: restore: Avoid SYMLINK messages

From: Marcos Paulo de Souza <[email protected]>

Some scripts can still rely in this message, so make it available only if --verbose was informed.

Fixes #127
---
 cmds/restore.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
cmds/restore.c +3 -1
index 8eaafd60..73a464c3 100644
@@ -898,7 +898,9 @@ static int copy_symlink(struct btrfs_root *root, struct btrfs_key *key,
 			goto out;
 		}
 	}
-	printf("SYMLINK: '%s' => '%s'\n", path_name, symlink_target);
+
+	if (verbose)
+		printf("SYMLINK: '%s' => '%s'\n", path_name, symlink_target);
 
 	ret = 0;
 	if (!restore_metadata)
Signature · 1 line
2.25.0
#1 lore raw
Quoted 17 lines · Marcos Paulo de Souza

From: Marcos Paulo de Souza <[email protected]>

Some scripts can still rely in this message, so make it available only if --verbose was informed.

Fixes #127
---
 cmds/restore.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
cmds/restore.c +0 -0
index 8eaafd60..73a464c3 100644

cmds/restore.c static int copy_symlink(struct btrfs_root *root, struct btrfs_key *key, · line 902

Quoted 6 lines
cmds/restore.c +2 -1
@@ -898,7 +898,9 @@ static int copy_symlink(struct btrfs_root *root, struct btrfs_key *key,
 			goto out;
 		}
 	}
-	printf("SYMLINK: '%s' => '%s'\n", path_name, symlink_target);
+
+	if (verbose)

I've changed it to verbose >= 2, ie. it's printed with -vv. Patch added to devel, thanks.