From 6712828275631b6b627ce97be042c93f4a4aa6c5 Mon Sep 17 00:00:00 2001 From: Alex Lyakas Date: Tue, 9 Apr 2013 19:08:45 +0200 Subject: btrfs-progs: Fix the receive code pathing The receive code was not distinguishing properly between the mount root and the directory to create the received subvolume in. Also make sure the find_mount_root reports an error if it cannot find a match at all. Reported-by: Robert Buhren Reported-by: Rory Campbell-Lange Reported-by: Stefan Priebe - Profihost AG Signed-off-by: Alex Lyakas Signed-off-by: Stefan Behrens --- cmds-send.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmds-send.c') diff --git a/cmds-send.c b/cmds-send.c index fcde74c..9bb4206 100644 --- a/cmds-send.c +++ b/cmds-send.c @@ -84,6 +84,13 @@ int find_mount_root(const char *path, char **mount_root) } fclose(mnttab); + if (!longest_match) { + fprintf(stderr, + "ERROR: Failed to find mount root for path %s.\n", + path); + return -ENOENT; + } + *mount_root = realpath(longest_match, NULL); free(longest_match); -- cgit v1.2.1