diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2014-05-12 09:39:42 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.cz> | 2014-08-22 14:39:31 +0200 |
commit | 95586648c0c5c32a2e0d0dfd1120c1c72ccb5417 (patch) | |
tree | b8ec97fd467a0741ec25039b67ee80fa13880c42 /cmds-send.c | |
parent | 7e47c6d32933cc68aadb9a00072fe24500c6d5e5 (diff) | |
download | btrfs-progs-95586648c0c5c32a2e0d0dfd1120c1c72ccb5417.tar.gz btrfs-progs-95586648c0c5c32a2e0d0dfd1120c1c72ccb5417.tar.bz2 btrfs-progs-95586648c0c5c32a2e0d0dfd1120c1c72ccb5417.zip |
btrfs-progs: Remove unneeded assert in find_good_parent().
find_good_parent() uses assert to deal with the problem that clone
source's parent can't be found.
But in fact the assert is somewhat overkilled since subvol_uuid_search()
has enough error messages for debug and caller of find_good_parent() can
handle the problems in find_good_parent(), so the assert can be removed
without any problem.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-send.c')
-rw-r--r-- | cmds-send.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/cmds-send.c b/cmds-send.c index 1cd457db..2df16be8 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -129,7 +129,10 @@ static int find_good_parent(struct btrfs_send *s, u64 root_id, u64 *found) parent2 = subvol_uuid_search(&s->sus, s->clone_sources[i], NULL, 0, NULL, subvol_search_by_root_id); - assert(parent2); + if (!parent2) { + ret = -ENOENT; + goto out; + } tmp = parent2->ctransid - parent->ctransid; if (tmp < 0) tmp *= -1; |