Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4873555ybl; Tue, 4 Feb 2020 03:35:51 -0800 (PST) X-Google-Smtp-Source: APXvYqz7cKFrPSHR1+Rw7OVBzw/rzLWnsjYeBmB+2cOsVz6RrdB8aCRAZi/Mv3ovzbYWvVkzbdfW X-Received: by 2002:a05:6808:98e:: with SMTP id a14mr3061756oic.8.1580816151776; Tue, 04 Feb 2020 03:35:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580816151; cv=none; d=google.com; s=arc-20160816; b=sRWEFVfKEjVbekHzKbQGDljsFMXD8bIJKUN1RWGVeJM6Re6jwW/GR6/iSpdtHHeD9O i8DAhWBnw/SoV6Y+kkAjTrhRj3axUZc/S+A1CGHu2U01OHflmGnbjswqFDWg8PmeTe6Y Dyk8E31Vh3WaQP64EwJv3eIZQLFjaFFu7jpmtCXjq9rdbffDzpIF2wRwAPNztXdeUNdx 8Fg6x5/45yfqWBmPC820ILPd0gi2W3zkNLnPYQlBDqE+Di6qlK+8ChJ8Vreews1O72Mv dq1rN7YJByjh46vK93PwvtPcGa+ZQVx9/qhvQzkxL7CaAPLLd1xTnM+iO6EYJ2mmENxX Njwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=k/K11tL36KayI4EgCmAt5l1QBLa7O+jXwBXlF5QLVoY=; b=RrI/U2KY/mzPDrIziLlNTg5h51BJ0LBTK9D4Hgll/KjwaFAbHzBfFufkvrIZnum44s 6J/UHFatSiFl4FfNV+1xiTAC50vk2S+DcV8ZDu9wjmONqET4aWEgJNwuvch41S3/nZfG aceMUb7GbDH4/Xu+rjcwqU7+l0ngnMmQTDyClQAlk/N0u53HWsy+dSiHKa6kptJhEhVV uj1XmLR0xdlu41vvTi+FpKESXhfetLLMOfQ5RojxLke0Jbw2zZVpMK3PoGbh7DTXlEJR P/gMMcgs7JXMVJcQZO7Mnu7gvQN2CtKLhDP0Gc0bPfdDA4rVwJ7+bhM/ZbXh/hs3I8f0 pedg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q9si11865630otc.86.2020.02.04.03.35.39; Tue, 04 Feb 2020 03:35:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727148AbgBDLem (ORCPT + 99 others); Tue, 4 Feb 2020 06:34:42 -0500 Received: from out30-44.freemail.mail.aliyun.com ([115.124.30.44]:44674 "EHLO out30-44.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726965AbgBDLel (ORCPT ); Tue, 4 Feb 2020 06:34:41 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R181e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04427;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0Tp87BdY_1580816045; Received: from JosephdeMacBook-Pro.local(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0Tp87BdY_1580816045) by smtp.aliyun-inc.com(127.0.0.1); Tue, 04 Feb 2020 19:34:09 +0800 Subject: Re: [PATCH] OCFS2: remove useless err To: Alex Shi Cc: Mark Fasheh , Joel Becker , Andrew Morton , Greg Kroah-Hartman , Kate Stewart , ChenGang , Richard Fontana , Thomas Gleixner , ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org References: <1579577836-251879-1-git-send-email-alex.shi@linux.alibaba.com> <5aa17eac-60ee-5360-81f9-7bff2cb76eb3@linux.alibaba.com> From: Joseph Qi Message-ID: <2550e871-f930-92d1-4c75-fcd84fc20021@linux.alibaba.com> Date: Tue, 4 Feb 2020 19:34:05 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/2/4 18:59, Alex Shi wrote: > > > 在 2020/1/26 上午9:52, Joseph Qi 写道: >> > >>> >>> @@ -708,7 +708,7 @@ static struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, >>> num++; >>> >>> bh = NULL; >>> - err = ocfs2_read_dir_block(dir, b++, &bh, >>> + ocfs2_read_dir_block(dir, b++, &bh, >>> OCFS2_BH_READAHEAD); >> >> Umm... missing error checking here? > > > /* > * This function forces all errors to -EIO for consistency with its > * predecessor, ocfs2_bread(). We haven't audited what returning the > * real error codes would do to callers. We log the real codes with > * mlog_errno() before we squash them. > */ > static int ocfs2_read_dir_block(struct inode *inode, u64 v_block, > struct buffer_head **bh, int flags) > > According to ocfs2_read_dir_block comments, caller don't care the err value, func will log it. > > So is this patch ok? :) > If we got error here, it means the buffer head is invalid. So how about mark it as NULL and skip it? Thanks, Joseph