Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757986AbbKSIJw (ORCPT ); Thu, 19 Nov 2015 03:09:52 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:33440 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756203AbbKSIJu (ORCPT ); Thu, 19 Nov 2015 03:09:50 -0500 X-AuditID: cbfee61b-f790c6d0000003e4-c0-564d83cc4d67 From: Chao Yu To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH] f2fs: fix to report error in f2fs_readdir Date: Thu, 19 Nov 2015 16:09:07 +0800 Message-id: <00a201d122a1$a879f920$f96deb60$@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: AdEioQ7Tqyhe8AFtTzCI/Fe+h/VrZA== Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrOLMWRmVeSWpSXmKPExsVy+t9jQd0zzb5hBs/fy1o8WT+L2eLSIneL y7vmsDkwe2xa1cnmsXvBZyaPz5vkApijuGxSUnMyy1KL9O0SuDIef5IvOM9WMW+CZAPjNNYu Rg4OCQETiVm3C7sYOYFMMYkL99azdTFycQgJzGKUaPzwkAkkISTwilHizBouEJtNQEViecd/ sLgIkH1o0WV2EJtZwEOiseM7K4gtLGAl0dk7mQXEZhFQlZh3Zz2YzStgKfHu5jQ2CFtQ4sfk eywQvVoS63ceZ4Kw5SU2r3nLDHGQgsSOs68ZQe4UEdCT2Pm4DqJEXGLjkVssExiBjkSYNAvJ pFlIJs1C0rKAkWUVo0RqQXJBcVJ6rlFearlecWJucWleul5yfu4mRnDwPpPewXh4l/shRgEO RiUe3g2nfMKEWBPLiitzDzFKcDArifA+KPMNE+JNSaysSi3Kjy8qzUktPsQozcGiJM6r72kU JiSQnliSmp2aWpBaBJNl4uCUamD0v5xw687aKfH6LyafjtdiDdQ6Kp7x8osPn7Pda5VEc9lL 2+Vyr/17Oqe7MXiBjOeez2+upn5eK2fz4VBK4Sf/9J3Gu/vFbTOFTj6UmxbR5f+lWNui6Rvn hp/fOvZ3aaXazRQ1Uv6+/2/t77S3W0ocX328tuC1oWGg8qrtipYf1BxdBBJra+8qsRRnJBpq MRcVJwIAAY2Tg1oCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1059 Lines: 38 get_lock_data_page in f2fs_readdir can fail due to a lot of reasons (i.e. no memory or IO error...), it's better to report this kind of error to user rather than ignoring it. Signed-off-by: Chao Yu --- fs/f2fs/dir.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index c2b330f..f1de7ee 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -855,8 +855,13 @@ static int f2fs_readdir(struct file *file, struct dir_context *ctx) for (; n < npages; n++) { dentry_page = get_lock_data_page(inode, n, false); - if (IS_ERR(dentry_page)) - continue; + if (IS_ERR(dentry_page)) { + err = PTR_ERR(dentry_page); + if (err == -ENOENT) + continue; + else + goto out; + } dentry_blk = kmap(dentry_page); -- 2.6.3 -- 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/