Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp552035ybx; Tue, 5 Nov 2019 01:42:41 -0800 (PST) X-Google-Smtp-Source: APXvYqzdQ3fewrKRQ4YWYslYU1hq/Kr5aYQPPxwcGwaL8v2LJVJkmRXvRdLjc+lzUrCQYl1qHBcA X-Received: by 2002:a17:906:c45:: with SMTP id t5mr23770463ejf.296.1572946961760; Tue, 05 Nov 2019 01:42:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572946961; cv=none; d=google.com; s=arc-20160816; b=w94XdFY4nkS2FgLd3StEnTpqMDrjwAgDWpKBAO3Y9JI7TmrKAnw+yLKCfZLv7xB58w Jnti051zfxeWEynWvBwWqlwSySk24Fy5ixaG+GRzHk7FuMbluWQAdW5jGMygGTmqbqw6 lHxs1fXnlPgj0W/b1z5Y9azNYgOGCS6ejC2m1nOaIWqmx8RZBk+YY1rOGbVV4hxpcwKS Jy8i6cMj2IqVYm+IELciY5U16rHOdANBJRJ+FsUe3Krt9634a7H6B+ikz+6BPdfTdMCv hyY2/Pk7iJxzyVoNCxIWt0tiW2jdxW65+Zk9+P58YvatdINgz0Q+xRWDbJ8YRrN8JkOI nh9w== 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=ULAXFMFPtduGmjOwdum3DhvjWO6ndB/06KwMHWN8ulk=; b=p+6CnJPWfPjg0CsH6nYHa75HcvAXFE9ImipKUlWW9LMDRUSyAIA4jrYi8cggwy6nvk OT15RF1xhKvfaPmaYZHzy8jdQqgLHUJdxBCSyFlznibvn0d8sDAHPc9YEOdRfhwof8Qd S11LuxTtYdoMDmGzIoPapUFH7c3NhTNXsquI+j2FCgNDUQE20S4fMP23NJiLVwO2nzuq 5YuVM+GIsDSvdbVY1PXrJKfKMKGkoS8WZyEgjwwL48JOlX3Uzx++GhstSwCoU8orHzpL TF8ZSneoc+0kyXaO20NjRnOiQwQvqPGEM0+biIt/Jd88+WoKPrgi81PLI9FbLpIYysf6 fMRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-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 m26si12537592ejb.324.2019.11.05.01.42.11; Tue, 05 Nov 2019 01:42:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-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-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730757AbfKEJl4 (ORCPT + 99 others); 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