Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5905589ybi; Wed, 31 Jul 2019 05:14:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyb3KEPWxOS1rZZWUMK+lR17ZywsyB39rHyu7VaKL6MoqVtNbpVxSFlMa7wwTXcFBMJuRG1 X-Received: by 2002:a17:90a:b115:: with SMTP id z21mr2698245pjq.64.1564575280528; Wed, 31 Jul 2019 05:14:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564575280; cv=none; d=google.com; s=arc-20160816; b=Yu1oh+ltGqG6kqeqta7YADxNWxOYvztvhKQri8TLCPdrgDlLsKOJiEehMbR8bLF8ON CN3HnqEE9Ea4mAMDaSEd0tRqoPOVBsmFN4S17m0WROrEiGnTp3bfiOIpGIwHRvR4Fy4M ytmnb7QH63/amjOIoK24nJaHH7/6yHt6Hu9gaE8pw3Vi6L/B8+X3RvDajhzCrmcPYPUf TRTQfVEV4SwO6APOwUAuISlFVGIP5SVMFFBJw/YeL154VaTCpYucQeeRIadm3mszYjnY t8ZWy5vbxQ9y0NI0vaL987rKs1VWgAm0vG1iz4c8mTiTGHLrVmgFP46fhqzZbl71ygsD u7hA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Ds1PMjbN7hGek30dQNGvSgfr6W9r4n8cdkJWjO3Q6Yc=; b=s07rTpmiK6QYR8to3SXg/7B2Zz6u+W2t5tNcMyh3Vn1OZB7Vh1LkusxY+tf11DUK4F ut8B1dnPQrlkz4/wAojz9uPoaDS7NC4Q5by9jfr3Gs6/sCMP5BAzHSlUrsyUSJuT1ZBC HHXCnYQFY6KMJuIHfxSnahJZwG+vu5CkFMA7PH2uSs+83xknjaicCprrK2N4XYXwZLDm VQV/FjhEorVb2ZJ3nvvJrWHhJUAWUSuMsi6yNnU+czmKlK7TDZl98HlUcwsJNcdYqR4R Qj9uPIM7N4R0v7eetVpKZOIplXZzR86yK3JJ1N404oIHtIq6Cf2UUVTeWNGqAdJGOPT9 rjAg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 34si31957255pgl.397.2019.07.31.05.14.23; Wed, 31 Jul 2019 05:14:40 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728912AbfGaJsZ (ORCPT + 99 others); Wed, 31 Jul 2019 05:48:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:51478 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726605AbfGaJsX (ORCPT ); Wed, 31 Jul 2019 05:48:23 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 2310EAD93; Wed, 31 Jul 2019 09:48:22 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id D22641E43D6; Wed, 31 Jul 2019 11:48:19 +0200 (CEST) Date: Wed, 31 Jul 2019 11:48:19 +0200 From: Jan Kara To: Jia-Ju Bai Cc: jack@suse.cz, akpm@linux-foundation.org, arnd@arndb.de, hariprasad.kelam@gmail.com, linux.bhar@gmail.com, reiserfs-devel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs: reiserfs: Remove unnecessary check of bh in remove_from_transaction() Message-ID: <20190731094819.GB15806@quack2.suse.cz> References: <20190727084019.11307-1-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190727084019.11307-1-baijiaju1990@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat 27-07-19 16:40:19, Jia-Ju Bai wrote: > On lines 3430-3434, bh has been assured to be non-null: > cn = get_journal_hash_dev(sb, journal->j_hash_table, blocknr); > if (!cn || !cn->bh) { > return ret; > } > bh = cn->bh; > > Thus, the check of bh on line 3447 is unnecessary and can be removed. > Thank Andrew Morton for good advice. > > Signed-off-by: Jia-Ju Bai Looks good to me. You can add: Reviewed-by: Jan Kara Honza > --- > fs/reiserfs/journal.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c > index 4517a1394c6f..11155b8513db 100644 > --- a/fs/reiserfs/journal.c > +++ b/fs/reiserfs/journal.c > @@ -3444,9 +3444,8 @@ static int remove_from_transaction(struct super_block *sb, > if (cn == journal->j_last) { > journal->j_last = cn->prev; > } > - if (bh) > - remove_journal_hash(sb, journal->j_hash_table, NULL, > - bh->b_blocknr, 0); > + remove_journal_hash(sb, journal->j_hash_table, NULL, > + bh->b_blocknr, 0); > clear_buffer_journaled(bh); /* don't log this one */ > > if (!already_cleaned) { > -- > 2.17.0 > -- Jan Kara SUSE Labs, CR