Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp316961ybx; Mon, 4 Nov 2019 20:52:07 -0800 (PST) X-Google-Smtp-Source: APXvYqykTKD7i/C0WjjkSQW0leh0p65GZ+H4DhqOtcA4EkwWOjbC0mcA6dDQCPyvGQJFHCOWTY6A X-Received: by 2002:a17:906:e0d5:: with SMTP id gl21mr11860554ejb.292.1572929527760; Mon, 04 Nov 2019 20:52:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1572929527; cv=pass; d=google.com; s=arc-20160816; b=zkDyQeiMfi858E5bA0Qru8Hwk/HNmK4K/Tp7LYE16hPMzrUxSR7jnktQyxe9UaM94E n4mDvNr+K1Z5kTYnITkS64m/DXzpoYGLqrnVZbQb2hAaG+jGl7oguIY0mHFh/2Tnn4YL 7oOaMADygL/Z1Q2DgvjzMGl7TQONp3Hm+dHUx0/lJMFcLH4tLUJY/IwGVnJjqPFz//e2 LJBePxKt8t3oNMz/CysRaXCVJMJyFB9KILKlDaGfXm7F4wzCIw1LCiPazdasgj8Ocxy+ hIP+TLvtF8w5dTJYqKQo3ydCdTktYao0io/e4aPMWOwVmb83niK5r+QCZMlqh6KzT0Kc TGeQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :date:subject:message-id:cc:to:from:dkim-signature; bh=brSRdP5KFqpuH2p9tNPrplZ6xACWkA+oRDVfhtlVNZY=; b=dCJslVykNUnljUp6OYQAbWA9jllXenz9bbBIOxEs6VE8QdzG+DmTLMnI8ggW3b4MNP fLpr9VutChONgwYinfMh1iiyHH61ms5xEOGctBNrIpzYuDFje4fYH5JlQ6SDLyRlgKGH XCeLLVKOl11rtL0uWjcL9fMXSoXp+drZkP9OwLv44KGgQu5yZwKmh5z/OnEnw11WfPEz bQsbZk8dLCABQ2tMEiwGk0edkvNe4O0aNC3Wjk1E1VxpB0VZb4/DTuC40gioZoQ/Nqr0 DSfDx4wmZ3h/cK3CvqM4EUqu4W1ih7LYpEc3XCKQ8jTkv+vOyx2UvZdDwWV6ygoUZCiE dOIg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mykernel.net header.s=zohomail header.b="Y7B/FOMP"; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); 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 c25si361986eja.24.2019.11.04.20.51.30; Mon, 04 Nov 2019 20:52:07 -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; dkim=pass header.i=@mykernel.net header.s=zohomail header.b="Y7B/FOMP"; arc=pass (i=1 spf=pass spfdomain=mykernel.net dkim=pass dkdomain=mykernel.net dmarc=pass fromdomain=mykernel.net>); 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 S2387399AbfKEEv2 (ORCPT + 99 others); Mon, 4 Nov 2019 23:51:28 -0500 Received: from sender3-of-o52.zoho.com.cn ([124.251.121.247]:21971 "EHLO sender2.zoho.com.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730176AbfKEEv2 (ORCPT ); Mon, 4 Nov 2019 23:51:28 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1572929466; cv=none; d=zoho.com.cn; s=zohoarc; b=DomkhDhM1XEEd/23OBghWc0u5sSw8AhGw6paheV8CXyfRVt+PtJW7smnffptR3OXKZjKGlTta1AusCFUu7B8kkOZSnXmKbl9dVsaDW5Siu21EiHmDwS413vv7EN6kvwCQ2l8Sa+dX/Bl0xxbiNrck5kXScO4m1j8LLS8DWtntBM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1572929466; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=brSRdP5KFqpuH2p9tNPrplZ6xACWkA+oRDVfhtlVNZY=; b=DzvJOETp/hRwhcF9K4RFv+1s87+xHCGlaCsoHzuLcuJOZoVIgakC7JjbAzx0ogyoD9A4LdY0XlNRYXJF5ZCizfiQAscmATAG29rjXJCfTszGcQ+/Ogb7KfNAlnkP8vufQcYnNP52ZHHuDPH8z2McjKvdQ3OFF1NiAg1Erus+uBk= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=mykernel.net; spf=pass smtp.mailfrom=cgxu519@mykernel.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1572929466; s=zohomail; d=mykernel.net; i=cgxu519@mykernel.net; h=From:To:Cc:Message-ID:Subject:Date:MIME-Version:Content-Transfer-Encoding:Content-Type; l=788; bh=brSRdP5KFqpuH2p9tNPrplZ6xACWkA+oRDVfhtlVNZY=; b=Y7B/FOMPO4INjTM96XZGaYcWKBzXzsfuu2XsauUqlPoWwt5fdoDlpODkO5FocbkC +I7Q7DrtPL6iuMHbdCkJh6KgSukiuyvKeGtwk8JudTlbcsSPcoMZwZufmjkCsh/vxPJ TOxWogqnOcIOPOAWR0ULKIB6D6XPCYnnrb37NrV0= Received: from localhost.localdomain (218.18.229.179 [218.18.229.179]) by mx.zoho.com.cn with SMTPS id 1572929464784774.4755415872704; Tue, 5 Nov 2019 12:51:04 +0800 (CST) From: Chengguang Xu To: jack@suse.com Cc: linux-ext4@vger.kernel.org, Chengguang Xu Message-ID: <20191105045100.7104-1-cgxu519@mykernel.net> Subject: [PATCH] ext2: check err when partial != NULL Date: Tue, 5 Nov 2019 12:51:00 +0800 X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoCNMailClient: External Content-Type: text/plain; charset=utf8 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Check err when partial =3D=3D NULL is meaningless because partial =3D=3D NULL means getting branch successfully without error. Signed-off-by: Chengguang Xu --- 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, =09=09if (!partial) { =09=09=09count++; =09=09=09mutex_unlock(&ei->truncate_mutex); -=09=09=09if (err) -=09=09=09=09goto cleanup; =09=09=09goto got_it; =09=09} + +=09=09if (err) { +=09=09=09mutex_unlock(&ei->truncate_mutex); +=09=09=09goto cleanup; +=09=09} =09} =20 =09/* --=20 2.20.1