Message ID | CAHf9xva-ARL_fhB6xS4_-f4KmuOF6wrajJ=HuVSmswLyz31Fdw@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi Alex, On Tue, Aug 28, 2012 at 08:26:22PM +0300, Alex Lyakas wrote: > can you pls apply this patch. It should solve the issue (your script > now runs ok for me). have you considered sending this patch separately? thanks, david -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/cmds-receive.c b/cmds-receive.c index a8be6fa..3ee2ff8 100644 --- a/cmds-receive.c +++ b/cmds-receive.c @@ -792,11 +792,18 @@ int do_receive(struct btrfs_receive *r, const char *tomnt, int r_fd) int ret; int end = 0; - r->root_path = strdup(tomnt); - r->mnt_fd = open(tomnt, O_RDONLY | O_NOATIME); + r->root_path = realpath(tomnt, NULL); + if (!r->root_path) { + ret = -errno; + fprintf(stderr, "ERROR: realpath %s failed. " + "%s\n", tomnt, strerror(-ret)); + goto out; + } + + r->mnt_fd = open(r->root_path, O_RDONLY | O_NOATIME); if (r->mnt_fd < 0) { ret = -errno; - fprintf(stderr, "ERROR: failed to open %s. %s\n", tomnt, + fprintf(stderr, "ERROR: failed to open %s. %s\n", r->root_path, strerror(-ret)); goto out;