Re: [PATCH] ceph: show max caps in debugfs caps file

Dan Carpenter
2020-06-02T09:46:59Z

[-- Attachment #1: Type: text/plain, Size: 4682 bytes --]

Hi Yanhu,

url: https://github.com/0day-ci/linux/commits/Yanhu-Cao/ceph-show-max-caps-in-debugfs-caps-file/20200521-190841
base: https://github.com/ceph/ceph-client.git for-linus
config: x86_64-randconfig-m001-20200529 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
fs/ceph/debugfs.c:151 caps_show() warn: excess argument passed to 'seq_printf'

# https://github.com/0day-ci/linux/commit/d35440110f623b99d201f15fa3cc062a35dc6373
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout d35440110f623b99d201f15fa3cc062a35dc6373
vim +/seq_printf +151 fs/ceph/debugfs.c

76aa844d5b2fb8 Sage Weil 2009-10-06 137 static int caps_show(struct seq_file *s, void *p)
76aa844d5b2fb8 Sage Weil 2009-10-06 138 {
3d14c5d2b6e15c Yehuda Sadeh 2010-04-06 139 struct ceph_fs_client *fsc = s->private;
ff4a80bf2d3f80 Jeff Layton 2019-04-24 140 struct ceph_mds_client *mdsc = fsc->mdsc;
d35440110f623b Yanhu Cao 2020-05-21 141 int total, avail, used, max, reserved, min, i;
3a3430affce5de Jeff Layton 2019-11-20 142 struct cap_wait *cw;
76aa844d5b2fb8 Sage Weil 2009-10-06 143
d35440110f623b Yanhu Cao 2020-05-21 144 ceph_reservation_status(fsc, &total, &avail, &used, &max,
d35440110f623b Yanhu Cao 2020-05-21 145 &reserved, &min);
76aa844d5b2fb8 Sage Weil 2009-10-06 146 seq_printf(s, "total\t\t%d\n"
76aa844d5b2fb8 Sage Weil 2009-10-06 147 "avail\t\t%d\n"
76aa844d5b2fb8 Sage Weil 2009-10-06 148 "used\t\t%d\n"

max is missing.

85ccce43a3fc15 Sage Weil 2010-02-17 149 "reserved\t%d\n"
ff4a80bf2d3f80 Jeff Layton 2019-04-24 150 "min\t\t%d\n\n",
d35440110f623b Yanhu Cao 2020-05-21 @151 total, avail, used, max, reserved, min);
^^^

ff4a80bf2d3f80 Jeff Layton 2019-04-24 152 seq_printf(s, "ino issued implemented\n");
ff4a80bf2d3f80 Jeff Layton 2019-04-24 153 seq_printf(s, "-----------------------------------------------\n");
ff4a80bf2d3f80 Jeff Layton 2019-04-24 154
ff4a80bf2d3f80 Jeff Layton 2019-04-24 155 mutex_lock(&mdsc->mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 156 for (i = 0; i < mdsc->max_sessions; i++) {
ff4a80bf2d3f80 Jeff Layton 2019-04-24 157 struct ceph_mds_session *session;
ff4a80bf2d3f80 Jeff Layton 2019-04-24 158
ff4a80bf2d3f80 Jeff Layton 2019-04-24 159 session = __ceph_lookup_mds_session(mdsc, i);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 160 if (!session)
ff4a80bf2d3f80 Jeff Layton 2019-04-24 161 continue;
ff4a80bf2d3f80 Jeff Layton 2019-04-24 162 mutex_unlock(&mdsc->mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 163 mutex_lock(&session->s_mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 164 ceph_iterate_session_caps(session, caps_show_cb, s);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 165 mutex_unlock(&session->s_mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 166 ceph_put_mds_session(session);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 167 mutex_lock(&mdsc->mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 168 }
ff4a80bf2d3f80 Jeff Layton 2019-04-24 169 mutex_unlock(&mdsc->mutex);
ff4a80bf2d3f80 Jeff Layton 2019-04-24 170
3a3430affce5de Jeff Layton 2019-11-20 171 seq_printf(s, "\n\nWaiters:\n--------\n");
3a3430affce5de Jeff Layton 2019-11-20 172 seq_printf(s, "tgid ino need want\n");
3a3430affce5de Jeff Layton 2019-11-20 173 seq_printf(s, "-----------------------------------------------------\n");
3a3430affce5de Jeff Layton 2019-11-20 174
3a3430affce5de Jeff Layton 2019-11-20 175 spin_lock(&mdsc->caps_list_lock);
3a3430affce5de Jeff Layton 2019-11-20 176 list_for_each_entry(cw, &mdsc->cap_wait_list, list) {
3a3430affce5de Jeff Layton 2019-11-20 177 seq_printf(s, "%-13d0x%-17lx%-17s%-17s\n", cw->tgid, cw->ino,
3a3430affce5de Jeff Layton 2019-11-20 178 ceph_cap_string(cw->need),
3a3430affce5de Jeff Layton 2019-11-20 179 ceph_cap_string(cw->want));
3a3430affce5de Jeff Layton 2019-11-20 180 }
3a3430affce5de Jeff Layton 2019-11-20 181 spin_unlock(&mdsc->caps_list_lock);
3a3430affce5de Jeff Layton 2019-11-20 182
76aa844d5b2fb8 Sage Weil 2009-10-06 183 return 0;
76aa844d5b2fb8 Sage Weil 2009-10-06 184 }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 37378 bytes --]