https://bugzilla.kernel.org/show_bug.cgi?id=216162

Chao Yu ([email protected]) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #8 from Chao Yu ([email protected]) ---
(In reply to ghtm2 from comment #5)
> According to git bisect that I just ran,
> 198fd9faa271dd54dca6fc8eb6873f42dfd3b4d8 is the first bad commit.
> "f2fs: fix to do sanity check for inline inode"
> 
> I reverted that on linux-stable v5.18.9 and the problem is indeed no longer
> present.
> 
> Wile doing that I've found that my initial description as well es the
> attached image were missing a command:
>     chattr -R +c /mnt/etc
> Without it the compression wouldn't be enabled and the errors wouldn't be
> visible.

I can reproduce your issue and repair this w/ last f2fs-tools:

[reproduce]
mount -o loop ./broken.img /mnt/f2fs/
touch /mnt/f2fs/file
lsattr /mnt/f2fs/file 
-----------------N-- /mnt/f2fs/file
chattr +c /mnt/f2fs/file 
lsattr /mnt/f2fs/file 
--------c--------N-- /mnt/f2fs/file
umount /mnt/f2fs 
mount -o loop ./broken.img /mnt/f2fs/
lsattr /mnt/f2fs/file 
lsattr: Structure needs cleaning while trying to stat /mnt/f2fs/file

[repair]
fsck.f2fs ./broken.img

output:

[FIX] (fsck_chk_inode_blk: 728)  --> [0x505] i_flags=0x4 -> 0x0
[ASSERT] (fsck_chk_inode_blk:1182)  --> ino: 0x505 chksum:0xe7b707a8, but
calculated one is: 0x3f6daf58
[FIX] (fsck_chk_inode_blk:1188)  --> ino: 0x505 recover, i_inode_checksum=
0xe7b707a8 -> 0x3f6daf58

[verify]
mount -o loop ./broken.img /mnt/f2fs/
stat /mnt/f2fs/file 
  File: /mnt/f2fs/file
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 70fh/1807d      Inode: 1285        Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2022-07-17 11:51:41.705230802 +0800
Modify: 2022-07-17 11:51:41.705230802 +0800
Change: 2022-07-17 11:51:57.641110482 +0800
 Birth: -
lsattr /mnt/f2fs/file 
-----------------N-- /mnt/f2fs/file         ---- compressed flag was removed by
fsck.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

Reply via email to