[Devel] [PATCH 2/7] spfs: improve error and debug output for spfs_mount()

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Wed Dec 20 19:06:56 MSK 2017


Use request_spfs_mngr_sock() for both start and socket request.

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 criu/spfs.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/criu/spfs.c b/criu/spfs.c
index fff7b9f..c202b14 100644
--- a/criu/spfs.c
+++ b/criu/spfs.c
@@ -294,18 +294,23 @@ int spfs_mount(struct mount_info *mi, const char *source,
 
 	sock = start_spfs_mngr();
 	if (sock < 0) {
-		pr_err("failed to mount NFS to path %s\n", mi->mountpoint);
-		return sock;
+		pr_err("failed to connect to SPFS manager: %d\n", sock);
+		ret = sock;
+		goto err;
 	}
-
 	ret = spfs_request_mount(sock, mi, source, filesystemtype, mountflags);
 	close(sock);
 	if (ret) {
-		pr_err("mount of %s (%s) failed: %d\n", source, filesystemtype, ret);
-		return ret;
+		pr_err("mount request for %s (%s) failed: %d\n",
+				source, filesystemtype, ret);
+		goto err;
 	}
 
 	return 0;
+
+err:
+	pr_err("failed to mount NFS to path %s\n", mi->mountpoint);
+	return ret;
 }
 
 int spfs_set_env(void)



More information about the Devel mailing list