From: kernel test robot <lkp@intel.com>
To: John Groves <John@groves.net>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org
Cc: oe-kbuild-all@lists.linux.dev, John Groves <John@groves.net>,
john@jagalactic.com
Subject: Re: [PATCH 1/1] sget_dev() bug fix: dev_t passed by value but stored via stack address
Date: Wed, 10 Apr 2024 17:18:57 +0800 [thread overview]
Message-ID: <202404101632.62NM3BlE-lkp@intel.com> (raw)
In-Reply-To: <7a37d4832e0c2e7cfe8000b0bf47dcc2c50d78d0.1712704849.git.john@groves.net>
Hi John,
kernel test robot noticed the following build warnings:
[auto build test WARNING on fec50db7033ea478773b159e0e2efb135270e3b7]
url: https://github.com/intel-lab-lkp/linux/commits/John-Groves/sget_dev-bug-fix-dev_t-passed-by-value-but-stored-via-stack-address/20240410-073305
base: fec50db7033ea478773b159e0e2efb135270e3b7
patch link: https://lore.kernel.org/r/7a37d4832e0c2e7cfe8000b0bf47dcc2c50d78d0.1712704849.git.john%40groves.net
patch subject: [PATCH 1/1] sget_dev() bug fix: dev_t passed by value but stored via stack address
config: openrisc-allnoconfig (https://download.01.org/0day-ci/archive/20240410/202404101632.62NM3BlE-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240410/202404101632.62NM3BlE-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404101632.62NM3BlE-lkp@intel.com/
All warnings (new ones prefixed by >>):
fs/super.c: In function 'set_bdev_super':
>> fs/super.c:1311:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1311 | u64 devno = (u64)data;
| ^
fs/super.c: In function 'super_s_dev_test':
fs/super.c:1324:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
1324 | u64 devno = (u64)fc->sget_key;
| ^
fs/super.c: In function 'sget_dev':
>> fs/super.c:1354:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1354 | fc->sget_key = (void *)devno;
| ^
fs/super.c: In function 'mount_bdev':
fs/super.c:1654:67: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1654 | s = sget(fs_type, test_bdev_super, set_bdev_super, flags, (void *)devno);
| ^
vim +1311 fs/super.c
1308
1309 static int set_bdev_super(struct super_block *s, void *data)
1310 {
> 1311 u64 devno = (u64)data;
1312
1313 s->s_dev = (dev_t)devno;
1314 return 0;
1315 }
1316
1317 static int super_s_dev_set(struct super_block *s, struct fs_context *fc)
1318 {
1319 return set_bdev_super(s, fc->sget_key);
1320 }
1321
1322 static int super_s_dev_test(struct super_block *s, struct fs_context *fc)
1323 {
1324 u64 devno = (u64)fc->sget_key;
1325
1326 return !(s->s_iflags & SB_I_RETIRED) &&
1327 s->s_dev == (dev_t)devno;
1328 }
1329
1330 /**
1331 * sget_dev - Find or create a superblock by device number
1332 * @fc: Filesystem context.
1333 * @dev: device number
1334 *
1335 * Find or create a superblock using the provided device number that
1336 * will be stored in fc->sget_key.
1337 *
1338 * If an extant superblock is matched, then that will be returned with
1339 * an elevated reference count that the caller must transfer or discard.
1340 *
1341 * If no match is made, a new superblock will be allocated and basic
1342 * initialisation will be performed (s_type, s_fs_info, s_id, s_dev will
1343 * be set). The superblock will be published and it will be returned in
1344 * a partially constructed state with SB_BORN and SB_ACTIVE as yet
1345 * unset.
1346 *
1347 * Return: an existing or newly created superblock on success, an error
1348 * pointer on failure.
1349 */
1350 struct super_block *sget_dev(struct fs_context *fc, dev_t dev)
1351 {
1352 u64 devno = (u64)dev;
1353
> 1354 fc->sget_key = (void *)devno;
1355 return sget_fc(fc, super_s_dev_test, super_s_dev_set);
1356 }
1357 EXPORT_SYMBOL(sget_dev);
1358
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2024-04-10 9:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-09 23:31 [PATCH 0/1] sget_dev() minor bug fix John Groves
2024-04-09 23:31 ` [PATCH 1/1] sget_dev() bug fix: dev_t passed by value but stored via stack address John Groves
2024-04-10 9:18 ` kernel test robot [this message]
2024-04-10 10:16 ` Christian Brauner
2024-04-10 13:38 ` John Groves
2024-04-10 15:23 ` Christian Brauner
2024-04-10 21:24 ` John Groves
2024-04-17 5:06 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202404101632.62NM3BlE-lkp@intel.com \
--to=lkp@intel.com \
--cc=John@groves.net \
--cc=brauner@kernel.org \
--cc=jack@suse.cz \
--cc=john@jagalactic.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.