summaryrefslogtreecommitdiff
path: root/fs/f2fs/dir.c
diff options
context:
space:
mode:
authorSheng Yong <shengyong1@huawei.com>2017-06-26 10:41:35 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2017-07-07 10:34:45 -0700
commitd58dfb75056c5f732a0b83c54d22c99b4edc947a (patch)
tree02c059163c940eec149ea03214ca883eb69c2dd1 /fs/f2fs/dir.c
parent0771fcc71c0c28bf31ac5c2c863b9f0de0fdf00d (diff)
f2fs: do not set LOST_PINO for newly created dir
Since directories will be written back with checkpoint and fsync a directory will always write CP, there is no need to set LOST_PINO after creating a directory. Signed-off-by: Sheng Yong <shengyong1@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/dir.c')
-rw-r--r--fs/f2fs/dir.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index 94756f55a97e..37f9c7f55605 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -415,7 +415,8 @@ struct page *init_inode_metadata(struct inode *inode, struct inode *dir,
* We lost i_pino from now on.
*/
if (is_inode_flag_set(inode, FI_INC_LINK)) {
- file_lost_pino(inode);
+ if (!S_ISDIR(inode->i_mode))
+ file_lost_pino(inode);
/*
* If link the tmpfile to alias through linkat path,
* we should remove this inode from orphan list.