[Devel,2/2] spfs: fix usage of mi->ns_mountpoint

Submitted by Stanislav Kinsburskiy on June 9, 2017, 1:44 p.m.

Details

Message ID 20170609134428.863719.91018.stgit@skinsbursky-vz7.qa.sw.ru
State New
Series "spfs: update to work with CRIU v3"
Headers show

Commit Message

Stanislav Kinsburskiy June 9, 2017, 1:44 p.m.
Previously this path had slash at the end. Now it doesn't have.
Update usage then.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky@virtuozzo.com>
---
 criu/files-reg.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/criu/files-reg.c b/criu/files-reg.c
index e812b27..2577a48 100644
--- a/criu/files-reg.c
+++ b/criu/files-reg.c
@@ -595,7 +595,7 @@  static int open_remap_spfs_linked(struct reg_file_info *rfi,
 	}
 	strcpy(link_remap, path);
 
-	snprintf(path + root_len, sizeof(path) - root_len, "%s", rfi->path);
+	snprintf(path + root_len, sizeof(path) - root_len, "/%s", rfi->path);
 
 	rdesc = find_file_desc_raw(FD_TYPES__REG, rfe->remap_id);
 	if (!rdesc) {
@@ -605,7 +605,7 @@  static int open_remap_spfs_linked(struct reg_file_info *rfi,
 
 	rrfi = container_of(rdesc, struct reg_file_info, d);
 
-	snprintf(link_remap + root_len, sizeof(link_remap) - root_len, "%s", rrfi->path);
+	snprintf(link_remap + root_len, sizeof(link_remap) - root_len, "/%s", rrfi->path);
 
 	pr_info("Creating spfs link %s for %s\n", link_remap, path);
 
@@ -617,7 +617,7 @@  static int open_remap_spfs_linked(struct reg_file_info *rfi,
 
 	mi = lookup_mnt_id(rfi->rfe->mnt_id);
 
-	err = spfs_remap_path(path, link_remap + root_len + strlen(mi->ns_mountpoint) - 1);
+	err = spfs_remap_path(path, link_remap + root_len + strlen(mi->ns_mountpoint));
 	if (err) {
 		pr_err("failed to remap SPFS %s to %s\n", path, link_remap);
 		return -errno;