Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752996AbbF2KPF (ORCPT ); Mon, 29 Jun 2015 06:15:05 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:52678 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753500AbbF2KO4 (ORCPT ); Mon, 29 Jun 2015 06:14:56 -0400 X-AuditID: cbfee61a-f79516d000006302-11-55911a9d50b5 From: Chao Yu To: Jaegeuk Kim , Changman Lee Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: fix to record dirty page count for symlink Date: Mon, 29 Jun 2015 18:14:10 +0800 Message-id: <00dd01d0b254$7082c640$518852c0$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AdCyQRDT7XFHd+GgSp6VWuEsxG7EZA== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrALMWRmVeSWpSXmKPExsVy+t9jQd15UhNDDR68Z7a4tq+RyeLJ+lnM FpcWuVtc3jWHzYHFY9OqTjaP3Qs+M3n0bVnF6PF5k1wASxSXTUpqTmZZapG+XQJXxoRJDxkL tnFXzN58m7mBcQ9nFyMnh4SAicSNCavZIWwxiQv31rOB2EIC0xkl3p7x7WLkArJfMUrM29jJ CJJgE1CRWN7xnwnEFhHwkpi0/wQLiM0s4CHR2PGdtYuRnUNYwFFiSQJIlEVAVeLZsp/MIDav gKXExOmfGSFsQYkfk+9BdWpJrN95nAnClpfYvOYtM8Q5ChI7zr5mhNikJ9E7pxGqRlxi45Fb LBMYBWYhGTULyahZSEbNQtKygJFlFaNoakFyQXFSeq6hXnFibnFpXrpecn7uJkZwOD+T2sG4 ssHiEKMAB6MSD6/H+wmhQqyJZcWVuYcYJTiYlUR4L28GCvGmJFZWpRblxxeV5qQWH2KU5mBR Euc9me8TKiSQnliSmp2aWpBaBJNl4uCUamA8b701ZdmLqVxOi2fpvfD5wh3+oOPZo6o2r9It s8zufApiTDCpYDH7WehWcUL95qclM9aG7bkSbDrxvkx6Vd8tn6OC71XPs6+yyv008UuBy1cR 26/LlUL1NQX12qINDh1/IOjI81KWM/jVEk7/x7zfpDzWe2rPyggJ7X4ddUR+QVSC9eE3Tw8p sRRnJBpqMRcVJwIAuiG6imMCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1663 Lines: 49 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 --- fs/f2fs/checkpoint.c | 3 ++- fs/f2fs/f2fs.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index b70bbe1..de7a0d6 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -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)) { diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index a8327ed..5162204 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -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); -- 2.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/