In the structure of f2fs_inode, i_extra_size's type is __le16,
so we should keep type consistent when using it.

Signed-off-by: Zhikang Zhang <zhangzhika...@huawei.com>
Signed-off-by: Yunlei He <heyun...@huawei.com>
---
 fs/f2fs/inode.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index 70aba58..c6d8f65 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -117,7 +117,6 @@ static void __recover_inline_status(struct inode *inode, 
struct page *ipage)
 static bool f2fs_enable_inode_chksum(struct f2fs_sb_info *sbi, struct page 
*page)
 {
        struct f2fs_inode *ri = &F2FS_NODE(page)->i;
-       int extra_isize = le32_to_cpu(ri->i_extra_isize);
 
        if (!f2fs_sb_has_inode_chksum(sbi->sb))
                return false;
@@ -125,7 +124,8 @@ static bool f2fs_enable_inode_chksum(struct f2fs_sb_info 
*sbi, struct page *page
        if (!RAW_IS_INODE(F2FS_NODE(page)) || !(ri->i_inline & F2FS_EXTRA_ATTR))
                return false;
 
-       if (!F2FS_FITS_IN_INODE(ri, extra_isize, i_inode_checksum))
+       if (!F2FS_FITS_IN_INODE(ri, le16_to_cpu(ri->i_extra_isize),
+                               i_inode_checksum))
                return false;
 
        return true;
-- 
2.7.4


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to