From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EC33C49EAB for ; Tue, 5 Nov 2019 09:41:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2C66220650 for ; Tue, 5 Nov 2019 09:41:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730804AbfKEJl4 (ORCPT ); Tue, 5 Nov 2019 04:41:56 -0500 Received: from mx2.suse.de ([195.135.220.15]:44780 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730666AbfKEJl4 (ORCPT ); Tue, 5 Nov 2019 04:41:56 -0500 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 3B615B33E; Tue, 5 Nov 2019 09:41:54 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 300981E4407; Tue, 5 Nov 2019 10:41:54 +0100 (CET) Date: Tue, 5 Nov 2019 10:41:54 +0100 From: Jan Kara To: Chengguang Xu Cc: jack@suse.com, linux-ext4@vger.kernel.org Subject: Re: [PATCH] ext2: check err when partial != NULL Message-ID: <20191105094154.GK22379@quack2.suse.cz> References: <20191105045100.7104-1-cgxu519@mykernel.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191105045100.7104-1-cgxu519@mykernel.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue 05-11-19 12:51:00, Chengguang Xu wrote: > Check err when partial == NULL is meaningless because > partial == NULL means getting branch successfully without > error. > > Signed-off-by: Chengguang Xu Good catch! Added to my tree. Thanks! Honza > --- > fs/ext2/inode.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c > index 7004ce581a32..a16c53655e77 100644 > --- a/fs/ext2/inode.c > +++ b/fs/ext2/inode.c > @@ -701,10 +701,13 @@ static int ext2_get_blocks(struct inode *inode, > if (!partial) { > count++; > mutex_unlock(&ei->truncate_mutex); > - if (err) > - goto cleanup; > goto got_it; > } > + > + if (err) { > + mutex_unlock(&ei->truncate_mutex); > + goto cleanup; > + } > } > > /* > -- > 2.20.1 > > > -- Jan Kara SUSE Labs, CR