Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3850941pxb; Tue, 17 Nov 2020 05:22:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxtaL/qEWA0aIYcFpFEOjJr+hLuyfmJ1mgdQ/1bFiDLx0JKLsv4LwYmQv2N5Dy/8RREVlgy X-Received: by 2002:aa7:d599:: with SMTP id r25mr19676180edq.280.1605619375811; Tue, 17 Nov 2020 05:22:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605619375; cv=none; d=google.com; s=arc-20160816; b=lPjHsFBc6UgzueDH7sImvYxAMnZSL3pj1jNUYUjN2NmwfIs00m+xapqpCEf411gHnA 3bmBqZmx3hTy8/RSLpp+zENPnYq8oo7FY1uVQIBHM13HNF5LidsMXIs4eMjV9gVRkvmB 0aSUbWwylRjaCMWoLYqfxbV8wuWDOKtTDYhBkS9+VXDc12WIy9w07OTZtGs2XSAbRHzT LavVhXmO5PENnzXnOyKJ8TVIa+l3jrqmyvHsQW6vnijca26ycq64SsAT8hd9TeXQcdCX 0fwg+dyWDHIAFpeeyuvwCqfTfwYLCpez48I4mOKoPF9qgvhQYx0l/Pvmmft972azpMpf apCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zaXCimnSgDpydtDzJb5QgqaoiCviFRpAtcq3aC6RSBc=; b=G6ICZWPNOmHUqYW50EZwSp8gZ075SZz4UzY84wzPaKYpwFxZMBbuHIJ4rp00YnPfeS tm2SiQt1rJlnA2Kr5+Zb8TipMsXKNG9dWGRQQFtikcvYt2e/etKfpgAf/0wcJRHeojjT UbdvZrWn5YFdRDRMjn+98dv1+WTQhQyE1+cGyOnAGTVY2nnC4k8QARyQQWeO6Ndvu/Q0 z3oG7zeT8iyEcD0PJ/KYq8DdnblfU5AbAFAXVefpLS892FY6CXtlHJtZHtJCMEAzecqy I/V0fSsjbIT2om6yteBVyDoyKPd5IqKpryYsfiu1TYkuFn9gP1t11jVZmqHTvTb/TK4U 1W2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iAVvGPPn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bt10si14221192edb.503.2020.11.17.05.22.31; Tue, 17 Nov 2020 05:22:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iAVvGPPn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730519AbgKQNUW (ORCPT + 99 others); Tue, 17 Nov 2020 08:20:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:53482 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730485AbgKQNUL (ORCPT ); Tue, 17 Nov 2020 08:20:11 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 4DEB52225B; Tue, 17 Nov 2020 13:20:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619210; bh=Zml1+0xJweNFSjXiesLawigWZ/ZrC5pMb+efHl+zArI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iAVvGPPn4pkXJYyRzIY2R9K8W1ocIzYJHc/+dtT4qQL06DHcM/am47Vp/S24gVOXP PB7CLqh2W26yH8PnDGnoHagbyHZavUDy0kyKuMInAibz1tCZ+RfYldU4oosjc0LKIu xXgnUB7Zup1Jzx2WN5UzjhUFrWDSa494Zs4shqsA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Tao Ma , Joseph Qi , Andreas Dilger , Theodore Tso , stable@kernel.org Subject: [PATCH 4.19 064/101] ext4: unlock xattr_sem properly in ext4_inline_data_truncate() Date: Tue, 17 Nov 2020 14:05:31 +0100 Message-Id: <20201117122116.221184832@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122113.128215851@linuxfoundation.org> References: <20201117122113.128215851@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Joseph Qi commit 7067b2619017d51e71686ca9756b454de0e5826a upstream. It takes xattr_sem to check inline data again but without unlock it in case not have. So unlock it before return. Fixes: aef1c8513c1f ("ext4: let ext4_truncate handle inline data correctly") Reported-by: Dan Carpenter Cc: Tao Ma Signed-off-by: Joseph Qi Reviewed-by: Andreas Dilger Link: https://lore.kernel.org/r/1604370542-124630-1-git-send-email-joseph.qi@linux.alibaba.com Signed-off-by: Theodore Ts'o Cc: stable@kernel.org Signed-off-by: Greg Kroah-Hartman --- fs/ext4/inline.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -1921,6 +1921,7 @@ int ext4_inline_data_truncate(struct ino ext4_write_lock_xattr(inode, &no_expand); if (!ext4_has_inline_data(inode)) { + ext4_write_unlock_xattr(inode, &no_expand); *has_inline = 0; ext4_journal_stop(handle); return 0;