f2fs: fix to record dirty page count for symlink
authorChao Yu <chao2.yu@samsung.com>
Mon, 29 Jun 2015 10:14:10 +0000 (18:14 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 4 Aug 2015 21:09:52 +0000 (14:09 -0700)
Dirty page can be exist in mapping of newly created symlink, but previously
we did not maintain the counting of dirty page for symlink like we maintained
for regular/directory, so the counting we lookuped should be wrong.

This patch adds missed dirty page counting for symlink to fix this issue.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/checkpoint.c
fs/f2fs/f2fs.h

index b70bbe1a6a8ca6a31f854c5efd4d8fa7495a64a2..de7a0d6a371ad9e0d4d5eb12ce7217a7f4028af3 100644 (file)
@@ -704,7 +704,8 @@ void update_dirty_page(struct inode *inode, struct page *page)
        struct inode_entry *new;
        int ret = 0;
 
-       if (!S_ISDIR(inode->i_mode) && !S_ISREG(inode->i_mode))
+       if (!S_ISDIR(inode->i_mode) && !S_ISREG(inode->i_mode) &&
+                       !S_ISLNK(inode->i_mode))
                return;
 
        if (!S_ISDIR(inode->i_mode)) {
index a8327ed7389873481c560e98c1059406c37661cc..516220454a4ee805d8df491f38e31b8ea15a995e 100644 (file)
@@ -1039,7 +1039,8 @@ static inline void dec_page_count(struct f2fs_sb_info *sbi, int count_type)
 
 static inline void inode_dec_dirty_pages(struct inode *inode)
 {
-       if (!S_ISDIR(inode->i_mode) && !S_ISREG(inode->i_mode))
+       if (!S_ISDIR(inode->i_mode) && !S_ISREG(inode->i_mode) &&
+                       !S_ISLNK(inode->i_mode))
                return;
 
        atomic_dec(&F2FS_I(inode)->dirty_pages);