2022-09-27 09:52:04

by ZhouJie

[permalink] [raw]
Subject: [PATCH] fs/ceph:Modify the return value to void

Modify the return value of the integer to void.

Signed-off-by: Zhou jie <[email protected]>
---
fs/ceph/debugfs.c | 38 +++++++++++++-------------------------
1 file changed, 13 insertions(+), 25 deletions(-)

diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c
index bec3c4549c07..e4852a1c4a0a 100644
--- a/fs/ceph/debugfs.c
+++ b/fs/ceph/debugfs.c
@@ -22,14 +22,14 @@
#include "mds_client.h"
#include "metric.h"

-static int mdsmap_show(struct seq_file *s, void *p)
+static void mdsmap_show(struct seq_file *s, void *p)
{
int i;
struct ceph_fs_client *fsc = s->private;
struct ceph_mdsmap *mdsmap;

if (!fsc->mdsc || !fsc->mdsc->mdsmap)
- return 0;
+ return;
mdsmap = fsc->mdsc->mdsmap;
seq_printf(s, "epoch %d\n", mdsmap->m_epoch);
seq_printf(s, "root %d\n", mdsmap->m_root);
@@ -43,13 +43,12 @@ static int mdsmap_show(struct seq_file *s, void *p)
ceph_pr_addr(addr),
ceph_mds_state_name(state));
}
- return 0;
}

/*
* mdsc debugfs
*/
-static int mdsc_show(struct seq_file *s, void *p)
+static void mdsc_show(struct seq_file *s, void *p)
{
struct ceph_fs_client *fsc = s->private;
struct ceph_mds_client *mdsc = fsc->mdsc;
@@ -124,7 +123,6 @@ static int mdsc_show(struct seq_file *s, void *p)
}
mutex_unlock(&mdsc->mutex);

- return 0;
}

#define CEPH_LAT_METRIC_SHOW(name, total, avg, min, max, sq) { \
@@ -146,7 +144,7 @@ static int mdsc_show(struct seq_file *s, void *p)
name, total, avg, _min, max, sum); \
}

-static int metrics_file_show(struct seq_file *s, void *p)
+static void metrics_file_show(struct seq_file *s, void *p)
{
struct ceph_fs_client *fsc = s->private;
struct ceph_client_metric *m = &fsc->mdsc->metric;
@@ -161,7 +159,6 @@ static int metrics_file_show(struct seq_file *s, void *p)
atomic64_read(&m->total_caps));
seq_printf(s, "%-35s%lld\n", "opened inodes",
percpu_counter_sum(&m->opened_inodes));
- return 0;
}

static const char * const metric_str[] = {
@@ -170,7 +167,7 @@ static const char * const metric_str[] = {
"metadata",
"copyfrom"
};
-static int metrics_latency_show(struct seq_file *s, void *p)
+static void metrics_latency_show(struct seq_file *s, void *p)
{
struct ceph_fs_client *fsc = s->private;
struct ceph_client_metric *cm = &fsc->mdsc->metric;
@@ -193,10 +190,9 @@ static int metrics_latency_show(struct seq_file *s, void *p)
CEPH_LAT_METRIC_SHOW(metric_str[i], total, avg, min, max, sq);
}

- return 0;
}

-static int metrics_size_show(struct seq_file *s, void *p)
+static void metrics_size_show(struct seq_file *s, void *p)
{
struct ceph_fs_client *fsc = s->private;
struct ceph_client_metric *cm = &fsc->mdsc->metric;
@@ -223,10 +219,9 @@ static int metrics_size_show(struct seq_file *s, void *p)
CEPH_SZ_METRIC_SHOW(metric_str[i], total, avg, min, max, sum);
}

- return 0;
}

-static int metrics_caps_show(struct seq_file *s, void *p)
+static void metrics_caps_show(struct seq_file *s, void *p)
{
struct ceph_fs_client *fsc = s->private;
struct ceph_client_metric *m = &fsc->mdsc->metric;
@@ -245,10 +240,9 @@ static int metrics_caps_show(struct seq_file *s, void *p)
percpu_counter_sum(&m->i_caps_mis),
percpu_counter_sum(&m->i_caps_hit));

- return 0;
}

-static int caps_show_cb(struct inode *inode, struct ceph_cap *cap, void *p)
+static void caps_show_cb(struct inode *inode, struct ceph_cap *cap, void *p)
{
struct seq_file *s = p;

@@ -256,10 +250,9 @@ static int caps_show_cb(struct inode *inode, struct ceph_cap *cap, void *p)
cap->session->s_mds,
ceph_cap_string(cap->issued),
ceph_cap_string(cap->implemented));
- return 0;
}

-static int caps_show(struct seq_file *s, void *p)
+static void caps_show(struct seq_file *s, void *p)
{
struct ceph_fs_client *fsc = s->private;
struct ceph_mds_client *mdsc = fsc->mdsc;
@@ -304,10 +297,9 @@ static int caps_show(struct seq_file *s, void *p)
}
spin_unlock(&mdsc->caps_list_lock);

- return 0;
}

-static int mds_sessions_show(struct seq_file *s, void *ptr)
+static void mds_sessions_show(struct seq_file *s, void *ptr)
{
struct ceph_fs_client *fsc = s->private;
struct ceph_mds_client *mdsc = fsc->mdsc;
@@ -340,10 +332,9 @@ static int mds_sessions_show(struct seq_file *s, void *ptr)
}
mutex_unlock(&mdsc->mutex);

- return 0;
}

-static int status_show(struct seq_file *s, void *p)
+static void status_show(struct seq_file *s, void *p)
{
struct ceph_fs_client *fsc = s->private;
struct ceph_entity_inst *inst = &fsc->client->msgr.inst;
@@ -353,7 +344,6 @@ static int status_show(struct seq_file *s, void *p)
ceph_pr_addr(client_addr), le32_to_cpu(client_addr->nonce));
seq_printf(s, "blocklisted: %s\n", fsc->blocklisted ? "true" : "false");

- return 0;
}

DEFINE_SHOW_ATTRIBUTE(mdsmap);
@@ -370,20 +360,18 @@ DEFINE_SHOW_ATTRIBUTE(metrics_caps);
/*
* debugfs
*/
-static int congestion_kb_set(void *data, u64 val)
+static void congestion_kb_set(void *data, u64 val)
{
struct ceph_fs_client *fsc = (struct ceph_fs_client *)data;

fsc->mount_options->congestion_kb = (int)val;
- return 0;
}

