[amir73il:fsnotify-perf 2/5] fs/notify/mark.c:227:22: warning: variable 'sb' set but not used

From: kernel test robot
Date: Tue Aug 03 2021 - 04:22:24 EST


tree: https://github.com/amir73il/linux fsnotify-perf
head: 7446ba772ae107ab937cd04e8800236d6235dc4c
commit: ae00302ec41c4dae058c61c56a47134ecae77a36 [2/5] fsnotify: count s_fsnotify_inode_refs for attached connectors
config: x86_64-rhel-8.3 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/amir73il/linux/commit/ae00302ec41c4dae058c61c56a47134ecae77a36
git remote add amir73il https://github.com/amir73il/linux
git fetch --no-tags amir73il fsnotify-perf
git checkout ae00302ec41c4dae058c61c56a47134ecae77a36
# save the attached .config to linux build tree
make W=1 ARCH=x86_64

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

fs/notify/mark.c: In function 'fsnotify_drop_object':
>> fs/notify/mark.c:227:22: warning: variable 'sb' set but not used [-Wunused-but-set-variable]
227 | struct super_block *sb;
| ^~


vim +/sb +227 fs/notify/mark.c

6b3f05d24d355f Jan Kara 2016-12-21 222
721fb6fbfd2132 Jan Kara 2018-10-17 223 /* Drop object reference originally held by a connector */
721fb6fbfd2132 Jan Kara 2018-10-17 224 static void fsnotify_drop_object(unsigned int type, void *objp)
721fb6fbfd2132 Jan Kara 2018-10-17 225 {
721fb6fbfd2132 Jan Kara 2018-10-17 226 struct inode *inode;
721fb6fbfd2132 Jan Kara 2018-10-17 @227 struct super_block *sb;
721fb6fbfd2132 Jan Kara 2018-10-17 228
721fb6fbfd2132 Jan Kara 2018-10-17 229 if (!objp)
721fb6fbfd2132 Jan Kara 2018-10-17 230 return;
721fb6fbfd2132 Jan Kara 2018-10-17 231 /* Currently only inode references are passed to be dropped */
721fb6fbfd2132 Jan Kara 2018-10-17 232 if (WARN_ON_ONCE(type != FSNOTIFY_OBJ_TYPE_INODE))
721fb6fbfd2132 Jan Kara 2018-10-17 233 return;
721fb6fbfd2132 Jan Kara 2018-10-17 234 inode = objp;
721fb6fbfd2132 Jan Kara 2018-10-17 235 sb = inode->i_sb;
ae00302ec41c4d Amir Goldstein 2020-07-26 236 fsnotify_put_inode_ref(inode);
721fb6fbfd2132 Jan Kara 2018-10-17 237 }
721fb6fbfd2132 Jan Kara 2018-10-17 238

:::::: The code at line 227 was first introduced by commit
:::::: 721fb6fbfd2132164c2e8777cc837f9b2c1794dc fsnotify: Fix busy inodes during unmount

:::::: TO: Jan Kara <jack@xxxxxxx>
:::::: CC: Jan Kara <jack@xxxxxxx>

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

Attachment: .config.gz
Description: application/gzip