diff mbox

[mmotm:master,174/212] fs///fat/inode.c:163:9: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'sector_t {aka long long unsigned int}'

Message ID 87po12aq5p.fsf@mail.parknet.co.jp (mailing list archive)
State New, archived
Headers show

Commit Message

OGAWA Hirofumi June 8, 2018, 3:54 a.m. UTC
kbuild test robot <lkp@intel.com> writes:

> tree:   git://git.cmpxchg.org/linux-mmotm.git master
> head:   7393732bae530daa27567988b91d16ecfeef6c62
> commit: fe3e5c4f07cde4be67152518d21429bfbb875c0c [174/212] fat: use fat_fs_error() instead of BUG_ON() in __fat_get_block()
> config: i386-randconfig-s0-201822-CONFIG_DEBUG_INFO_REDUCED (attached as .config)
> compiler: gcc-6 (Debian 6.4.0-9) 6.4.0 20171026
> reproduce:
>         git checkout fe3e5c4f07cde4be67152518d21429bfbb875c0c
>         # save the attached .config to linux build tree
>         make ARCH=i386 
>
> All warnings (new ones prefixed by >>):
>
>    In file included from fs///fat/inode.c:24:0:
>    fs///fat/inode.c: In function '__fat_get_block':
>>> fs///fat/inode.c:163:9: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'sector_t {aka long long unsigned int}' [-Wformat=]
>             "invalid FAT chain (i_pos %lld, last_block %ld)",
>             ^
>    fs///fat/fat.h:397:24: note: in definition of macro 'fat_fs_error'
>      __fat_fs_error(sb, 1, fmt , ## args)

This is the updated patch to fix this warning. Please update

	fat-use-fat_fs_error-instead-of-bug_on-in-__fat_get_block.patch

Thanks.
diff mbox

Patch

diff -puN fs/fat/inode.c~vfat-dont-bugon fs/fat/inode.c
--- linux/fs/fat/inode.c~vfat-dont-bugon	2018-06-02 20:15:04.441920069 +0900
+++ linux-hirofumi/fs/fat/inode.c	2018-06-08 12:38:09.891123649 +0900
@@ -158,8 +158,14 @@  static inline int __fat_get_block(struct
 	err = fat_bmap(inode, iblock, &phys, &mapped_blocks, create, false);
 	if (err)
 		return err;
+	if (!phys) {
+		fat_fs_error(sb,
+			     "invalid FAT chain (i_pos %lld, last_block %llu)",
+			     MSDOS_I(inode)->i_pos,
+			     (unsigned long long)last_block);
+		return -EIO;
+	}
 
-	BUG_ON(!phys);
 	BUG_ON(*max_blocks != mapped_blocks);
 	set_buffer_new(bh_result);
 	map_bh(bh_result, sb, phys);