summaryrefslogtreecommitdiff
path: root/cmds-receive.c
diff options
context:
space:
mode:
authorStefan Behrens <sbehrens@giantdisaster.de>2013-04-10 12:08:31 +0200
committerDavid Sterba <dsterba@suse.cz>2013-04-23 18:56:23 +0200
commitadf67ff7613e51dfa331f73a15a3e98f8e354b70 (patch)
tree43d48de64a72eb482c8920c37f70610ed45792ae /cmds-receive.c
parentc3153d2fc898e621382cff157e9a04aa49277dab (diff)
Btrfs-progs: Set the root-id for received subvols in btrfs receive
When an entry was added to the subvol search tree, the root_id was always 0 (not set at all) and therefore only the first one was added, all the others had been ignored. This commit sets the root_id before the entry is added. Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Diffstat (limited to 'cmds-receive.c')
-rw-r--r--cmds-receive.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmds-receive.c b/cmds-receive.c
index 1572ce23..763caba3 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -45,6 +45,7 @@
#include "commands.h"
#include "utils.h"
#include "list.h"
+#include "btrfs-list.h"
#include "send.h"
#include "send-stream.h"
@@ -125,6 +126,9 @@ static int finish_subvol(struct btrfs_receive *r)
goto out;
}
+ ret = btrfs_list_get_path_rootid(subvol_fd, &r->cur_subvol->root_id);
+ if (ret < 0)
+ goto out;
subvol_uuid_search_add(&r->sus, r->cur_subvol);
r->cur_subvol = NULL;
ret = 0;