]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: do not set LOST_PINO for renamed dir
authorSheng Yong <shengyong1@huawei.com>
Mon, 26 Jun 2017 02:41:36 +0000 (10:41 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 7 Jul 2017 17:34:45 +0000 (10:34 -0700)
commitbbc02eeb262ba3099e20c0969dcb401890b7fbb7
treebf67fc37e44ae3efb0f20b56f230b257519f9a38
parentce30f5138a0b01611a8256f54adb7b3e4d83f47b
f2fs: do not set LOST_PINO for renamed dir

After renaming a directory, fsck could detect unmatched pino. The scenario
can be reproduced as the following:

$ mkdir /bar/subbar /foo
$ rename /bar/subbar /foo

Then fsck will report:
[ASSERT] (__chk_dots_dentries:1182)  --> Bad inode number[0x3] for '..', parent parent ino is [0x4]

Rename sets LOST_PINO for old_inode. However, the flag cannot be cleared,
since dir is written back with CP. So, let's get rid of LOST_PINO for a
renamed dir and fix the pino directly at the end of rename.

Signed-off-by: Sheng Yong <shengyong1@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/namei.c