f2fs: fix to recover inode's i_gc_failures during POR
authorChao Yu <yuchao0@huawei.com>
Tue, 25 Sep 2018 07:36:00 +0000 (15:36 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Wed, 26 Sep 2018 19:45:33 +0000 (12:45 -0700)
inode.i_gc_failures is used to indicate that skip count of migrating
on blocks of inode, we should guarantee it can be recovered in sudden
power-off case.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/recovery.c

index d8c169c..f11eefc 100644 (file)
@@ -234,6 +234,8 @@ static void recover_inode(struct inode *inode, struct page *page)
 
        F2FS_I(inode)->i_advise = raw->i_advise;
        F2FS_I(inode)->i_flags = le32_to_cpu(raw->i_flags);
+       F2FS_I(inode)->i_gc_failures[GC_FAILURE_PIN] =
+                               le16_to_cpu(raw->i_gc_failures);
 
        recover_inline_flags(inode, raw);