Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp41305ybv; Wed, 5 Feb 2020 00:42:13 -0800 (PST) X-Google-Smtp-Source: APXvYqz4wREYCdktP8hKTfnlIvhWfFbAyVM63SJoAvX4q2RHRuu9iggwfauxoTiLkqFQYmx1FWGh X-Received: by 2002:a9d:3b09:: with SMTP id z9mr25306176otb.195.1580892133816; Wed, 05 Feb 2020 00:42:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580892133; cv=none; d=google.com; s=arc-20160816; b=L55R2SJfOIk+oq85p+gUYJaMYyFEdzyfQeipPZGhUonhtsctj1HJcSz3eVJIIUrjJa f8NdtiP5FaLJeeQJ9cvAp5Vv+xwTZKNQlEYkBweIiry9ymHoB9NzjlXohSEpL3DvNCKN mwD+npw+ndiQYqaW1bNoxrqpmunIc0dXhWT0KYjaBPOp1D47bTcEPHxJ76+bF/oxreJ0 umgWz5VLQ2WrtwAjVEOWKKKkUa0hZlx7lM0pIRZk5u3MsGvdh5ub1+jfFvQoG14FZP0w T55Fam828atMB1bZJIiMTRdM4wzrjcJQtEo33YvcXNJnll7InRYDLQnwmk6xdHGDhQjc ycig== 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:references:cc:to:from:subject; bh=YtcedEy7D8TmJOa4poVaMCRJQ6XKTRYEhNUkpUhwPNI=; b=HaIFPg8RKQpLxw76F6AOVJscq40VLBPYOaALgZm3sklb+d3GGXZ9ilDjwiG+Ix1QiT luyOld0hOFnf4W/bfcZzCC7OUmFKBm4naTur75iJCt6fNqet/Vq3bQ4GJp57+q42VlDn fyCg7GSK9oPakKuAeziwue0v2uDk4ZDvU1ecY64jYTVod1Sn/Kgn8nqrJFMRLIwdBT3/ hjpau5+XO89Cp+LuxCKnwJMLxdQQWHgiuD6qL5nzoWev0i+QZ3KhMMNb5AtoCNEGljhp T/27UZWW0HoQr//g5qCwBhSDK7lEAr1D9gWkQrO0UTFJmcrlrnafllql3kM3hueRtZVP fqhg== 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 m25si13385492otn.208.2020.02.05.00.41.50; Wed, 05 Feb 2020 00:42:13 -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 S1728034AbgBEIkh (ORCPT + 99 others); Wed, 5 Feb 2020 03:40:37 -0500 Received: from out30-54.freemail.mail.aliyun.com ([115.124.30.54]:55714 "EHLO out30-54.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726490AbgBEIkh (ORCPT ); Wed, 5 Feb 2020 03:40:37 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R211e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01f04428;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0TpByzI3_1580892033; Received: from JosephdeMacBook-Pro.local(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0TpByzI3_1580892033) by smtp.aliyun-inc.com(127.0.0.1); Wed, 05 Feb 2020 16:40:33 +0800 Subject: Re: [Ocfs2-devel] [PATCH] OCFS2: remove useless err From: Joseph Qi To: Alex Shi Cc: Kate Stewart , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Richard Fontana , ChenGang , Thomas Gleixner , ocfs2-devel@oss.oracle.com References: <1579577836-251879-1-git-send-email-alex.shi@linux.alibaba.com> <5aa17eac-60ee-5360-81f9-7bff2cb76eb3@linux.alibaba.com> <2550e871-f930-92d1-4c75-fcd84fc20021@linux.alibaba.com> Message-ID: Date: Wed, 5 Feb 2020 16:40:33 +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: <2550e871-f930-92d1-4c75-fcd84fc20021@linux.alibaba.com> 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 19:34, Joseph Qi wrote: > > > 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? > Okay, in this case, bh is already NULL and will skip below, so it looks fine to me.