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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C68F8C43217 for ; Wed, 24 Nov 2021 12:32:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244666AbhKXMfJ (ORCPT ); Wed, 24 Nov 2021 07:35:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:51664 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245689AbhKXMbW (ORCPT ); Wed, 24 Nov 2021 07:31:22 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id CDE0261164; Wed, 24 Nov 2021 12:19:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637756375; bh=fKBZ8UgLuP8nM0/2CUs62qmfFwcH+GDa/HbJimkmt64=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eRt6wkW1df+Vxl+SlOziWaSWPfujLgqVycfgsY+5sBf5fuGkCQy2IWSGV4VfEfGK7 oquj7E1s+WWfpFSxTDvqx+wzripibazJr1Jqu3drL18GulUOmU5KvO/S2UZyIQ137x P5QIGmSJa7UwsUEji1g+noq/HAoT+4U997XMYLnE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhang Yi , stable@kernel.org, Jan Kara Subject: [PATCH 4.14 063/251] quota: correct error number in free_dqentry() Date: Wed, 24 Nov 2021 12:55:05 +0100 Message-Id: <20211124115712.434032825@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115710.214900256@linuxfoundation.org> References: <20211124115710.214900256@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: stable@vger.kernel.org From: Zhang Yi commit d0e36a62bd4c60c09acc40e06ba4831a4d0bc75b upstream. Fix the error path in free_dqentry(), pass out the error number if the block to free is not correct. Fixes: 1ccd14b9c271 ("quota: Split off quota tree handling into a separate file") Link: https://lore.kernel.org/r/20211008093821.1001186-3-yi.zhang@huawei.com Signed-off-by: Zhang Yi Cc: stable@kernel.org Signed-off-by: Jan Kara Signed-off-by: Greg Kroah-Hartman --- fs/quota/quota_tree.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/quota/quota_tree.c +++ b/fs/quota/quota_tree.c @@ -422,6 +422,7 @@ static int free_dqentry(struct qtree_mem quota_error(dquot->dq_sb, "Quota structure has offset to " "other block (%u) than it should (%u)", blk, (uint)(dquot->dq_off >> info->dqi_blocksize_bits)); + ret = -EIO; goto out_buf; } ret = read_blk(info, blk, buf);