btrfs-progs: fi du: improved error handling in mark_inode_seen
authorDavid Sterba <dsterba@suse.com>
Wed, 7 Sep 2016 13:09:14 +0000 (15:09 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 3 Oct 2016 09:33:14 +0000 (11:33 +0200)
The callchain handles errors, don't crash on unexpected condition.

Signed-off-by: David Sterba <dsterba@suse.com>
cmds-fi-du.c

index 47ceb96..a5b66e6 100644 (file)
@@ -228,7 +228,7 @@ static int mark_inode_seen(u64 ino, u64 subvol)
                else if (cmp > 0)
                        p = &(*p)->rb_right;
                else
-                       BUG();
+                       return -EEXIST;
        }
 
        si = calloc(1, sizeof(*si));