diff mbox series

[v3] ceph: show more detail logs during mount

Message ID 20200226025112.3839-1-xiubli@redhat.com (mailing list archive)
State New, archived
Headers show
Series [v3] ceph: show more detail logs during mount | expand

Commit Message

Xiubo Li Feb. 26, 2020, 2:51 a.m. UTC
From: Xiubo Li <xiubli@redhat.com>

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
Signed-off-by: Xiubo Li <xiubli@redhat.com>
---
 fs/ceph/super.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/fs/ceph/super.c b/fs/ceph/super.c
index c7f150686a53..0768e1bbd22e 100644
--- a/fs/ceph/super.c
+++ b/fs/ceph/super.c
@@ -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;
 	}