aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index a2e7952bc5f9..c6bd6ced3bb7 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -372,16 +372,16 @@ static int ext4_block_to_path(struct inode *inode,
372} 372}
373 373
374static int __ext4_check_blockref(const char *function, struct inode *inode, 374static int __ext4_check_blockref(const char *function, struct inode *inode,
375 unsigned int *p, unsigned int max) { 375 __le32 *p, unsigned int max) {
376 376
377 unsigned int maxblocks = ext4_blocks_count(EXT4_SB(inode->i_sb)->s_es); 377 unsigned int maxblocks = ext4_blocks_count(EXT4_SB(inode->i_sb)->s_es);
378 unsigned int *bref = p; 378 __le32 *bref = p;
379 while (bref < p+max) { 379 while (bref < p+max) {
380 if (unlikely(*bref >= maxblocks)) { 380 if (unlikely(le32_to_cpu(*bref) >= maxblocks)) {
381 ext4_error(inode->i_sb, function, 381 ext4_error(inode->i_sb, function,
382 "block reference %u >= max (%u) " 382 "block reference %u >= max (%u) "
383 "in inode #%lu, offset=%d", 383 "in inode #%lu, offset=%d",
384 *bref, maxblocks, 384 le32_to_cpu(*bref), maxblocks,
385 inode->i_ino, (int)(bref-p)); 385 inode->i_ino, (int)(bref-p));
386 return -EIO; 386 return -EIO;
387 } 387 }