From: Chao Yu Date: Mon, 28 May 2018 08:59:26 +0000 (+0800) Subject: f2fs: don't drop dentry pages after fs shutdown X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=1174abfd8309f4c47d454734233aa3b694560e10;p=linux.git f2fs: don't drop dentry pages after fs shutdown As description in commit "f2fs: don't drop any page on f2fs_cp_error() case": "We still provide readdir() after shtudown, so we should keep pages to avoid additional IOs." In order to provider lastest directory structure, let's keep dentry pages in cache after fs shutdown. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 9d3e2e1c1e336..31c2edb217ec0 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -1801,6 +1801,12 @@ static int __write_data_page(struct page *page, bool *submitted, /* we should bypass data pages to proceed the kworkder jobs */ if (unlikely(f2fs_cp_error(sbi))) { mapping_set_error(page->mapping, -EIO); + /* + * don't drop any dirty dentry pages for keeping lastest + * directory structure. + */ + if (S_ISDIR(inode->i_mode)) + goto redirty_out; goto out; }