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

Submitted by Stanislav Kinsburskiy on Dec. 20, 2017, 4:06 p.m.

Details

Message ID 20171220160656.957380.81545.stgit@skinsbursky-vz7.qa.sw.ru
State New
Series "spfs: duplicate socket before sending it from usernsd"
Headers show

Commit Message

Stanislav Kinsburskiy Dec. 20, 2017, 4:06 p.m.
Use request_spfs_mngr_sock() for both start and socket request.

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

Patch hide | download patch | download mbox

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)