btrfs-progs: subvolume sync: fix handling of -s option
PATCH 1/1 btrfs-progs: subvolume sync: fix handling of -s option
Setting check interval for subvolume sync resulted in picking wrong element from argv for it's value:
$ btrfs subvolume sync -s 10 ./dir ERROR: invalid sleep interval ./dir $ btrfs subvolume sync ./dir -s 10 Segmentation fault
Signed-off-by Marek Rusinowski <[email protected]>
--- cmds-subvolume.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
cmds-subvolume.c +2 -3
@@ -1194,10 +1194,9 @@ static int cmd_subvol_sync(int argc, char **argv)switch (c) {case 's' : - sleep_interval =atoi (argv[optind]); + sleep_interval =atoi (optarg);if (sleep_interval <1 ) { -error ("invalid sleep interval %s" , - argv[optind]); +error ("invalid sleep interval %s" , optarg); ret =1 ; goto out; }
Signature · 1 line
2.8.1
David Sterba
AppliedQuoted 9 lines · Marek Rusinowski
Setting check interval for subvolume sync resulted in picking wrong element from argv for it's value:
$ btrfs subvolume sync -s 10 ./dir ERROR: invalid sleep interval ./dir $ btrfs subvolume sync ./dir -s 10 Segmentation faultSigned-off-by Marek Rusinowski <[email protected]>
Applied, thanks.