Thread (20 messages) 20 messages, 5 authors, 2012-07-27

Re: [RFC PATCH 6/6] Btrfs-progs: add btrfs send/receive commands

From: Alex Lyakas <hidden>
Date: 2012-07-25 09:15:59

Thanks!

So now:
A_PATH -> path -> full_path -> newpath
A_PATH_LINK  -> lnk -> full_link_path -> oldpath

while I viewed it the other way around.

I guess it's not important what is left/right, old/new :) as long as
it's consistent.

Alex.


On Tue, Jul 24, 2012 at 11:27 PM, Alexander Block
[off-list ref] wrote:
On Thu, Jul 19, 2012 at 3:25 PM, Alex Lyakas
[off-list ref] wrote:
quoted
+static int process_link(const char *path, const char *lnk, void *user)
+{
+       int ret;
+       struct btrfs_receive *r = user;
+       char *full_path = path_cat(r->full_subvol_path, path);
+
+       if (g_verbose >= 1)
+               fprintf(stderr, "link %s -> %s\n", path, lnk);
+
+       ret = link(lnk, full_path);
+       if (ret < 0) {
+               ret = -errno;
+               fprintf(stderr, "ERROR: link %s -> %s failed. %s\n", path,
+                               lnk, strerror(-ret));
+       }

Actually it has to be:
char *full_link_path = path_cat(r->full_subvol_path, lnk);
...
ret = link(full_path/*oldpath*/, full_link_path/*newpath*/);
...
free(full_link_path);

Thanks,
Alex.
Actually, the pathes got mixed up in-kernel. You'll find a pushed fix
in the kernel repo. I also pushed a fix to btrfs-progs containing the
full_link_path. Thanks again :)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help