From: Sheng Yong <shengyong1@huawei.com>
To: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: [PATCH trivial 2/7] f2fs.fsck: fix endianess
Date: Fri, 15 Jul 2016 20:01:20 +0800 [thread overview]
Message-ID: <1468584085-29090-2-git-send-email-shengyong1@huawei.com> (raw)
In-Reply-To: <1468584085-29090-1-git-send-email-shengyong1@huawei.com>
Signed-off-by: Sheng Yong <shengyong1@huawei.com>
---
fsck/fsck.c | 2 +-
fsck/mount.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/fsck/fsck.c b/fsck/fsck.c
index c24eb58..8a6373b 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -383,7 +383,7 @@ static int sanity_check_nid(struct f2fs_sb_info *sbi, u32 nid,
le32_to_cpu(node_blk->footer.ino));
return -EINVAL;
}
- if (ni->ino != node_blk->footer.ino) {
+ if (ni->ino != le32_to_cpu(node_blk->footer.ino)) {
ASSERT_MSG("nid[0x%x] nat_entry->ino[0x%x] footer.ino[0x%x]",
nid, ni->ino, le32_to_cpu(node_blk->footer.ino));
return -EINVAL;
diff --git a/fsck/mount.c b/fsck/mount.c
index 3e3d176..f3b47fd 100644
--- a/fsck/mount.c
+++ b/fsck/mount.c
@@ -79,9 +79,9 @@ void print_inode_info(struct f2fs_inode *inode, int name)
}
printf("i_ext: fofs:%x blkaddr:%x len:%x\n",
- inode->i_ext.fofs,
- inode->i_ext.blk_addr,
- inode->i_ext.len);
+ le32_to_cpu(inode->i_ext.fofs),
+ le32_to_cpu(inode->i_ext.blk_addr),
+ le32_to_cpu(inode->i_ext.len));
DISP_u32(inode, i_addr[0]); /* Pointers to data blocks */
DISP_u32(inode, i_addr[1]); /* Pointers to data blocks */
@@ -91,7 +91,7 @@ void print_inode_info(struct f2fs_inode *inode, int name)
for (i = 4; i < ADDRS_PER_INODE(inode); i++) {
if (inode->i_addr[i] != 0x0) {
printf("i_addr[0x%x] points data block\r\t\t[0x%4x]\n",
- i, inode->i_addr[i]);
+ i, le32_to_cpu(inode->i_addr[i]));
break;
}
}
--
2.7.1
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
next prev parent reply other threads:[~2016-07-15 12:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-15 12:01 [PATCH trivial 1/7] dump.f2fs: show inode->i_dir_level Sheng Yong
2016-07-15 12:01 ` Sheng Yong [this message]
2016-07-15 12:01 ` [PATCH trivial 3/7] fsck.f2fs: correct variable type and name Sheng Yong
2016-07-15 12:01 ` [PATCH trivial 4/7] fsck.f2fs: fix typo Sheng Yong
2016-07-15 12:01 ` [PATCH trivial 5/7] fsck.f2fs: free nat entry cache Sheng Yong
2016-07-15 12:01 ` [PATCH trivial 6/7] f2fs-tools: update the format of output message Sheng Yong
2016-07-15 12:01 ` [PATCH trivial 7/7] fsck.f2fs: clean up duplicated code Sheng Yong
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=1468584085-29090-2-git-send-email-shengyong1@huawei.com \
--to=shengyong1@huawei.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).