summaryrefslogtreecommitdiff
path: root/cmds-receive.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2013-12-18 17:56:33 +0800
committerChris Mason <clm@fb.com>2014-01-31 08:22:21 -0800
commitb5a09775c6e3dd6c842764b026e1764a057b7dfd (patch)
tree0aa4e676c559a378c8db8eb709cb536848ed73cc /cmds-receive.c
parentf1bb766b3b387ce67ab377ad87af7c5d93b12803 (diff)
Btrfs-progs: receive: fix the case that we can not find the subvolume
If we change our default subvolume, btrfs receive will fail to find subvolume. To fix this problem, we have three ideas: 1.make btrfs snapshot ioctl support passing source subvolume's objectid. 2.when we want to using interval subvolume path, we mount it other place that use subvolume 5 as its default subvolume. 3.tell the user to mount the toplevel subvol by himself and run receive We's better use the third approach because first patch will bother kernel change and the second approach is not very good for power users. So give this option to users. Reported-by: Michael Welsh Duggan <mwd@md5i.com> Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'cmds-receive.c')
-rw-r--r--cmds-receive.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmds-receive.c b/cmds-receive.c
index ed441076..cce37a7a 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -257,8 +257,15 @@ static int process_snapshot(const char *path, const u8 *uuid, u64 ctransid,
O_RDONLY | O_NOATIME);
if (args_v2.fd < 0) {
ret = -errno;
- fprintf(stderr, "ERROR: open %s failed. %s\n",
- parent_subvol->path, strerror(-ret));
+ if (errno != ENOENT)
+ fprintf(stderr, "ERROR: open %s failed. %s\n",
+ parent_subvol->path, strerror(-ret));
+ else
+ fprintf(stderr,
+ "It seems that you have changed your default "
+ "subvolume or you specify other subvolume to\n"
+ "mount btrfs, try to remount this btrfs filesystem "
+ "with fs tree, and run btrfs receive again!\n");
goto out;
}