Skip to contentSkip to conversation

ceph: show more detail logs during mount

PATCH New [email protected] 1 participant 1 message Feb 26, 2020 Ceph client

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ceph: show more detail logs during mount

From: Xiubo Li <[email protected]>

Print the logs in error level to give a helpful hint to make it more user-friendly to do debug.

URL: https://tracker.ceph.com/issues/44215

---
 fs/ceph/super.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
fs/ceph/super.c +7 -2
index c7f150686a53..0768e1bbd22e 100644
@@ -905,8 +905,11 @@ static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc,
 				     fsc->mount_options->server_path + 1 : "";
 
 		err = __ceph_open_session(fsc->client, started);
-		if (err < 0)
+		if (err < 0) {
+			errorfc(fc, "mount joining the ceph cluster fail %d",
+				err);
 			goto out;
+		}
 
 		/* setup fscache */
 		if (fsc->mount_options->flags & CEPH_MOUNT_OPT_FSCACHE) {
@@ -922,6 +925,8 @@ static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc,
 		root = open_root_dentry(fsc, path, started);
 		if (IS_ERR(root)) {
 			err = PTR_ERR(root);
+			errorfc(fc, "mount opening the root directory fail %d",
+				err);
 			goto out;
 		}
 		fsc->sb->s_root = dget(root);
@@ -1079,7 +1084,7 @@ static int ceph_get_tree(struct fs_context *fc)
 
 out_splat:
 	if (!ceph_mdsmap_is_cluster_available(fsc->mdsc->mdsmap)) {
-		pr_info("No mds server is up or the cluster is laggy\n");
+		errorfc(fc, "No mds server is up or the cluster is laggy");
 		err = -EHOSTUNREACH;
 	}
 
Signature · 1 line
2.21.0