Skip to contentSkip to conversation

ceph: show more detail logs during mount

PATCH Superseded [email protected] 2 participants 3 messages Feb 25, 2020 – Feb 26, 2020

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 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 debug.

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

---
 fs/ceph/super.c       | 8 ++++++--
 net/ceph/mon_client.c | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)
fs/ceph/super.c +6 -2
index c7f150686a53..e33c2f86647b 100644
@@ -905,8 +905,10 @@ 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) {
+			pr_err("mount joining the ceph cluster fail %d\n", err);
 			goto out;
+		}
 
 		/* setup fscache */
 		if (fsc->mount_options->flags & CEPH_MOUNT_OPT_FSCACHE) {
@@ -922,6 +924,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);
+			pr_err("mount opening the root directory fail %d\n",
+			       err);
 			goto out;
 		}
 		fsc->sb->s_root = dget(root);
@@ -1079,7 +1083,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");
+		pr_err("No mds server is up or the cluster is laggy\n");
 		err = -EHOSTUNREACH;
 	}
 
net/ceph/mon_client.c +2 -0
index 9d9e4e4ea600..6f1372f5f2a7 100644
@@ -1179,6 +1179,8 @@ static void handle_auth_reply(struct ceph_mon_client *monc,
 
 	if (ret < 0) {
 		monc->client->auth_err = ret;
+		pr_err("authenticate fail on mon%d %s\n", monc->cur_mon,
+			ceph_pr_addr(&monc->con.peer_addr));
 	} else if (!was_auth && ceph_auth_is_authenticated(monc->auth)) {
 		dout("authenticated, starting session\n");
 
Signature · 1 line
2.21.0
maintainer
#1 lore raw
Quoted 30 lines · On Tue, Feb 25, 2020 at 4:30 AM <[email protected]> wrote:

From: Xiubo Li <[email protected]>

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

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

---
 fs/ceph/super.c       | 8 ++++++--
 net/ceph/mon_client.c | 2 ++
 2 files changed, 8 insertions(+), 2 deletions(-)
fs/ceph/super.c +3 -1
index c7f150686a53..e33c2f86647b 100644
@@ -905,8 +905,10 @@ 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) {
+                       pr_err("mount joining the ceph cluster fail %d\n", err);
                        goto out;
+               }
 
                /* setup fscache */
                if (fsc->mount_options->flags & CEPH_MOUNT_OPT_FSCACHE) {

fs/ceph/super.c static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc, · line 928

Quoted 5 lines
fs/ceph/super.c +2 -0
@@ -922,6 +924,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);
+                       pr_err("mount opening the root directory fail %d\n",
+                              err);

Hi Xiubo,

Given that these are new user-level filesystem log messages, they should probably go into fs_context log.

fs/ceph/super.c static int ceph_get_tree(struct fs_context *fc) · line 1088

Quoted 11 lines
fs/ceph/super.c +1 -1
                        goto out;
                }
                fsc->sb->s_root = dget(root);
@@ -1079,7 +1083,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");
+               pr_err("No mds server is up or the cluster is laggy\n");
                err = -EHOSTUNREACH;
        }

If you are changing this one, it should be directed to fs_context log as well.

net/ceph/mon_client.c static void handle_auth_reply(struct ceph_mon_client *monc, · line 1183

Quoted 11 lines
net/ceph/mon_client.c +2 -0
index 9d9e4e4ea600..6f1372f5f2a7 100644
@@ -1179,6 +1179,8 @@ static void handle_auth_reply(struct ceph_mon_client *monc,
 
        if (ret < 0) {
                monc->client->auth_err = ret;
+               pr_err("authenticate fail on mon%d %s\n", monc->cur_mon,
+                       ceph_pr_addr(&monc->con.peer_addr));

I don't think this is needed. Authentication errors are already logged in ceph_handle_auth_reply().

Thanks,

Ilya

author
#2 lore raw
Quoted 37 lines · Ilya Dryomov
Quoted 29 lines · On Tue, Feb 25, 2020 at 4:30 AM <[email protected]> wrote:

From: Xiubo Li <[email protected]>

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

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

---
  fs/ceph/super.c       | 8 ++++++--
  net/ceph/mon_client.c | 2 ++
  2 files changed, 8 insertions(+), 2 deletions(-)
fs/ceph/super.c +3 -1
index c7f150686a53..e33c2f86647b 100644
@@ -905,8 +905,10 @@ 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) {
+                       pr_err("mount joining the ceph cluster fail %d\n", err);
                         goto out;
+               }
 
                 /* setup fscache */
                 if (fsc->mount_options->flags & CEPH_MOUNT_OPT_FSCACHE) {

fs/ceph/super.c static struct dentry *ceph_real_mount(struct ceph_fs_client *fsc, · line 928

Quoted 5 lines
fs/ceph/super.c +2 -0
@@ -922,6 +924,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);
+                       pr_err("mount opening the root directory fail %d\n",
+                              err);

Hi Xiubo,

Quoted 2 lines

Given that these are new user-level filesystem log messages, they should probably go into fs_context log.

Yeah, will fix it.

Quoted 6 lines
Quoted 6 lines
fs/ceph/super.c +0 -0
                         goto out;
                 }
                 fsc->sb->s_root = dget(root);
@@ -1079,7 +1083,7 @@ static int ceph_get_tree(struct fs_context *fc)
 
Quoted 8 lines

fs/ceph/super.c static int ceph_get_tree(struct fs_context *fc) · line 1088

Quoted 6 lines
fs/ceph/super.c +1 -1
  out_splat:
         if (!ceph_mdsmap_is_cluster_available(fsc->mdsc->mdsmap)) {
-               pr_info("No mds server is up or the cluster is laggy\n");
+               pr_err("No mds server is up or the cluster is laggy\n");
                 err = -EHOSTUNREACH;
         }

If you are changing this one, it should be directed to fs_context log as well.

Will do it.

Quoted 6 lines
Quoted 6 lines
net/ceph/mon_client.c +0 -0
index 9d9e4e4ea600..6f1372f5f2a7 100644
@@ -1179,6 +1179,8 @@ static void handle_auth_reply(struct ceph_mon_client *monc,
 
Quoted 6 lines

net/ceph/mon_client.c static void handle_auth_reply(struct ceph_mon_client *monc, · line 1183

Quoted 4 lines
net/ceph/mon_client.c +2 -0
         if (ret < 0) {
                 monc->client->auth_err = ret;
+               pr_err("authenticate fail on mon%d %s\n", monc->cur_mon,
+                       ceph_pr_addr(&monc->con.peer_addr));

I don't think this is needed. Authentication errors are already logged in ceph_handle_auth_reply().

Yeah, it is, here just want to give more messages, such as the monX. But it is not necessary. So I will delete it.

Thanks Ilya.

BRs

Quoted 4 lines

Thanks,

Ilya