From: kbuild test robot <lkp@intel.com>
To: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: kbuild-all@01.org, Johannes Weiner <hannes@cmpxchg.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linux Memory Management List <linux-mm@kvack.org>
Subject: [mmotm:master 174/212] fs/fat/inode.c:162:3: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'sector_t'
Date: Fri, 8 Jun 2018 10:16:01 +0800 [thread overview]
Message-ID: <201806081049.rOpaa8BD%fengguang.wu@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 3093 bytes --]
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-a0-201822 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
git checkout fe3e5c4f07cde4be67152518d21429bfbb875c0c
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
fs/fat/inode.c: In function '__fat_get_block':
>> fs/fat/inode.c:162:3: warning: format '%ld' expects argument of type 'long int', but argument 5 has type 'sector_t' [-Wformat=]
fat_fs_error(sb,
^
vim +162 fs/fat/inode.c
111
112 static inline int __fat_get_block(struct inode *inode, sector_t iblock,
113 unsigned long *max_blocks,
114 struct buffer_head *bh_result, int create)
115 {
116 struct super_block *sb = inode->i_sb;
117 struct msdos_sb_info *sbi = MSDOS_SB(sb);
118 unsigned long mapped_blocks;
119 sector_t phys, last_block;
120 int err, offset;
121
122 err = fat_bmap(inode, iblock, &phys, &mapped_blocks, create, false);
123 if (err)
124 return err;
125 if (phys) {
126 map_bh(bh_result, sb, phys);
127 *max_blocks = min(mapped_blocks, *max_blocks);
128 return 0;
129 }
130 if (!create)
131 return 0;
132
133 if (iblock != MSDOS_I(inode)->mmu_private >> sb->s_blocksize_bits) {
134 fat_fs_error(sb, "corrupted file size (i_pos %lld, %lld)",
135 MSDOS_I(inode)->i_pos, MSDOS_I(inode)->mmu_private);
136 return -EIO;
137 }
138
139 last_block = inode->i_blocks >> (sb->s_blocksize_bits - 9);
140 offset = (unsigned long)iblock & (sbi->sec_per_clus - 1);
141 /*
142 * allocate a cluster according to the following.
143 * 1) no more available blocks
144 * 2) not part of fallocate region
145 */
146 if (!offset && !(iblock < last_block)) {
147 /* TODO: multiple cluster allocation would be desirable. */
148 err = fat_add_cluster(inode);
149 if (err)
150 return err;
151 }
152 /* available blocks on this cluster */
153 mapped_blocks = sbi->sec_per_clus - offset;
154
155 *max_blocks = min(mapped_blocks, *max_blocks);
156 MSDOS_I(inode)->mmu_private += *max_blocks << sb->s_blocksize_bits;
157
158 err = fat_bmap(inode, iblock, &phys, &mapped_blocks, create, false);
159 if (err)
160 return err;
161 if (!phys) {
> 162 fat_fs_error(sb,
163 "invalid FAT chain (i_pos %lld, last_block %ld)",
164 MSDOS_I(inode)->i_pos, last_block);
165 return -EIO;
166 }
167
168 BUG_ON(*max_blocks != mapped_blocks);
169 set_buffer_new(bh_result);
170 map_bh(bh_result, sb, phys);
171
172 return 0;
173 }
174
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29059 bytes --]
reply other threads:[~2018-06-08 2:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=201806081049.rOpaa8BD%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hirofumi@mail.parknet.co.jp \
--cc=kbuild-all@01.org \
--cc=linux-mm@kvack.org \
/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.