Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754491AbbHLJtG (ORCPT ); Wed, 12 Aug 2015 05:49:06 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:34501 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932082AbbHLJtC (ORCPT ); Wed, 12 Aug 2015 05:49:02 -0400 X-AuditID: cbfee61b-f79706d000001b96-56-55cb168c739e From: Chao Yu To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: avoid clear valid page Date: Wed, 12 Aug 2015 17:48:21 +0800 Message-id: <00bc01d0d4e4$1dec93e0$59c5bba0$@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: AdDUpgoYQungOTnfQeiLMTmXvbtxUw== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsVy+t9jQd1esdOhBv9uMVs8WT+L2eLSIneL y7vmsDkwe2xa1cnmsXvBZyaPz5vkApijuGxSUnMyy1KL9O0SuDKmXNUteMpe0Xv7EHsD41q2 LkZODgkBE4nv858zQthiEhfurQeKc3EICcxilNh38iQzhPOKUWLD7mXMIFVsAioSyzv+M4HY IkD2oUWX2UFsZgEPicaO76xdjBwcwgK6EhPuWIKEWQRUJbbM/ssCYvMKWEp8/LKZEcIWlPgx +R4LRKuWxPqdx5kgbHmJzWveMkMcpCCx4+xrRohVehL3ft5ig6gRl9h45BbLBEagKxFGzUIy ahaSUbOQtCxgZFnFKJFakFxQnJSea5SXWq5XnJhbXJqXrpecn7uJERzCz6R3MB7e5X6IUYCD UYmH12DiqVAh1sSy4srcQ4wSHMxKIrw994FCvCmJlVWpRfnxRaU5qcWHGKU5WJTEefVNNoUK CaQnlqRmp6YWpBbBZJk4OKUaGJtn3Labzr7PJaxb6GOp6OOaD0YyMvvOi7tpr1zh/kHYKyT5 p6O2vfjZzZXbQqL6zdQmt8mzPJLJqpoqmmig5XeGXTWO5/jibIUPvsK/2iauPmcwefWcJrUO zVXHdfluTbD13VulnTJLpmuS7e+ZyTdnn74/JUtWZJ/Oa7l9nYsUH3VeF9pyTYmlOCPRUIu5 qDgRANCMPAddAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1211 Lines: 36 In f2fs_delete_entry, if last dirent is remove from the dentry page, we will try to punch that page since it has no valid date in it. But truncate_hole which is used for punching could fail because of no memory or IO error, if that happened, we'd better skip clearing this valid dentry page. Signed-off-by: Chao Yu --- fs/f2fs/dir.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index a34ebd8..8f15fc1 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -718,8 +718,8 @@ void f2fs_delete_entry(struct f2fs_dir_entry *dentry, struct page *page, if (inode) f2fs_drop_nlink(dir, inode, NULL); - if (bit_pos == NR_DENTRY_IN_BLOCK) { - truncate_hole(dir, page->index, page->index + 1); + if (bit_pos == NR_DENTRY_IN_BLOCK && + !truncate_hole(dir, page->index, page->index + 1)) { clear_page_dirty_for_io(page); ClearPagePrivate(page); ClearPageUptodate(page); -- 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/