summaryrefslogtreecommitdiff
path: root/cmds-subvolume.c
diff options
context:
space:
mode:
authorZhao Lei <zhaolei@cn.fujitsu.com>2015-08-26 22:03:38 +0800
committerDavid Sterba <dsterba@suse.com>2015-09-01 14:02:49 +0200
commit298746b9583cf9b70efa5de03a366076e45cfcff (patch)
tree2e19b824f7d40eacea3fcd5b4103516766c25d10 /cmds-subvolume.c
parent6425752ab29d86594ad1d2411b7efeb74b62d48d (diff)
btrfs-progs: Fix wrong return value of wait_for_subvolume_cleaning()
Reproduce: # btrfs subvolume sync /mnt/btrfs Subvolume id 323 is gone # echo $? 1 # Reason: wait_for_subvolume_cleaning() return !0 in right case, because value of ret is set to "is subvolume clean" state before return. Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r--cmds-subvolume.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index fd4de84..d2e37bb 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -66,7 +66,7 @@ static int is_subvolume_cleaned(int fd, u64 subvolid)
static int wait_for_subvolume_cleaning(int fd, int count, u64 *ids,
int sleep_interval)
{
- int ret = 0;
+ int ret;
int remaining;
int i;
@@ -92,6 +92,8 @@ static int wait_for_subvolume_cleaning(int fd, int count, u64 *ids,
break;
sleep(sleep_interval);
}
+
+ ret = 0;
out:
return ret;
}