linux/fs/f2fs
Jaegeuk Kim 6666e6aa9f f2fs: fix tracking parent inode number
Previously, f2fs didn't track the parent inode number correctly which is stored
in each f2fs_inode. In the case of the following scenario, a bug can be occured.

Let's suppose there are one directory, "/b", and two files, "/a" and "/b/a".
 - pino of "/a" is ROOT_INO.
 - pino of "/b/a" is DIR_B_INO.

Then,
 # sync
  : The inode pages of "/a" and "/b/a" contain the parent inode numbers as
    ROOT_INO and DIR_B_INO respectively.
 # mv /a /b/a
  : The parent inode number of "/a" should be changed to DIR_B_INO, but f2fs
    didn't do that. Ref. f2fs_set_link().

In order to fix this clearly, I added i_pino in f2fs_inode_info, and whenever
it needs to be changed like in f2fs_add_link() and f2fs_set_link(), it is
updated temporarily in f2fs_inode_info.

And later, f2fs_write_inode() stores the latest information to the inode pages.
For power-off-recovery, f2fs_sync_file() triggers simply f2fs_write_inode().

Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
2012-12-11 13:43:45 +09:00
..
acl.c f2fs: resolve build failures 2012-12-11 13:43:43 +09:00
acl.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
checkpoint.c f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
data.c f2fs: cleanup the f2fs_bio_alloc routine 2012-12-11 13:43:45 +09:00
debug.c f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
dir.c f2fs: fix tracking parent inode number 2012-12-11 13:43:45 +09:00
f2fs.h f2fs: fix tracking parent inode number 2012-12-11 13:43:45 +09:00
file.c f2fs: remove unused variable 2012-12-11 13:43:44 +09:00
gc.c f2fs: remove unneeded initialization 2012-12-11 13:43:44 +09:00
gc.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
hash.c f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
inode.c f2fs: fix tracking parent inode number 2012-12-11 13:43:45 +09:00
Kconfig f2fs: resolve build failures 2012-12-11 13:43:43 +09:00
Makefile f2fs: update Kconfig and Makefile 2012-12-11 13:43:42 +09:00
namei.c f2fs: make use of GFP_F2FS_ZERO for setting gfp_mask 2012-12-11 13:43:44 +09:00
node.c f2fs: fix the compiler warning for uninitialized use of variable 2012-12-11 13:43:43 +09:00
node.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
recovery.c f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00
segment.c f2fs: cleanup the f2fs_bio_alloc routine 2012-12-11 13:43:45 +09:00
segment.h f2fs: cleanup the f2fs_bio_alloc routine 2012-12-11 13:43:45 +09:00
super.c f2fs: remove unneeded memset from init_once 2012-12-11 13:43:43 +09:00
xattr.c f2fs: resolve build failures 2012-12-11 13:43:43 +09:00
xattr.h f2fs: adjust kernel coding style 2012-12-11 13:43:42 +09:00