diff options
author | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2012-12-10 09:52:48 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk.kim@samsung.com> | 2012-12-11 05:43:45 +0100 |
commit | 6666e6aa9f36b2bfd6b30072c07b34f2a24becf1 (patch) | |
tree | 29a4b75710c8dc3e8df25617aae0b6e51359f1f3 /drivers/vme/vme.c | |
parent | f2fs: cleanup the f2fs_bio_alloc routine (diff) | |
download | linux-6666e6aa9f36b2bfd6b30072c07b34f2a24becf1.tar.xz linux-6666e6aa9f36b2bfd6b30072c07b34f2a24becf1.zip |
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>
Diffstat (limited to 'drivers/vme/vme.c')
0 files changed, 0 insertions, 0 deletions