summaryrefslogtreecommitdiff
path: root/btrfs-list.c
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2013-02-01 15:56:30 +0800
committerDavid Sterba <dsterba@suse.cz>2013-02-01 16:55:06 +0100
commit11825e7a293fa987666a789768b834815184e140 (patch)
tree8803119ac6696ac2828e739f6db4f7ff3ff221cc /btrfs-list.c
parent64edc851da59c47b92ee6830101be0854add7f09 (diff)
Btrfs-progs: update btrfs_get_subvol to be inline with resolve_root ret changes
Signed-off-by: Anand Jain <anand.jain@oracle.com>
Diffstat (limited to 'btrfs-list.c')
-rw-r--r--btrfs-list.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/btrfs-list.c b/btrfs-list.c
index cfe62f3f..d02d6205 100644
--- a/btrfs-list.c
+++ b/btrfs-list.c
@@ -1517,19 +1517,24 @@ int btrfs_list_subvols_print(int fd, struct btrfs_list_filter_set *filter_set,
int btrfs_get_subvol(int fd, struct root_info *the_ri)
{
- int ret = -1;
+ int ret = 1, rr;
struct root_lookup rl;
struct rb_node *rbn;
struct root_info *ri;
u64 root_id = btrfs_list_get_path_rootid(fd);
if (btrfs_list_subvols(fd, &rl))
- return 1;
+ return ret;
rbn = rb_first(&rl.root);
while(rbn) {
ri = rb_entry(rbn, struct root_info, rb_node);
- resolve_root(&rl, ri, root_id);
+ rr = resolve_root(&rl, ri, root_id);
+ if (rr == -ENOENT) {
+ ret = -ENOENT;
+ rbn = rb_next(rbn);
+ continue;
+ }
if (!comp_entry_with_rootid(the_ri, ri, 0)) {
memcpy(the_ri, ri, offsetof(struct root_info, path));
if (ri->path)