Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13476775ybl; Sun, 29 Dec 2019 12:50:28 -0800 (PST) X-Google-Smtp-Source: APXvYqxOYCX5t6wBdOcA1Uj/IW8X+mHAmfW5YPp5lNLFUlimsHOVxmo+YMTtxetIuoH7gO67vppu X-Received: by 2002:a9d:2c68:: with SMTP id f95mr71380047otb.33.1577652628085; Sun, 29 Dec 2019 12:50:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652628; cv=none; d=google.com; s=arc-20160816; b=FB6xP5WcdpL8pDWhlyZkknd4bd7h/gZGF0bdL02OZ1+iGIXSbami93jldTlfbYy1bk bXvJotDoY5iZKBV4UCMiPMnFMdlLbKXDMocg/kwvJVpuHuZbUh7pG9NpA7hKuUjXzwzf jmvYS5aOktp4WvaZjoxvvMSAAGNIWBYp0KSovgW99jjU+PvLwhxrW/i5qadnLXqiAr/Q mBxZvDjLhHTsnM0OHCAbvppDE+FtJl2pnFmaNrzzJyMkmGcFuMpX0O6LkEez/w++zAvj o8vGSJDLKOShlc1DqzaGmvwwZx4YjlXs75dNZrPL/yQF8O2WyY85wqQDjf5NPw4AOohx eihA== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Smk3rBa/KROgNoCJE+Nfe1xnRTNOtokAonrhrqJ5pVE=; b=t6z8sITNEf/+bjd2WfNETtlLKQttLbx91m0Im5xMcz/cz2pWPebsh6K6NXOs3Qsi+v VKM2CJhe54ZiIn3PahiL/Uvi+LbXBTZBNu+9edzdMPbRP5RQZQvu+RhRAyX9WP2Bi2t9 LraI1ouEbC8UTq1rLDQqcYWR+p4XfsYFw7bEMv5hzqpX6Y2iTyt4dHK8mTvGTH//QHrz ltNEZpGI2ZS/b+M8d/UTE8iFoavQhM78eB1jCf4Vk4r6ZaY1gUwaGKsGz1NHUV9ow78E eDBWuW7x4bl7TobSA6bJv9OAPH2FwHTa6RfGxsq7ke5FC4pOB8VXGcqqUmBNgp2IfZ+j i60g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="yr/Np4Zt"; 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 j18si22399004otq.275.2019.12.29.12.50.17; Sun, 29 Dec 2019 12:50:28 -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; dkim=pass header.i=@kernel.org header.s=default header.b="yr/Np4Zt"; 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 S2387436AbfL2R55 (ORCPT + 99 others); Sun, 29 Dec 2019 12:57:57 -0500 Received: from mail.kernel.org ([198.145.29.99]:48750 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732946AbfL2R5x (ORCPT ); Sun, 29 Dec 2019 12:57:53 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CCE35206DB; Sun, 29 Dec 2019 17:57:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577642273; bh=i6RWq8MAUqRQwT6Hv4u28DExcfMhvAHzQe96GrJ3VB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yr/Np4Zt+bL/8tUuPv/YxpCa8ztV+p4S+9aPH2V2gajjLr9oH4Y1k/BdB1ZlczdDv sdHsH9ebep9w1OJo5DAndI8URa4uEfJx5DshZIKtsVvsiudUIVpz8BZUdB/tJSY2dk qami01Ef4zJdxNeiyfo0TLXCd4InGeoAd0PBlnUE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Theodore Tso , stable@kernel.org Subject: [PATCH 5.4 412/434] ext4: unlock on error in ext4_expand_extra_isize() Date: Sun, 29 Dec 2019 18:27:45 +0100 Message-Id: <20191229172730.122152887@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dan Carpenter commit 7f420d64a08c1dcd65b27be82a27cf2bdb2e7847 upstream. We need to unlock the xattr before returning on this error path. Cc: stable@kernel.org # 4.13 Fixes: c03b45b853f5 ("ext4, project: expand inode extra size if possible") Signed-off-by: Dan Carpenter Link: https://lore.kernel.org/r/20191213185010.6k7yl2tck3wlsdkt@kili.mountain Signed-off-by: Theodore Ts'o Signed-off-by: Greg Kroah-Hartman --- fs/ext4/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -6035,7 +6035,7 @@ int ext4_expand_extra_isize(struct inode error = ext4_journal_get_write_access(handle, iloc->bh); if (error) { brelse(iloc->bh); - goto out_stop; + goto out_unlock; } error = __ext4_expand_extra_isize(inode, new_extra_isize, iloc, @@ -6045,8 +6045,8 @@ int ext4_expand_extra_isize(struct inode if (!error) error = rc; +out_unlock: ext4_write_unlock_xattr(inode, &no_expand); -out_stop: ext4_journal_stop(handle); return error; }