Signed-off-by: Li Wang <liwang@xxxxxxxxxxxxxxx> Signed-off-by: Yunchuan Wen <yunchuanwen@xxxxxxxxxxxxxxx> --- mm/fadvise.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mm/fadvise.c b/mm/fadvise.c index 3bcfd81..644d32d 100644 --- a/mm/fadvise.c +++ b/mm/fadvise.c @@ -113,6 +113,10 @@ SYSCALL_DEFINE4(fadvise64_64, int, fd, loff_t, offset, loff_t, len, int, advice) case POSIX_FADV_NOREUSE: break; case POSIX_FADV_DONTNEED: + if (S_ISDIR(file_inode(f.file)->i_mode)) { + shrink_pagecache_parent(f.file->f_dentry); + goto out; + } if (!bdi_write_congested(mapping->backing_dev_info)) __filemap_fdatawrite_range(mapping, offset, endbyte, WB_SYNC_NONE); -- 1.7.9.5 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>