Skip to content

Commit 555ae67

Browse files
asjkdave
authored andcommitted
btrfs-progs: btrfs-select-super output is confusing when it fails
Trivial patch: ./btrfs-progs/btrfs-select-super -s 0 /dev/sdc using SB copy 0, bytenr 65536 No valid Btrfs found on /dev/sdc Open ctree failed The line 'using..' is confusing which gives an indication that command is successful This patch will avoid that when command fails Signed-off-by: Anand Jain <anand.jain@oracle.com>
1 parent 4b3c913 commit 555ae67

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

btrfs-select-super.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ int main(int ac, char **av)
4343
{
4444
struct btrfs_root *root;
4545
int ret;
46-
int num;
46+
int num = 0;
4747
u64 bytenr = 0;
4848

4949
while(1) {
@@ -55,8 +55,6 @@ int main(int ac, char **av)
5555
case 's':
5656
num = atol(optarg);
5757
bytenr = btrfs_sb_offset(num);
58-
printf("using SB copy %d, bytenr %llu\n", num,
59-
(unsigned long long)bytenr);
6058
break;
6159
default:
6260
print_usage();
@@ -97,5 +95,7 @@ int main(int ac, char **av)
9795
* transaction commit. We just want the super copy we pulled off the
9896
* disk to overwrite all the other copies
9997
*/
98+
printf("using SB copy %d, bytenr %llu\n", num,
99+
(unsigned long long)bytenr);
100100
return ret;
101101
}

0 commit comments

Comments
 (0)