Commit 060dd67b authored by Jaegeuk Kim's avatar Jaegeuk Kim

f2fs: fix an endian conversion bug detected by sparse

This patch should fix the following bug reported by kbuild test robot.

fs/f2fs/recovery.c:233:33: sparse: incorrect type in assignment
(different base types)

parse warnings: (new ones prefixed by >>)

>> recovery.c:233: sparse: incorrect type in assignment (different base types)
   recovery.c:233:    expected unsigned int [unsigned] [assigned] ofs_in_node
   recovery.c:233:    got restricted __le16 [assigned] [usertype] ofs_in_node
>> recovery.c:238: sparse: incorrect type in assignment (different base types)
   recovery.c:238:    expected unsigned int [unsigned] ofs_in_node
   recovery.c:238:    got restricted __le16 [assigned] [usertype] ofs_in_node
Signed-off-by: default avatarJaegeuk Kim <jaegeuk.kim@samsung.com>
parent 7e586fa0
...@@ -246,12 +246,12 @@ static int check_index_in_prev_nodes(struct f2fs_sb_info *sbi, ...@@ -246,12 +246,12 @@ static int check_index_in_prev_nodes(struct f2fs_sb_info *sbi,
struct dnode_of_data tdn = *dn; struct dnode_of_data tdn = *dn;
tdn.nid = nid; tdn.nid = nid;
tdn.node_page = dn->inode_page; tdn.node_page = dn->inode_page;
tdn.ofs_in_node = sum.ofs_in_node; tdn.ofs_in_node = le16_to_cpu(sum.ofs_in_node);
truncate_data_blocks_range(&tdn, 1); truncate_data_blocks_range(&tdn, 1);
return 0; return 0;
} else if (dn->nid == nid) { } else if (dn->nid == nid) {
struct dnode_of_data tdn = *dn; struct dnode_of_data tdn = *dn;
tdn.ofs_in_node = sum.ofs_in_node; tdn.ofs_in_node = le16_to_cpu(sum.ofs_in_node);
truncate_data_blocks_range(&tdn, 1); truncate_data_blocks_range(&tdn, 1);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment