• J
    f2fs: fix inconsistency of block count during recovery · 65e5cd0a
    Jaegeuk Kim 提交于
    Currently f2fs recovers the dentry of fsynced files.
    When power-off-recovery is conducted, this newly recovered inode should increase
    node block count as well as inode block count.
    
    This patch resolves this inconsistency that results in:
    
    1. create a file
    2. write data
    3. fsync
    4. reboot without sync
    5. mount and recover the file
    6. node block count is 1 and inode block count is 2
     : fall into the inconsistent state
    7. unlink the file
     : trigger the following BUG_ON
    
    ------------[ cut here ]------------
    kernel BUG at /home/zeus/f2fs_test/src/fs/f2fs/f2fs.h:716!
    Call Trace:
     [<ffffffffa0344100>] ? get_node_page+0x50/0x1a0 [f2fs]
     [<ffffffffa0344bfc>] remove_inode_page+0x8c/0x100 [f2fs]
     [<ffffffffa03380f0>] ? f2fs_evict_inode+0x180/0x2d0 [f2fs]
     [<ffffffffa033812e>] f2fs_evict_inode+0x1be/0x2d0 [f2fs]
     [<ffffffff811c7a67>] evict+0xa7/0x1a0
     [<ffffffff811c82b5>] iput+0x105/0x190
     [<ffffffff811c2b30>] d_kill+0xe0/0x120
     [<ffffffff811c2c57>] dput+0xe7/0x1e0
     [<ffffffff811acc3d>] __fput+0x19d/0x2d0
     [<ffffffff811acd7e>] ____fput+0xe/0x10
     [<ffffffff81070645>] task_work_run+0xb5/0xe0
     [<ffffffff81002941>] do_notify_resume+0x71/0xb0
     [<ffffffff8175f14a>] int_signal+0x12/0x17
    Reported-and-Tested-by: NChris Fries <C.Fries@motorola.com>
    Signed-off-by: NJaegeuk Kim <jaegeuk.kim@samsung.com>
    65e5cd0a
node.c 42.1 KB