-static int congestion_kb_get(void *data, u64 *val)
+static void congestion_kb_get(void *data, u64 *val)
{
struct ceph_fs_client *fsc = (struct ceph_fs_client *)data;

*val = (u64)fsc->mount_options->congestion_kb;
- return 0;
}

DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
--
2.18.2


2022-09-29 15:22:52

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] fs/ceph:Modify the return value to void

Hi Zhou,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on ceph-client/for-linus]
[also build test ERROR on linus/master v6.0-rc7 next-20220928]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Zhou-jie/fs-ceph-Modify-the-return-value-to-void/20220927-165857
base: https://github.com/ceph/ceph-client.git for-linus
config: hexagon-randconfig-r041-20220926
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/6c7163052ce6f51c217c650bc5592b7ef50b2280
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Zhou-jie/fs-ceph-Modify-the-return-value-to-void/20220927-165857
git checkout 6c7163052ce6f51c217c650bc5592b7ef50b2280
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash fs/ceph/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

>> fs/ceph/debugfs.c:281:38: error: incompatible function pointer types passing 'void (struct inode *, struct ceph_cap *, void *)' to parameter of type 'int (*)(struct inode *, struct ceph_cap *, void *)' [-Wincompatible-function-pointer-types]
ceph_iterate_session_caps(session, caps_show_cb, s);
^~~~~~~~~~~~
fs/ceph/mds_client.h:540:16: note: passing argument to parameter 'cb' here
int (*cb)(struct inode *,
^
>> fs/ceph/debugfs.c:349:1: error: incompatible function pointer types passing 'void (struct seq_file *, void *)' to parameter of type 'int (*)(struct seq_file *, void *)' [-Wincompatible-function-pointer-types]
DEFINE_SHOW_ATTRIBUTE(mdsmap);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/seq_file.h:199:27: note: expanded from macro 'DEFINE_SHOW_ATTRIBUTE'
return single_open(file, __name ## _show, inode->i_private); \
^~~~~~~~~~~~~~~
<scratch space>:79:1: note: expanded from here
mdsmap_show
^~~~~~~~~~~
include/linux/seq_file.h:166:38: note: passing argument to parameter here
int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
^
fs/ceph/debugfs.c:350:1: error: incompatible function pointer types passing 'void (struct seq_file *, void *)' to parameter of type 'int (*)(struct seq_file *, void *)' [-Wincompatible-function-pointer-types]
DEFINE_SHOW_ATTRIBUTE(mdsc);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/seq_file.h:199:27: note: expanded from macro 'DEFINE_SHOW_ATTRIBUTE'
return single_open(file, __name ## _show, inode->i_private); \
^~~~~~~~~~~~~~~
<scratch space>:83:1: note: expanded from here
mdsc_show
^~~~~~~~~
include/linux/seq_file.h:166:38: note: passing argument to parameter here
int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
^
fs/ceph/debugfs.c:351:1: error: incompatible function pointer types passing 'void (struct seq_file *, void *)' to parameter of type 'int (*)(struct seq_file *, void *)' [-Wincompatible-function-pointer-types]
DEFINE_SHOW_ATTRIBUTE(caps);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/seq_file.h:199:27: note: expanded from macro 'DEFINE_SHOW_ATTRIBUTE'
return single_open(file, __name ## _show, inode->i_private); \
^~~~~~~~~~~~~~~
<scratch space>:87:1: note: expanded from here
caps_show
^~~~~~~~~
include/linux/seq_file.h:166:38: note: passing argument to parameter here
int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
^
fs/ceph/debugfs.c:352:1: error: incompatible function pointer types passing 'void (struct seq_file *, void *)' to parameter of type 'int (*)(struct seq_file *, void *)' [-Wincompatible-function-pointer-types]
DEFINE_SHOW_ATTRIBUTE(mds_sessions);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/seq_file.h:199:27: note: expanded from macro 'DEFINE_SHOW_ATTRIBUTE'
return single_open(file, __name ## _show, inode->i_private); \
^~~~~~~~~~~~~~~
<scratch space>:91:1: note: expanded from here
mds_sessions_show
^~~~~~~~~~~~~~~~~
include/linux/seq_file.h:166:38: note: passing argument to parameter here
int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
^
fs/ceph/debugfs.c:353:1: error: incompatible function pointer types passing 'void (struct seq_file *, void *)' to parameter of type 'int (*)(struct seq_file *, void *)' [-Wincompatible-function-pointer-types]
DEFINE_SHOW_ATTRIBUTE(status);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/seq_file.h:199:27: note: expanded from macro 'DEFINE_SHOW_ATTRIBUTE'
return single_open(file, __name ## _show, inode->i_private); \
^~~~~~~~~~~~~~~
<scratch space>:95:1: note: expanded from here
status_show
^~~~~~~~~~~
include/linux/seq_file.h:166:38: note: passing argument to parameter here
int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
^
fs/ceph/debugfs.c:354:1: error: incompatible function pointer types passing 'void (struct seq_file *, void *)' to parameter of type 'int (*)(struct seq_file *, void *)' [-Wincompatible-function-pointer-types]
DEFINE_SHOW_ATTRIBUTE(metrics_file);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/seq_file.h:199:27: note: expanded from macro 'DEFINE_SHOW_ATTRIBUTE'
return single_open(file, __name ## _show, inode->i_private); \
^~~~~~~~~~~~~~~
<scratch space>:99:1: note: expanded from here
metrics_file_show
^~~~~~~~~~~~~~~~~
include/linux/seq_file.h:166:38: note: passing argument to parameter here
int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
^
fs/ceph/debugfs.c:355:1: error: incompatible function pointer types passing 'void (struct seq_file *, void *)' to parameter of type 'int (*)(struct seq_file *, void *)' [-Wincompatible-function-pointer-types]
DEFINE_SHOW_ATTRIBUTE(metrics_latency);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/seq_file.h:199:27: note: expanded from macro 'DEFINE_SHOW_ATTRIBUTE'
return single_open(file, __name ## _show, inode->i_private); \
^~~~~~~~~~~~~~~
<scratch space>:103:1: note: expanded from here
metrics_latency_show
^~~~~~~~~~~~~~~~~~~~
include/linux/seq_file.h:166:38: note: passing argument to parameter here
int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
^
fs/ceph/debugfs.c:356:1: error: incompatible function pointer types passing 'void (struct seq_file *, void *)' to parameter of type 'int (*)(struct seq_file *, void *)' [-Wincompatible-function-pointer-types]
DEFINE_SHOW_ATTRIBUTE(metrics_size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/seq_file.h:199:27: note: expanded from macro 'DEFINE_SHOW_ATTRIBUTE'
return single_open(file, __name ## _show, inode->i_private); \
^~~~~~~~~~~~~~~
<scratch space>:107:1: note: expanded from here
metrics_size_show
^~~~~~~~~~~~~~~~~
include/linux/seq_file.h:166:38: note: passing argument to parameter here
int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
^
fs/ceph/debugfs.c:357:1: error: incompatible function pointer types passing 'void (struct seq_file *, void *)' to parameter of type 'int (*)(struct seq_file *, void *)' [-Wincompatible-function-pointer-types]
DEFINE_SHOW_ATTRIBUTE(metrics_caps);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/seq_file.h:199:27: note: expanded from macro 'DEFINE_SHOW_ATTRIBUTE'
return single_open(file, __name ## _show, inode->i_private); \
^~~~~~~~~~~~~~~
<scratch space>:111:1: note: expanded from here
metrics_caps_show
^~~~~~~~~~~~~~~~~
include/linux/seq_file.h:166:38: note: passing argument to parameter here
int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
^
>> fs/ceph/debugfs.c:377:45: error: incompatible function pointer types passing 'void (void *, u64 *)' (aka 'void (void *, unsigned long long *)') to parameter of type 'int (*)(void *, u64 *)' (aka 'int (*)(void *, unsigned long long *)') [-Wincompatible-function-pointer-types]
DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
^~~~~~~~~~~~~~~~~
include/linux/fs.h:3352:39: note: expanded from macro 'DEFINE_SIMPLE_ATTRIBUTE'
return simple_attr_open(inode, file, __get, __set, __fmt); \
^~~~~
include/linux/fs.h:3370:14: note: passing argument to parameter 'get' here
int (*get)(void *, u64 *), int (*set)(void *, u64),
^
>> fs/ceph/debugfs.c:378:4: error: incompatible function pointer types passing 'void (void *, u64)' (aka 'void (void *, unsigned long long)') to parameter of type 'int (*)(void *, u64)' (aka 'int (*)(void *, unsigned long long)') [-Wincompatible-function-pointer-types]
congestion_kb_set, "%llu\n");
^~~~~~~~~~~~~~~~~
include/linux/fs.h:3352:46: note: expanded from macro 'DEFINE_SIMPLE_ATTRIBUTE'
return simple_attr_open(inode, file, __get, __set, __fmt); \
^~~~~
include/linux/fs.h:3370:41: note: passing argument to parameter 'set' here
int (*get)(void *, u64 *), int (*set)(void *, u64),
^
12 errors generated.


vim +281 fs/ceph/debugfs.c

ff4a80bf2d3f80 Jeff Layton 2019-04-24 254
6c7163052ce6f5 Zhou jie 2022-09-27 255 static void caps_show(struct seq_file *s, void *p)
76aa844d5b2fb8 Sage Weil 2009-10-06 256 {
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 257 struct ceph_fs_client *fsc = s->private;
ff4a80bf2d3f80 Jeff Layton 2019-04-24 258 struct ceph_mds_client *mdsc = fsc->mdsc;
ff4a80bf2d3f80 Jeff Layton 2019-04-24 259 int total, avail, used, reserved, min, i;
3a3430affce5de Jeff Layton 2019-11-20 260 struct cap_wait *cw;
76aa844d5b2fb8 Sage Weil 2009-10-06 261
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 262 ceph_reservation_status(fsc, &total, &avail, &used, &reserved, &min);
76aa844d5b2fb8 Sage Weil 2009-10-06 263 seq_printf(s, "total\t\t%d\n"
76aa844d5b2fb8 Sage Weil 2009-10-06 264 "avail\t\t%d\n"
76aa844d5b2fb8 Sage Weil 2009-10-06 265 "used\t\t%d\n"
85ccce43a3fc15 Sage Weil 2010-02-17 266 "reserved\t%d\n"
ff4a80bf2d3f80 Jeff Layton 2019-04-24 267 "min\t\t%d\n\n",
85ccce43a3fc15 Sage Weil 2010-02-17 268 total, avail, used, reserved, min);
3a8ebe0b8b616c Yanhu Cao 2020-08-24 269 seq_printf(s, "ino mds issued implemented\n");
3a8ebe0b8b616c Yanhu Cao 2020-08-24 270 seq_printf(s, "--------------------------------------------------\n");
ff4a80bf2d3f80 Jeff Layton 2019-04-24 271
ff4a80bf2d3f80 Jeff Layton 2019-04-24 272 mutex_lock(&mdsc->mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 273 for (i = 0; i < mdsc->max_sessions; i++) {
ff4a80bf2d3f80 Jeff Layton 2019-04-24 274 struct ceph_mds_session *session;
ff4a80bf2d3f80 Jeff Layton 2019-04-24 275
ff4a80bf2d3f80 Jeff Layton 2019-04-24 276 session = __ceph_lookup_mds_session(mdsc, i);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 277 if (!session)
ff4a80bf2d3f80 Jeff Layton 2019-04-24 278 continue;
ff4a80bf2d3f80 Jeff Layton 2019-04-24 279 mutex_unlock(&mdsc->mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 280 mutex_lock(&session->s_mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 @281 ceph_iterate_session_caps(session, caps_show_cb, s);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 282 mutex_unlock(&session->s_mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 283 ceph_put_mds_session(session);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 284 mutex_lock(&mdsc->mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 285 }
ff4a80bf2d3f80 Jeff Layton 2019-04-24 286 mutex_unlock(&mdsc->mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 287
3a3430affce5de Jeff Layton 2019-11-20 288 seq_printf(s, "\n\nWaiters:\n--------\n");
3a3430affce5de Jeff Layton 2019-11-20 289 seq_printf(s, "tgid ino need want\n");
3a3430affce5de Jeff Layton 2019-11-20 290 seq_printf(s, "-----------------------------------------------------\n");
3a3430affce5de Jeff Layton 2019-11-20 291
3a3430affce5de Jeff Layton 2019-11-20 292 spin_lock(&mdsc->caps_list_lock);
3a3430affce5de Jeff Layton 2019-11-20 293 list_for_each_entry(cw, &mdsc->cap_wait_list, list) {
ebce3eb2f7ef9f Jeff Layton 2020-08-18 294 seq_printf(s, "%-13d0x%-17llx%-17s%-17s\n", cw->tgid, cw->ino,
3a3430affce5de Jeff Layton 2019-11-20 295 ceph_cap_string(cw->need),
3a3430affce5de Jeff Layton 2019-11-20 296 ceph_cap_string(cw->want));
3a3430affce5de Jeff Layton 2019-11-20 297 }
3a3430affce5de Jeff Layton 2019-11-20 298 spin_unlock(&mdsc->caps_list_lock);
3a3430affce5de Jeff Layton 2019-11-20 299
76aa844d5b2fb8 Sage Weil 2009-10-06 300 }
76aa844d5b2fb8 Sage Weil 2009-10-06 301
6c7163052ce6f5 Zhou jie 2022-09-27 302 static void mds_sessions_show(struct seq_file *s, void *ptr)
14ed97033dac4c John Spray 2014-09-12 303 {
14ed97033dac4c John Spray 2014-09-12 304 struct ceph_fs_client *fsc = s->private;
14ed97033dac4c John Spray 2014-09-12 305 struct ceph_mds_client *mdsc = fsc->mdsc;
14ed97033dac4c John Spray 2014-09-12 306 struct ceph_auth_client *ac = fsc->client->monc.auth;
14ed97033dac4c John Spray 2014-09-12 307 struct ceph_options *opt = fsc->client->options;
2c81ef286c42c5 Colin Ian King 2020-07-23 308 int mds;
14ed97033dac4c John Spray 2014-09-12 309
14ed97033dac4c John Spray 2014-09-12 310 mutex_lock(&mdsc->mutex);
14ed97033dac4c John Spray 2014-09-12 311
14ed97033dac4c John Spray 2014-09-12 312 /* The 'num' portion of an 'entity name' */
14ed97033dac4c John Spray 2014-09-12 313 seq_printf(s, "global_id %llu\n", ac->global_id);
14ed97033dac4c John Spray 2014-09-12 314
14ed97033dac4c John Spray 2014-09-12 315 /* The -o name mount argument */
14ed97033dac4c John Spray 2014-09-12 316 seq_printf(s, "name \"%s\"\n", opt->name ? opt->name : "");
14ed97033dac4c John Spray 2014-09-12 317
14ed97033dac4c John Spray 2014-09-12 318 /* The list of MDS session rank+state */
14ed97033dac4c John Spray 2014-09-12 319 for (mds = 0; mds < mdsc->max_sessions; mds++) {
14ed97033dac4c John Spray 2014-09-12 320 struct ceph_mds_session *session =
14ed97033dac4c John Spray 2014-09-12 321 __ceph_lookup_mds_session(mdsc, mds);
14ed97033dac4c John Spray 2014-09-12 322 if (!session) {
14ed97033dac4c John Spray 2014-09-12 323 continue;
14ed97033dac4c John Spray 2014-09-12 324 }
14ed97033dac4c John Spray 2014-09-12 325 mutex_unlock(&mdsc->mutex);
14ed97033dac4c John Spray 2014-09-12 326 seq_printf(s, "mds.%d %s\n",
14ed97033dac4c John Spray 2014-09-12 327 session->s_mds,
14ed97033dac4c John Spray 2014-09-12 328 ceph_session_state_name(session->s_state));
14ed97033dac4c John Spray 2014-09-12 329
14ed97033dac4c John Spray 2014-09-12 330 ceph_put_mds_session(session);
14ed97033dac4c John Spray 2014-09-12 331 mutex_lock(&mdsc->mutex);
14ed97033dac4c John Spray 2014-09-12 332 }
14ed97033dac4c John Spray 2014-09-12 333 mutex_unlock(&mdsc->mutex);
14ed97033dac4c John Spray 2014-09-12 334
14ed97033dac4c John Spray 2014-09-12 335 }
14ed97033dac4c John Spray 2014-09-12 336
6c7163052ce6f5 Zhou jie 2022-09-27 337 static void status_show(struct seq_file *s, void *p)
247b1f19dbeb48 Xiubo Li 2020-11-11 338 {
247b1f19dbeb48 Xiubo Li 2020-11-11 339 struct ceph_fs_client *fsc = s->private;
247b1f19dbeb48 Xiubo Li 2020-11-11 340 struct ceph_entity_inst *inst = &fsc->client->msgr.inst;
247b1f19dbeb48 Xiubo Li 2020-11-11 341 struct ceph_entity_addr *client_addr = ceph_client_addr(fsc->client);
247b1f19dbeb48 Xiubo Li 2020-11-11 342
247b1f19dbeb48 Xiubo Li 2020-11-11 343 seq_printf(s, "instance: %s.%lld %s/%u\n", ENTITY_NAME(inst->name),
247b1f19dbeb48 Xiubo Li 2020-11-11 344 ceph_pr_addr(client_addr), le32_to_cpu(client_addr->nonce));
247b1f19dbeb48 Xiubo Li 2020-11-11 345 seq_printf(s, "blocklisted: %s\n", fsc->blocklisted ? "true" : "false");
247b1f19dbeb48 Xiubo Li 2020-11-11 346
247b1f19dbeb48 Xiubo Li 2020-11-11 347 }
247b1f19dbeb48 Xiubo Li 2020-11-11 348
072eaf3c0f0fd2 Ilya Dryomov 2020-01-28 @349 DEFINE_SHOW_ATTRIBUTE(mdsmap);
072eaf3c0f0fd2 Ilya Dryomov 2020-01-28 350 DEFINE_SHOW_ATTRIBUTE(mdsc);
072eaf3c0f0fd2 Ilya Dryomov 2020-01-28 351 DEFINE_SHOW_ATTRIBUTE(caps);
072eaf3c0f0fd2 Ilya Dryomov 2020-01-28 352 DEFINE_SHOW_ATTRIBUTE(mds_sessions);
247b1f19dbeb48 Xiubo Li 2020-11-11 353 DEFINE_SHOW_ATTRIBUTE(status);
cbed4ff76bbb80 Lu?s Henriques 2021-10-27 354 DEFINE_SHOW_ATTRIBUTE(metrics_file);
cbed4ff76bbb80 Lu?s Henriques 2021-10-27 355 DEFINE_SHOW_ATTRIBUTE(metrics_latency);
cbed4ff76bbb80 Lu?s Henriques 2021-10-27 356 DEFINE_SHOW_ATTRIBUTE(metrics_size);
cbed4ff76bbb80 Lu?s Henriques 2021-10-27 357 DEFINE_SHOW_ATTRIBUTE(metrics_caps);
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 358
76aa844d5b2fb8 Sage Weil 2009-10-06 359
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 360 /*
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 361 * debugfs
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 362 */
6c7163052ce6f5 Zhou jie 2022-09-27 363 static void congestion_kb_set(void *data, u64 val)
2baba25019ec56 Yehuda Sadeh 2009-12-18 364 {
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 365 struct ceph_fs_client *fsc = (struct ceph_fs_client *)data;
2baba25019ec56 Yehuda Sadeh 2009-12-18 366
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 367 fsc->mount_options->congestion_kb = (int)val;
2baba25019ec56 Yehuda Sadeh 2009-12-18 368 }
2baba25019ec56 Yehuda Sadeh 2009-12-18 369
6c7163052ce6f5 Zhou jie 2022-09-27 370 static void congestion_kb_get(void *data, u64 *val)
2baba25019ec56 Yehuda Sadeh 2009-12-18 371 {
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 372 struct ceph_fs_client *fsc = (struct ceph_fs_client *)data;
2baba25019ec56 Yehuda Sadeh 2009-12-18 373
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 374 *val = (u64)fsc->mount_options->congestion_kb;
2baba25019ec56 Yehuda Sadeh 2009-12-18 375 }
2baba25019ec56 Yehuda Sadeh 2009-12-18 376
2baba25019ec56 Yehuda Sadeh 2009-12-18 @377 DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
2baba25019ec56 Yehuda Sadeh 2009-12-18 @378 congestion_kb_set, "%llu\n");
2baba25019ec56 Yehuda Sadeh 2009-12-18 379
76aa844d5b2fb8 Sage Weil 2009-10-06 380

--
0-DAY CI Kernel Test Service
https://01.org/lkp


Attachments:
(No filename) (20.32 kB)
config (165.12 kB)
Download all attachments

2022-09-29 20:16:57

by Ilya Dryomov

[permalink] [raw]
Subject: Re: [PATCH] fs/ceph:Modify the return value to void

On Thu, Sep 29, 2022 at 5:19 PM kernel test robot <[email protected]> wrote:
>
> Hi Zhou,
>
> Thank you for the patch! Yet something to improve:
>
> [auto build test ERROR on ceph-client/for-linus]
> [also build test ERROR on linus/master v6.0-rc7 next-20220928]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Zhou-jie/fs-ceph-Modify-the-return-value-to-void/20220927-165857
> base: https://github.com/ceph/ceph-client.git for-linus
> config: hexagon-randconfig-r041-20220926
> compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 791a7ae1ba3efd6bca96338e10ffde557ba83920)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://github.com/intel-lab-lkp/linux/commit/6c7163052ce6f51c217c650bc5592b7ef50b2280
> git remote add linux-review https://github.com/intel-lab-lkp/linux
> git fetch --no-tags linux-review Zhou-jie/fs-ceph-Modify-the-return-value-to-void/20220927-165857
> git checkout 6c7163052ce6f51c217c650bc5592b7ef50b2280
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash fs/ceph/
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <[email protected]>
>
> All errors (new ones prefixed by >>):
>
> >> fs/ceph/debugfs.c:281:38: error: incompatible function pointer types passing 'void (struct inode *, struct ceph_cap *, void *)' to parameter of type 'int (*)(struct inode *, struct ceph_cap *, void *)' [-Wincompatible-function-pointer-types]
> ceph_iterate_session_caps(session, caps_show_cb, s);
> ^~~~~~~~~~~~
> fs/ceph/mds_client.h:540:16: note: passing argument to parameter 'cb' here
> int (*cb)(struct inode *,
> ^
> >> fs/ceph/debugfs.c:349:1: error: incompatible function pointer types passing 'void (struct seq_file *, void *)' to parameter of type 'int (*)(struct seq_file *, void *)' [-Wincompatible-function-pointer-types]
> DEFINE_SHOW_ATTRIBUTE(mdsmap);
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/linux/seq_file.h:199:27: note: expanded from macro 'DEFINE_SHOW_ATTRIBUTE'
> return single_open(file, __name ## _show, inode->i_private); \
> ^~~~~~~~~~~~~~~
> <scratch space>:79:1: note: expanded from here
> mdsmap_show
> ^~~~~~~~~~~
> include/linux/seq_file.h:166:38: note: passing argument to parameter here
> int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
> ^
> fs/ceph/debugfs.c:350:1: error: incompatible function pointer types passing 'void (struct seq_file *, void *)' to parameter of type 'int (*)(struct seq_file *, void *)' [-Wincompatible-function-pointer-types]

Hi Zhou,

As you can see from the above output, the signatures of these
functions are dictated by debugfs infrastructure. Even though
we happen to return 0 in all cases, changing the return type to
void is wrong.

Thanks,

Ilya

2022-10-04 23:13:28

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH] fs/ceph:Modify the return value to void

Hi Zhou,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on ceph-client/for-linus]
[also build test ERROR on linus/master v6.0 next-20221004]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Zhou-jie/fs-ceph-Modify-the-return-value-to-void/20220927-165857
base: https://github.com/ceph/ceph-client.git for-linus
config: riscv-allyesconfig
compiler: riscv64-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/6c7163052ce6f51c217c650bc5592b7ef50b2280
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Zhou-jie/fs-ceph-Modify-the-return-value-to-void/20220927-165857
git checkout 6c7163052ce6f51c217c650bc5592b7ef50b2280
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=riscv SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

fs/ceph/debugfs.c: In function 'caps_show':
>> fs/ceph/debugfs.c:281:52: error: passing argument 2 of 'ceph_iterate_session_caps' from incompatible pointer type [-Werror=incompatible-pointer-types]
281 | ceph_iterate_session_caps(session, caps_show_cb, s);
| ^~~~~~~~~~~~
| |
| void (*)(struct inode *, struct ceph_cap *, void *)
In file included from fs/ceph/debugfs.c:22:
fs/ceph/mds_client.h:540:44: note: expected 'int (*)(struct inode *, struct ceph_cap *, void *)' but argument is of type 'void (*)(struct inode *, struct ceph_cap *, void *)'
540 | int (*cb)(struct inode *,
| ~~~~~~^~~~~~~~~~~~~~~~~~~
541 | struct ceph_cap *, void *),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/debugfs.h:16,
from fs/ceph/debugfs.c:8:
fs/ceph/debugfs.c: In function 'mdsmap_open':
>> fs/ceph/debugfs.c:349:23: error: passing argument 2 of 'single_open' from incompatible pointer type [-Werror=incompatible-pointer-types]
349 | DEFINE_SHOW_ATTRIBUTE(mdsmap);
| ^~~~~~
| |
| void (*)(struct seq_file *, void *)
include/linux/seq_file.h:199:34: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
199 | return single_open(file, __name ## _show, inode->i_private); \
| ^~~~~~
include/linux/seq_file.h:166:32: note: expected 'int (*)(struct seq_file *, void *)' but argument is of type 'void (*)(struct seq_file *, void *)'
166 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ceph/debugfs.c: In function 'mdsc_open':
fs/ceph/debugfs.c:350:23: error: passing argument 2 of 'single_open' from incompatible pointer type [-Werror=incompatible-pointer-types]
350 | DEFINE_SHOW_ATTRIBUTE(mdsc);
| ^~~~
| |
| void (*)(struct seq_file *, void *)
include/linux/seq_file.h:199:34: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
199 | return single_open(file, __name ## _show, inode->i_private); \
| ^~~~~~
include/linux/seq_file.h:166:32: note: expected 'int (*)(struct seq_file *, void *)' but argument is of type 'void (*)(struct seq_file *, void *)'
166 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ceph/debugfs.c: In function 'caps_open':
fs/ceph/debugfs.c:351:23: error: passing argument 2 of 'single_open' from incompatible pointer type [-Werror=incompatible-pointer-types]
351 | DEFINE_SHOW_ATTRIBUTE(caps);
| ^~~~
| |
| void (*)(struct seq_file *, void *)
include/linux/seq_file.h:199:34: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
199 | return single_open(file, __name ## _show, inode->i_private); \
| ^~~~~~
include/linux/seq_file.h:166:32: note: expected 'int (*)(struct seq_file *, void *)' but argument is of type 'void (*)(struct seq_file *, void *)'
166 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ceph/debugfs.c: In function 'mds_sessions_open':
fs/ceph/debugfs.c:352:23: error: passing argument 2 of 'single_open' from incompatible pointer type [-Werror=incompatible-pointer-types]
352 | DEFINE_SHOW_ATTRIBUTE(mds_sessions);
| ^~~~~~~~~~~~
| |
| void (*)(struct seq_file *, void *)
include/linux/seq_file.h:199:34: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
199 | return single_open(file, __name ## _show, inode->i_private); \
| ^~~~~~
include/linux/seq_file.h:166:32: note: expected 'int (*)(struct seq_file *, void *)' but argument is of type 'void (*)(struct seq_file *, void *)'
166 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ceph/debugfs.c: In function 'status_open':
fs/ceph/debugfs.c:353:23: error: passing argument 2 of 'single_open' from incompatible pointer type [-Werror=incompatible-pointer-types]
353 | DEFINE_SHOW_ATTRIBUTE(status);
| ^~~~~~
| |
| void (*)(struct seq_file *, void *)
include/linux/seq_file.h:199:34: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
199 | return single_open(file, __name ## _show, inode->i_private); \
| ^~~~~~
include/linux/seq_file.h:166:32: note: expected 'int (*)(struct seq_file *, void *)' but argument is of type 'void (*)(struct seq_file *, void *)'
166 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ceph/debugfs.c: In function 'metrics_file_open':
fs/ceph/debugfs.c:354:23: error: passing argument 2 of 'single_open' from incompatible pointer type [-Werror=incompatible-pointer-types]
354 | DEFINE_SHOW_ATTRIBUTE(metrics_file);
| ^~~~~~~~~~~~
| |
| void (*)(struct seq_file *, void *)
include/linux/seq_file.h:199:34: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
199 | return single_open(file, __name ## _show, inode->i_private); \
| ^~~~~~
include/linux/seq_file.h:166:32: note: expected 'int (*)(struct seq_file *, void *)' but argument is of type 'void (*)(struct seq_file *, void *)'
166 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ceph/debugfs.c: In function 'metrics_latency_open':
fs/ceph/debugfs.c:355:23: error: passing argument 2 of 'single_open' from incompatible pointer type [-Werror=incompatible-pointer-types]
355 | DEFINE_SHOW_ATTRIBUTE(metrics_latency);
| ^~~~~~~~~~~~~~~
| |
| void (*)(struct seq_file *, void *)
include/linux/seq_file.h:199:34: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
199 | return single_open(file, __name ## _show, inode->i_private); \
| ^~~~~~
include/linux/seq_file.h:166:32: note: expected 'int (*)(struct seq_file *, void *)' but argument is of type 'void (*)(struct seq_file *, void *)'
166 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ceph/debugfs.c: In function 'metrics_size_open':
fs/ceph/debugfs.c:356:23: error: passing argument 2 of 'single_open' from incompatible pointer type [-Werror=incompatible-pointer-types]
356 | DEFINE_SHOW_ATTRIBUTE(metrics_size);
| ^~~~~~~~~~~~
| |
| void (*)(struct seq_file *, void *)
include/linux/seq_file.h:199:34: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
199 | return single_open(file, __name ## _show, inode->i_private); \
| ^~~~~~
include/linux/seq_file.h:166:32: note: expected 'int (*)(struct seq_file *, void *)' but argument is of type 'void (*)(struct seq_file *, void *)'
166 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ceph/debugfs.c: In function 'metrics_caps_open':
fs/ceph/debugfs.c:357:23: error: passing argument 2 of 'single_open' from incompatible pointer type [-Werror=incompatible-pointer-types]
357 | DEFINE_SHOW_ATTRIBUTE(metrics_caps);
| ^~~~~~~~~~~~
| |
| void (*)(struct seq_file *, void *)
include/linux/seq_file.h:199:34: note: in definition of macro 'DEFINE_SHOW_ATTRIBUTE'
199 | return single_open(file, __name ## _show, inode->i_private); \
| ^~~~~~
include/linux/seq_file.h:166:32: note: expected 'int (*)(struct seq_file *, void *)' but argument is of type 'void (*)(struct seq_file *, void *)'
166 | int single_open(struct file *, int (*)(struct seq_file *, void *), void *);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/compat.h:17,
from arch/riscv/include/asm/elf.h:12,
from include/linux/elf.h:6,
from include/linux/module.h:19,
from include/linux/device/driver.h:21,
from include/linux/device.h:32,
from fs/ceph/debugfs.c:4:
fs/ceph/debugfs.c: In function 'congestion_kb_fops_open':
>> fs/ceph/debugfs.c:377:45: error: passing argument 3 of 'simple_attr_open' from incompatible pointer type [-Werror=incompatible-pointer-types]
377 | DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
| ^~~~~~~~~~~~~~~~~
| |
| void (*)(void *, u64 *) {aka void (*)(void *, long long unsigned int *)}
include/linux/fs.h:3352:46: note: in definition of macro 'DEFINE_SIMPLE_ATTRIBUTE'
3352 | return simple_attr_open(inode, file, __get, __set, __fmt); \
| ^~~~~
include/linux/fs.h:3370:28: note: expected 'int (*)(void *, u64 *)' {aka 'int (*)(void *, long long unsigned int *)'} but argument is of type 'void (*)(void *, u64 *)' {aka 'void (*)(void *, long long unsigned int *)'}
3370 | int (*get)(void *, u64 *), int (*set)(void *, u64),
| ~~~~~~^~~~~~~~~~~~~~~~~~~
fs/ceph/debugfs.c:378:25: error: passing argument 4 of 'simple_attr_open' from incompatible pointer type [-Werror=incompatible-pointer-types]
378 | congestion_kb_set, "%llu\n");
| ^~~~~~~~~~~~~~~~~
| |
| void (*)(void *, u64) {aka void (*)(void *, long long unsigned int)}
include/linux/fs.h:3352:53: note: in definition of macro 'DEFINE_SIMPLE_ATTRIBUTE'
3352 | return simple_attr_open(inode, file, __get, __set, __fmt); \
| ^~~~~
include/linux/fs.h:3370:55: note: expected 'int (*)(void *, u64)' {aka 'int (*)(void *, long long unsigned int)'} but argument is of type 'void (*)(void *, u64)' {aka 'void (*)(void *, long long unsigned int)'}
3370 | int (*get)(void *, u64 *), int (*set)(void *, u64),
| ~~~~~~^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors


vim +/ceph_iterate_session_caps +281 fs/ceph/debugfs.c

ff4a80bf2d3f80 Jeff Layton 2019-04-24 254
6c7163052ce6f5 Zhou jie 2022-09-27 255 static void caps_show(struct seq_file *s, void *p)
76aa844d5b2fb8 Sage Weil 2009-10-06 256 {
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 257 struct ceph_fs_client *fsc = s->private;
ff4a80bf2d3f80 Jeff Layton 2019-04-24 258 struct ceph_mds_client *mdsc = fsc->mdsc;
ff4a80bf2d3f80 Jeff Layton 2019-04-24 259 int total, avail, used, reserved, min, i;
3a3430affce5de Jeff Layton 2019-11-20 260 struct cap_wait *cw;
76aa844d5b2fb8 Sage Weil 2009-10-06 261
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 262 ceph_reservation_status(fsc, &total, &avail, &used, &reserved, &min);
76aa844d5b2fb8 Sage Weil 2009-10-06 263 seq_printf(s, "total\t\t%d\n"
76aa844d5b2fb8 Sage Weil 2009-10-06 264 "avail\t\t%d\n"
76aa844d5b2fb8 Sage Weil 2009-10-06 265 "used\t\t%d\n"
85ccce43a3fc15 Sage Weil 2010-02-17 266 "reserved\t%d\n"
ff4a80bf2d3f80 Jeff Layton 2019-04-24 267 "min\t\t%d\n\n",
85ccce43a3fc15 Sage Weil 2010-02-17 268 total, avail, used, reserved, min);
3a8ebe0b8b616c Yanhu Cao 2020-08-24 269 seq_printf(s, "ino mds issued implemented\n");
3a8ebe0b8b616c Yanhu Cao 2020-08-24 270 seq_printf(s, "--------------------------------------------------\n");
ff4a80bf2d3f80 Jeff Layton 2019-04-24 271
ff4a80bf2d3f80 Jeff Layton 2019-04-24 272 mutex_lock(&mdsc->mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 273 for (i = 0; i < mdsc->max_sessions; i++) {
ff4a80bf2d3f80 Jeff Layton 2019-04-24 274 struct ceph_mds_session *session;
ff4a80bf2d3f80 Jeff Layton 2019-04-24 275
ff4a80bf2d3f80 Jeff Layton 2019-04-24 276 session = __ceph_lookup_mds_session(mdsc, i);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 277 if (!session)
ff4a80bf2d3f80 Jeff Layton 2019-04-24 278 continue;
ff4a80bf2d3f80 Jeff Layton 2019-04-24 279 mutex_unlock(&mdsc->mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 280 mutex_lock(&session->s_mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 @281 ceph_iterate_session_caps(session, caps_show_cb, s);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 282 mutex_unlock(&session->s_mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 283 ceph_put_mds_session(session);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 284 mutex_lock(&mdsc->mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 285 }
ff4a80bf2d3f80 Jeff Layton 2019-04-24 286 mutex_unlock(&mdsc->mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 287
3a3430affce5de Jeff Layton 2019-11-20 288 seq_printf(s, "\n\nWaiters:\n--------\n");
3a3430affce5de Jeff Layton 2019-11-20 289 seq_printf(s, "tgid ino need want\n");
3a3430affce5de Jeff Layton 2019-11-20 290 seq_printf(s, "-----------------------------------------------------\n");
3a3430affce5de Jeff Layton 2019-11-20 291
3a3430affce5de Jeff Layton 2019-11-20 292 spin_lock(&mdsc->caps_list_lock);
3a3430affce5de Jeff Layton 2019-11-20 293 list_for_each_entry(cw, &mdsc->cap_wait_list, list) {
ebce3eb2f7ef9f Jeff Layton 2020-08-18 294 seq_printf(s, "%-13d0x%-17llx%-17s%-17s\n", cw->tgid, cw->ino,
3a3430affce5de Jeff Layton 2019-11-20 295 ceph_cap_string(cw->need),
3a3430affce5de Jeff Layton 2019-11-20 296 ceph_cap_string(cw->want));
3a3430affce5de Jeff Layton 2019-11-20 297 }
3a3430affce5de Jeff Layton 2019-11-20 298 spin_unlock(&mdsc->caps_list_lock);
3a3430affce5de Jeff Layton 2019-11-20 299
76aa844d5b2fb8 Sage Weil 2009-10-06 300 }
76aa844d5b2fb8 Sage Weil 2009-10-06 301
6c7163052ce6f5 Zhou jie 2022-09-27 302 static void mds_sessions_show(struct seq_file *s, void *ptr)
14ed97033dac4c John Spray 2014-09-12 303 {
14ed97033dac4c John Spray 2014-09-12 304 struct ceph_fs_client *fsc = s->private;
14ed97033dac4c John Spray 2014-09-12 305 struct ceph_mds_client *mdsc = fsc->mdsc;
14ed97033dac4c John Spray 2014-09-12 306 struct ceph_auth_client *ac = fsc->client->monc.auth;
14ed97033dac4c John Spray 2014-09-12 307 struct ceph_options *opt = fsc->client->options;
2c81ef286c42c5 Colin Ian King 2020-07-23 308 int mds;
14ed97033dac4c John Spray 2014-09-12 309
14ed97033dac4c John Spray 2014-09-12 310 mutex_lock(&mdsc->mutex);
14ed97033dac4c John Spray 2014-09-12 311
14ed97033dac4c John Spray 2014-09-12 312 /* The 'num' portion of an 'entity name' */
14ed97033dac4c John Spray 2014-09-12 313 seq_printf(s, "global_id %llu\n", ac->global_id);
14ed97033dac4c John Spray 2014-09-12 314
14ed97033dac4c John Spray 2014-09-12 315 /* The -o name mount argument */
14ed97033dac4c John Spray 2014-09-12 316 seq_printf(s, "name \"%s\"\n", opt->name ? opt->name : "");
14ed97033dac4c John Spray 2014-09-12 317
14ed97033dac4c John Spray 2014-09-12 318 /* The list of MDS session rank+state */
14ed97033dac4c John Spray 2014-09-12 319 for (mds = 0; mds < mdsc->max_sessions; mds++) {
14ed97033dac4c John Spray 2014-09-12 320 struct ceph_mds_session *session =
14ed97033dac4c John Spray 2014-09-12 321 __ceph_lookup_mds_session(mdsc, mds);
14ed97033dac4c John Spray 2014-09-12 322 if (!session) {
14ed97033dac4c John Spray 2014-09-12 323 continue;
14ed97033dac4c John Spray 2014-09-12 324 }
14ed97033dac4c John Spray 2014-09-12 325 mutex_unlock(&mdsc->mutex);
14ed97033dac4c John Spray 2014-09-12 326 seq_printf(s, "mds.%d %s\n",
14ed97033dac4c John Spray 2014-09-12 327 session->s_mds,
14ed97033dac4c John Spray 2014-09-12 328 ceph_session_state_name(session->s_state));
14ed97033dac4c John Spray 2014-09-12 329
14ed97033dac4c John Spray 2014-09-12 330 ceph_put_mds_session(session);
14ed97033dac4c John Spray 2014-09-12 331 mutex_lock(&mdsc->mutex);
14ed97033dac4c John Spray 2014-09-12 332 }
14ed97033dac4c John Spray 2014-09-12 333 mutex_unlock(&mdsc->mutex);
14ed97033dac4c John Spray 2014-09-12 334
14ed97033dac4c John Spray 2014-09-12 335 }
14ed97033dac4c John Spray 2014-09-12 336
6c7163052ce6f5 Zhou jie 2022-09-27 337 static void status_show(struct seq_file *s, void *p)
247b1f19dbeb48 Xiubo Li 2020-11-11 338 {
247b1f19dbeb48 Xiubo Li 2020-11-11 339 struct ceph_fs_client *fsc = s->private;
247b1f19dbeb48 Xiubo Li 2020-11-11 340 struct ceph_entity_inst *inst = &fsc->client->msgr.inst;
247b1f19dbeb48 Xiubo Li 2020-11-11 341 struct ceph_entity_addr *client_addr = ceph_client_addr(fsc->client);
247b1f19dbeb48 Xiubo Li 2020-11-11 342
247b1f19dbeb48 Xiubo Li 2020-11-11 343 seq_printf(s, "instance: %s.%lld %s/%u\n", ENTITY_NAME(inst->name),
247b1f19dbeb48 Xiubo Li 2020-11-11 344 ceph_pr_addr(client_addr), le32_to_cpu(client_addr->nonce));
247b1f19dbeb48 Xiubo Li 2020-11-11 345 seq_printf(s, "blocklisted: %s\n", fsc->blocklisted ? "true" : "false");
247b1f19dbeb48 Xiubo Li 2020-11-11 346
247b1f19dbeb48 Xiubo Li 2020-11-11 347 }
247b1f19dbeb48 Xiubo Li 2020-11-11 348
072eaf3c0f0fd2 Ilya Dryomov 2020-01-28 @349 DEFINE_SHOW_ATTRIBUTE(mdsmap);
072eaf3c0f0fd2 Ilya Dryomov 2020-01-28 350 DEFINE_SHOW_ATTRIBUTE(mdsc);
072eaf3c0f0fd2 Ilya Dryomov 2020-01-28 351 DEFINE_SHOW_ATTRIBUTE(caps);
072eaf3c0f0fd2 Ilya Dryomov 2020-01-28 352 DEFINE_SHOW_ATTRIBUTE(mds_sessions);
247b1f19dbeb48 Xiubo Li 2020-11-11 353 DEFINE_SHOW_ATTRIBUTE(status);
cbed4ff76bbb80 Lu?s Henriques 2021-10-27 354 DEFINE_SHOW_ATTRIBUTE(metrics_file);
cbed4ff76bbb80 Lu?s Henriques 2021-10-27 355 DEFINE_SHOW_ATTRIBUTE(metrics_latency);
cbed4ff76bbb80 Lu?s Henriques 2021-10-27 356 DEFINE_SHOW_ATTRIBUTE(metrics_size);
cbed4ff76bbb80 Lu?s Henriques 2021-10-27 357 DEFINE_SHOW_ATTRIBUTE(metrics_caps);
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 358
76aa844d5b2fb8 Sage Weil 2009-10-06 359
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 360 /*
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 361 * debugfs
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 362 */
6c7163052ce6f5 Zhou jie 2022-09-27 363 static void congestion_kb_set(void *data, u64 val)
2baba25019ec56 Yehuda Sadeh 2009-12-18 364 {
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 365 struct ceph_fs_client *fsc = (struct ceph_fs_client *)data;
2baba25019ec56 Yehuda Sadeh 2009-12-18 366
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 367 fsc->mount_options->congestion_kb = (int)val;
2baba25019ec56 Yehuda Sadeh 2009-12-18 368 }
2baba25019ec56 Yehuda Sadeh 2009-12-18 369
6c7163052ce6f5 Zhou jie 2022-09-27 370 static void congestion_kb_get(void *data, u64 *val)
2baba25019ec56 Yehuda Sadeh 2009-12-18 371 {
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 372 struct ceph_fs_client *fsc = (struct ceph_fs_client *)data;
2baba25019ec56 Yehuda Sadeh 2009-12-18 373
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 374 *val = (u64)fsc->mount_options->congestion_kb;
2baba25019ec56 Yehuda Sadeh 2009-12-18 375 }
2baba25019ec56 Yehuda Sadeh 2009-12-18 376
2baba25019ec56 Yehuda Sadeh 2009-12-18 @377 DEFINE_SIMPLE_ATTRIBUTE(congestion_kb_fops, congestion_kb_get,
2baba25019ec56 Yehuda Sadeh 2009-12-18 378 congestion_kb_set, "%llu\n");
2baba25019ec56 Yehuda Sadeh 2009-12-18 379
76aa844d5b2fb8 Sage Weil 2009-10-06 380

--
0-DAY CI Kernel Test Service
https://01.org/lkp


Attachments:
(No filename) (22.99 kB)
config (324.79 kB)
Download all attachments