From: k@vodka.home.kg
To: Sheng Yong <shengyong1@huawei.com>,
linux-f2fs-devel@lists.sourceforge.net
Subject: Re: fsck is broken on mips32 platform
Date: Fri, 25 Nov 2016 11:51:02 +0300 [thread overview]
Message-ID: <601891109.20161125115102@vodka.home.kg> (raw)
In-Reply-To: <583792A0.2080209@huawei.com>
Hi, Sheng.
A bit better but still fail. At least it does not corrupt fs and it
mounts.
Info: Segments per section = 1
Info: Sections per zone = 1
Info: sector size = 512
Info: total sectors = 204800 (100 MB)
Info: MKFS version
"Linux version 4.4.30 (vasya@nowhere) (gcc version 5.4.0 (LEDE GCC 5.4.0 r2084) ) #0 PREEMPT Thu Nov 3 07:34:38 2016"
Info: FSCK version
from "Linux version 4.4.30 (vasya@nowhere) (gcc version 5.4.0 (LEDE GCC 5.4.0 r2084) ) #0 PREEMPT Thu Nov 3 07:34:38 2016"
to "Linux version 4.4.30 (vasya@nowhere) (gcc version 5.4.0 (LEDE GCC 5.4.0 r2084) ) #0 PREEMPT Thu Nov 3 07:34:38 2016"
Info: superblock features = 0 :
Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
Info: total FS sectors = 204800 (100 MB)
Info: CKPT version = 3
Info: checkpoint state = 5 : compacted_summary unmount
[FSCK] Unreachable nat entries [Ok..] [0x0]
[FSCK] SIT valid block bitmap checking [Ok..]
[FSCK] Hard link checking for regular file [Ok..] [0x0]
[FSCK] valid_block_count matching with CP [Ok..] [0x2]
[FSCK] valid_node_count matcing with CP (de lookup) [Ok..] [0x1]
[FSCK] valid_node_count matcing with CP (nat lookup) [Ok..] [0x1]
[FSCK] valid_inode_count matched with CP [Ok..] [0x1]
[FSCK] free segment_count matched with CP [Fail] [0x27]
[FSCK] next block offset is free [Ok..]
[FSCK] fixing SIT types
[FSCK] other corrupted bugs [Fail]
....... at this point according to strace fsck does readv from
descriptor 0 (stdin). Must interrupt it with ctrl+c
> Hi,
> On 11/25/2016 6:30 AM, k@vodka.home.kg wrote:
>> Hi !
>>
>> I'm using f2fs on router Dlink dir-825 with openwrt/LEDE firmware.
>> Its mips32 rel 2 big endian cpu.
>>
>> mkfs.f2fs - works
>> mount - works
>> fsck.f2fs - corrupts filesystem
>>
>> # i'm trying to fsck valid empty mountable f2fs partition i have just mkfs'ed
>> fsck.f2fs /dev/sda2
>> Info: Segments per section = 1
>> Info: Sections per zone = 1
>> Info: sector size = 512
>> Info: total sectors = 6508544 (3178 MB)
>> Info: MKFS version
>> "Linux version 4.4.0-21-generic (buildd@lgw01-21) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2) ) #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016"
>> Info: FSCK version
>> from "Linux version 4.4.0-21-generic (buildd@lgw01-21) (gcc version 5.3.1 20160413 (Ubuntu 5.3.1-14ubuntu2) ) #37-Ubuntu SMP Mon Apr 18 18:33:37 UTC 2016"
>> to "Linux version 4.4.30 (vasya@nowhere) (gcc version 5.4.0 (LEDE GCC 5.4.0 r2084) ) #0 PREEMPT Thu Nov 3 07:34:38 2016"
>> Info: superblock features = 0 :
>> Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
>> Info: total FS sectors = 6508544 (3178 MB)
>> Info: CKPT version = 1
>> Info: checkpoint state = 5 : compacted_summary unmount
>> [ASSERT] (sanity_check_nid: 356) --> nid is not valid. [0x3]
> It seems that sanity_check_nid does not switch little endian value to big endian.
> I'm not sure if it is caused by this and if there are any other places have this
> endian switch issue, could you please test this.
> thanks,
> Sheng
> ======
> diff --git a/fsck/f2fs.h b/fsck/f2fs.h
> index 39ff161..9dc832c 100644
> --- a/fsck/f2fs.h
> +++ b/fsck/f2fs.h
> @@ -370,7 +370,7 @@ static inline block_t sum_blk_addr(struct
> f2fs_sb_info *sbi, int base, int type)
> static inline bool IS_VALID_NID(struct f2fs_sb_info *sbi, u32 nid)
> {
> return (nid <= (NAT_ENTRY_PER_BLOCK *
> - F2FS_RAW_SUPER(sbi)->segment_count_nat
> +
> le32_to_cpu(F2FS_RAW_SUPER(sbi)->segment_count_nat)
> << (sbi->log_blocks_per_seg - 1)));
> }
> @@ -378,7 +378,7 @@ static inline bool IS_VALID_BLK_ADDR(struct f2fs_sb_info *sbi, u32 addr)
> {
> int i;
- if (addr >>= F2FS_RAW_SUPER(sbi)->block_count ||
+ if (addr >>= le64_to_cpu(F2FS_RAW_SUPER(sbi)->block_count) ||
> addr < SM_I(sbi)->main_blkaddr) {
> DBG(1, "block addr [0x%x]\n", addr);
> return 0;
>>
>> NID[0x3] is unreachable
>> [FSCK] Unreachable nat entries [Fail] [0x1]
>> [FSCK] SIT valid block bitmap checking [Fail]
>> [FSCK] Hard link checking for regular file [Ok..] [0x0]
>> [FSCK] valid_block_count matching with CP [Fail] [0x0]
>> [FSCK] valid_node_count matcing with CP (de lookup) [Fail] [0x0]
>> [FSCK] valid_node_count matcing with CP (nat lookup) [Ok..] [0x1]
>> [FSCK] valid_inode_count matched with CP [Fail] [0x0]
>> [FSCK] free segment_count matched with CP [Fail] [0x621]
>> [FSCK] next block offset is free [Ok..]
>> [FSCK] fixing SIT types
>> [FSCK] other corrupted bugs [Fail]
>> [FIX] (nullify_nat_entry:1688) --> Remove nid [0x3] in nat journal
>>
>> After failed mount attempt :
>>
>> dmesg
>> F2FS-fs (sda2): Failed to read root inode
>>
>> On x86 and ARM everything is ok
>>
>> f2fs-tools 1.7.0
>> kernel 4.4.30
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Linux-f2fs-devel mailing list
>> Linux-f2fs-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
>>
>> .
>>
------------------------------------------------------------------------------
next prev parent reply other threads:[~2016-11-25 8:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-24 22:30 fsck is broken on mips32 platform k
2016-11-25 1:23 ` Sheng Yong
2016-11-25 8:51 ` k [this message]
2016-11-25 14:49 ` [RFT PATCH 1/2] fsck.f2fs: remove duplicated header files Sheng Yong
2016-11-25 14:53 ` [RFT PATCH 2/2] fsck.f2fs: correct endianness Sheng Yong
2016-11-25 15:55 ` k
2016-11-26 1:10 ` 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=601891109.20161125115102@vodka.home.kg \
--to=k@vodka.home.kg \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=shengyong1@huawei.com \
/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).