* [ammarfaizi2-block:google/android/kernel/common/android-4.14-stable 4872/9999] fs/incfs/format.c:377:23: sparse: sparse: cast truncates bits from constant value (5346434e49 becomes 46434e49)
@ 2022-08-04 11:16 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-08-04 11:16 UTC (permalink / raw)
To: Ammar Faizi, GNU/Weeb Mailing List; +Cc: kbuild-all
tree: https://github.com/ammarfaizi2/linux-block google/android/kernel/common/android-4.14-stable
head: c529afa15a69594211793a68cb70c873508061df
commit: 57e7c47daa1cae8cb8c1450ad359027bac68fb9b [4872/9999] ANDROID: Incremental fs: fix magic compatibility again
config: i386-randconfig-s002 (https://download.01.org/0day-ci/archive/20220804/[email protected]/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-39-gce1a6720-dirty
# https://github.com/ammarfaizi2/linux-block/commit/57e7c47daa1cae8cb8c1450ad359027bac68fb9b
git remote add ammarfaizi2-block https://github.com/ammarfaizi2/linux-block
git fetch --no-tags ammarfaizi2-block google/android/kernel/common/android-4.14-stable
git checkout 57e7c47daa1cae8cb8c1450ad359027bac68fb9b
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash drivers/md/ fs/incfs/
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <[email protected]>
sparse warnings: (new ones prefixed by >>)
>> fs/incfs/format.c:377:23: sparse: sparse: cast truncates bits from constant value (5346434e49 becomes 46434e49)
fs/incfs/format.c:559:41: sparse: sparse: cast truncates bits from constant value (5346434e49 becomes 46434e49)
In file included from include/linux/printk.h:7:0,
from include/linux/kernel.h:14,
from include/linux/list.h:9,
from include/linux/wait.h:7,
from include/linux/wait_bit.h:8,
from include/linux/fs.h:6,
from fs/incfs/format.c:5:
fs/incfs/format.c: In function 'incfs_read_next_metadata_record':
include/linux/kern_levels.h:5:18: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'size_t {aka unsigned int}' [-Wformat=]
#define KERN_SOH "001" /* ASCII Start Of Header */
^
include/linux/kern_levels.h:12:22: note: in expansion of macro 'KERN_SOH'
#define KERN_WARNING KERN_SOH "4" /* warning conditions */
^~~~~~~~
include/linux/printk.h:308:9: note: in expansion of macro 'KERN_WARNING'
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
^~~~~~~~~~~~
include/linux/printk.h:309:17: note: in expansion of macro 'pr_warning'
#define pr_warn pr_warning
^~~~~~~~~~
fs/incfs/format.c:619:3: note: in expansion of macro 'pr_warn'
pr_warn("incfs: The record is too large. Size: %ld",
^~~~~~~
fs/incfs/format.c:619:52: note: format string is defined here
pr_warn("incfs: The record is too large. Size: %ld",
~~^
%d
vim +377 fs/incfs/format.c
318babce66a62d8 Eugene Zemtsov 2019-11-18 361
318babce66a62d8 Eugene Zemtsov 2019-11-18 362 /*
318babce66a62d8 Eugene Zemtsov 2019-11-18 363 * Write a backing file header
318babce66a62d8 Eugene Zemtsov 2019-11-18 364 * It should always be called only on empty file.
318babce66a62d8 Eugene Zemtsov 2019-11-18 365 * incfs_super_block.s_first_md_offset is 0 for now, but will be updated
318babce66a62d8 Eugene Zemtsov 2019-11-18 366 * once first metadata record is added.
318babce66a62d8 Eugene Zemtsov 2019-11-18 367 */
318babce66a62d8 Eugene Zemtsov 2019-11-18 368 int incfs_write_fh_to_backing_file(struct backing_file_context *bfc,
318babce66a62d8 Eugene Zemtsov 2019-11-18 369 incfs_uuid_t *uuid, u64 file_size)
318babce66a62d8 Eugene Zemtsov 2019-11-18 370 {
318babce66a62d8 Eugene Zemtsov 2019-11-18 371 struct incfs_file_header fh = {};
318babce66a62d8 Eugene Zemtsov 2019-11-18 372 loff_t file_pos = 0;
318babce66a62d8 Eugene Zemtsov 2019-11-18 373
318babce66a62d8 Eugene Zemtsov 2019-11-18 374 if (!bfc)
318babce66a62d8 Eugene Zemtsov 2019-11-18 375 return -EFAULT;
318babce66a62d8 Eugene Zemtsov 2019-11-18 376
318babce66a62d8 Eugene Zemtsov 2019-11-18 @377 fh.fh_magic = cpu_to_le64(INCFS_MAGIC_NUMBER);
318babce66a62d8 Eugene Zemtsov 2019-11-18 378 fh.fh_version = cpu_to_le64(INCFS_FORMAT_CURRENT_VER);
318babce66a62d8 Eugene Zemtsov 2019-11-18 379 fh.fh_header_size = cpu_to_le16(sizeof(fh));
318babce66a62d8 Eugene Zemtsov 2019-11-18 380 fh.fh_first_md_offset = cpu_to_le64(0);
318babce66a62d8 Eugene Zemtsov 2019-11-18 381 fh.fh_data_block_size = cpu_to_le16(INCFS_DATA_FILE_BLOCK_SIZE);
318babce66a62d8 Eugene Zemtsov 2019-11-18 382
318babce66a62d8 Eugene Zemtsov 2019-11-18 383 fh.fh_file_size = cpu_to_le64(file_size);
318babce66a62d8 Eugene Zemtsov 2019-11-18 384 fh.fh_uuid = *uuid;
318babce66a62d8 Eugene Zemtsov 2019-11-18 385
318babce66a62d8 Eugene Zemtsov 2019-11-18 386 LOCK_REQUIRED(bfc->bc_mutex);
318babce66a62d8 Eugene Zemtsov 2019-11-18 387
318babce66a62d8 Eugene Zemtsov 2019-11-18 388 file_pos = incfs_get_end_offset(bfc->bc_file);
318babce66a62d8 Eugene Zemtsov 2019-11-18 389 if (file_pos != 0)
318babce66a62d8 Eugene Zemtsov 2019-11-18 390 return -EEXIST;
318babce66a62d8 Eugene Zemtsov 2019-11-18 391
4f81903f2276fc9 Paul Lawrence 2020-04-07 392 return write_to_bf(bfc, &fh, sizeof(fh), file_pos);
318babce66a62d8 Eugene Zemtsov 2019-11-18 393 }
318babce66a62d8 Eugene Zemtsov 2019-11-18 394
:::::: The code at line 377 was first introduced by commit
:::::: 318babce66a62d8bc8d5434909a044b89ab3a53e ANDROID: Initial commit of Incremental FS
:::::: TO: Eugene Zemtsov <[email protected]>
:::::: CC: Paul Lawrence <[email protected]>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-08-04 11:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-04 11:16 [ammarfaizi2-block:google/android/kernel/common/android-4.14-stable 4872/9999] fs/incfs/format.c:377:23: sparse: sparse: cast truncates bits from constant value (5346434e49 becomes 46434e49) kernel test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox