diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 9d3e2e1c1e336f5833ca600c5b6085473e58da11..31c2edb217ec0124207b8f71423a6a39a313645c 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; }