Check if we're really on a btrfs filesystem before we call btrfs_same_fs().
Otherwise we will report misleading errors although everything went fine.
Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
#include "lxcrsync.h"
#include "utils.h"
-lxc_log_define(btrfs, lxc);
+lxc_log_define(lxcbtrfs, lxc);
/* defined in lxccontainer.c: needs to become common helper */
extern char *dir_new_path(char *src, const char *oldname, const char *name,
#include "lxcrsync.h"
#include "utils.h"
-lxc_log_define(overlay, lxc);
+lxc_log_define(lxcoverlay, lxc);
static char *ovl_name;
snprintf(p0, l0, "%s/%s", c0->config_path, c0->name);
snprintf(p1, l1, "%s/%s", c1->config_path, c1->name);
+
+ if (!is_btrfs_fs(p0) || !is_btrfs_fs(p1))
+ return false;
+
return btrfs_same_fs(p0, p1) == 0;
}