]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: fix roll-forward missing scenarios
authorJaegeuk Kim <jaegeuk@kernel.org>
Mon, 15 Sep 2014 23:46:08 +0000 (16:46 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 23 Sep 2014 18:10:16 +0000 (11:10 -0700)
commit42f38d2c4155ffbc0f00c01d76717655af229617
treeb8aca7fbc39d37a06123c491438ad5b82a241af0
parent34f044a8b1f5ba1f2d067480de893873a10172ba
f2fs: fix roll-forward missing scenarios

We can summarize the roll forward recovery scenarios as follows.

[Term] F: fsync_mark, D: dentry_mark

1. inode(x) | CP | inode(x) | dnode(F)
-> Update the latest inode(x).

2. inode(x) | CP | inode(F) | dnode(F)
-> No problem.

3. inode(x) | CP | dnode(F) | inode(x)
-> Recover to the latest dnode(F), and drop the last inode(x)

4. inode(x) | CP | dnode(F) | inode(F)
-> No problem.

5. CP | inode(x) | dnode(F)
-> The inode(DF) was missing. Should drop this dnode(F).

6. CP | inode(DF) | dnode(F)
-> No problem.

7. CP | dnode(F) | inode(DF)
-> If f2fs_iget fails, then goto next to find inode(DF).

8. CP | dnode(F) | inode(x)
-> If f2fs_iget fails, then goto next to find inode(DF).
   But it will fail due to no inode(DF).

So, this patch adds some missing points such as #1, #5, #7, and #8.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/recovery.c