[PATCH] btrfs-progs: use openat for process_clone in receive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Emil Karlson <jekarlson@xxxxxxxxx>

This will fix breakage, when doing chrooted receive with cloned paths
outside main subvolume.
---
 cmds-receive.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmds-receive.c b/cmds-receive.c
index b7cf3f9..b0a312c 100644
--- a/cmds-receive.c
+++ b/cmds-receive.c
@@ -609,9 +609,9 @@ static int process_clone(const char *path, u64 offset, u64 len,
 		subvol_path = strdup(si->path);
 	}
 
-	full_clone_path = path_cat3(r->root_path, subvol_path, clone_path);
+	full_clone_path = path_cat(subvol_path, clone_path);
 
-	clone_fd = open(full_clone_path, O_RDONLY | O_NOATIME);
+	clone_fd = openat(r->mnt_fd, full_clone_path, O_RDONLY | O_NOATIME);
 	if (clone_fd < 0) {
 		ret = -errno;
 		fprintf(stderr, "ERROR: failed to open %s. %s\n",
-- 
2.3.6

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux