All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: John Kehayias <john.kehayias@protonmail.com>
Cc: "Linux-f2fs-devel@lists.sourceforge.net"
	<Linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [f2fs-dev] How to recover from "Wrong valid_user_blocks"?
Date: Fri, 12 Aug 2022 11:09:25 -0700	[thread overview]
Message-ID: <YvaXVV17YMDD2MhK@google.com> (raw)
In-Reply-To: <z1RSWUWvfCmbB3L_utbn1krfKRIw9T0dlzsLmT2h9615ny3oIgP80mJBL-L58og28AYHPIZdcAOBU9Ok7ao00tJUN9KNFM2K_owrSflLUWk=@protonmail.com>

Hi John,

On 08/12, John Kehayias via Linux-f2fs-devel wrote:
> Hello,
> 
> Apologies if this is not the correct mailing list, but it was the only one I could find.
> 
> I just resized an f2fs partition to the remaining free space on the disk. This seemed fine and resize.f2fs also seemed fine. However, the partition will no longer mount, due to this message:
> 
> Aug 12 00:10:09 localhost vmunix: [22056.879920] F2FS-fs (sdb2): invalid crc_offset: 0
> Aug 12 00:10:09 localhost vmunix: [22056.881202] F2FS-fs (sdb2): Wrong valid_user_blocks: 7163307, user_block_count: 5227520
> Aug 12 00:10:09 localhost vmunix: [22056.881206] F2FS-fs (sdb2): Failed to get valid F2FS checkpoint
> 
> Is there any way to fix this error?
> 
> I see this error reported before and supposedly fixed in current versions, though I had use f2fs-tools v1.14. I tried using 1.15 and from git, but resize reports nothing to do and fsck is successful. Here is that output:
> 
> Info: [/dev/sdb2] Disk Model: SD  Transcend   
> Info: MKFS version
>   "Linux version 5.5.2-arch1-1 (linux@archlinux) (gcc version 9.2.0 (GCC)) #1 SMP PREEMPT Tue, 04 Feb 2020 18:56:18 +0000"
> Info: FSCK version
>   from "Linux version 5.18.14 (guix@guix) (gcc (GCC) 10.3.0, GNU ld (GNU Binutils) 2.37) #1 SMP PREEMPT_DYNAMIC 1"
>     to "Linux version 5.18.14 (guix@guix) (gcc (GCC) 10.3.0, GNU ld (GNU Binutils) 2.37) #1 SMP PREEMPT_DYNAMIC 1"
> Info: superblock features = 0 : 
> Info: superblock encrypt level = 0, salt = 00000000000000000000000000000000
> Info: Segments per section = 1
> Info: Sections per zone = 1
> Info: total FS sectors = 124528600 (60804 MB)
> 	Invalid CP CRC offset: 0
> Info: CKPT version = 6ea966da
> Info: Checked valid nat_bits in checkpoint
> Info: checkpoint state = 81 :  nat_bits unmount
> [FSCK] Check node 1 / 402988 (0.00%)
> [FSCK] Check node 40299 / 402988 (10.00%)
> [FSCK] Check node 80597 / 402988 (20.00%)
> [FSCK] Check node 120895 / 402988 (30.00%)
> [FSCK] Check node 161193 / 402988 (40.00%)
> [FSCK] Check node 201491 / 402988 (50.00%)
> [FSCK] Check node 241789 / 402988 (60.00%)
> [FSCK] Check node 282087 / 402988 (70.00%)
> [FSCK] Check node 322385 / 402988 (80.00%)
> [FSCK] Check node 362683 / 402988 (90.00%)
> [FSCK] Check node 402981 / 402988 (100.00%)
> 
> [FSCK] Max image size: 30099 MB, Free space: 16769654 MB
> [FSCK] Unreachable nat entries                        [Ok..] [0x0]
> [FSCK] SIT valid block bitmap checking                [Ok..]
> [FSCK] Hard link checking for regular file            [Ok..] [0x474]
> [FSCK] valid_block_count matching with CP             [Ok..] [0x6d4dab]
> [FSCK] valid_node_count matching with CP (de lookup)  [Ok..] [0x6262c]
> [FSCK] valid_node_count matching with CP (nat lookup) [Ok..] [0x6262c]
> [FSCK] valid_inode_count matched with CP              [Ok..] [0x61367]
> [FSCK] free segment_count matched with CP             [Ok..] [0x3cc0]
> [FSCK] next block offset is free                      [Ok..]
> [FSCK] fixing SIT types
> [FSCK] other corrupted bugs                           [Ok..]
> 
> Done: 0.000000 secs
> sudo fsck.f2fs /dev/sdb2  6.20s user 5.41s system 4% cpu 4:24.44 total
> 
> I hope someone can help. It seems to just be a metadata issue? Is there a way to manually fix the misreported block count to resolve this?

Yeah, I guess so. Can I get the full fsck log by "fsck.f2fs -d 3"?

> 
> Thanks,
> John
> 
> 
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

      parent reply	other threads:[~2022-08-12 18:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-12  4:12 [f2fs-dev] How to recover from "Wrong valid_user_blocks"? John Kehayias via Linux-f2fs-devel
2022-08-12  6:27 ` John Kehayias via Linux-f2fs-devel
2022-08-12 18:13   ` Jaegeuk Kim
2022-08-18 20:55     ` John Kehayias via Linux-f2fs-devel
2022-08-12 18:09 ` Jaegeuk Kim [this message]

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=YvaXVV17YMDD2MhK@google.com \
    --to=jaegeuk@kernel.org \
    --cc=Linux-f2fs-devel@lists.sourceforge.net \
    --cc=john.kehayias@protonmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.