Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753198AbcD0NZ0 (ORCPT ); Wed, 27 Apr 2016 09:25:26 -0400 Received: from mail.kernel.org ([198.145.29.136]:38345 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752529AbcD0NZY (ORCPT ); Wed, 27 Apr 2016 09:25:24 -0400 Subject: Re: [PATCH] f2fs: fix to return 0 if err == -ENOENT in f2fs_readdir To: Yunlong Song , jaegeuk@kernel.org, cm224.lee@samsung.com, yuchao0@huawei.com, sylinux@163.com References: <1461760357-13882-1-git-send-email-yunlong.song@huawei.com> Cc: bintian.wang@huawei.com, houpengyang@huawei.com, heyunlei@huawei.com, liushuoran@huawei.com, shiguojun@huawei.com, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org From: Chao Yu Message-ID: <5720BDB5.9000106@kernel.org> Date: Wed, 27 Apr 2016 21:25:09 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <1461760357-13882-1-git-send-email-yunlong.song@huawei.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 603 Lines: 14 On 2016/4/27 20:32, Yunlong Song wrote: > Commit 57b62d29ad5b384775974973087d47755a8c6fcc ("f2fs: fix to report > error in f2fs_readdir") causes f2fs_readdir to return -ENOENT when > get_lock_data_page returns -ENOENT. However, the original logic is to > continue when get_lock_data_page returns -ENOENT, but it forgets to > reset err to 0. > > This will cause getdents64 incorretly return -ENOENT when lastdirent is > NULL in getdents64. This will lead to a wrong return value for syscall > caller. > > Signed-off-by: Yunlong Song Reviewed-by: Chao Yu