linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhang Yi <yi.zhang@huawei.com>
To: <linux-fsdevel@vger.kernel.org>
Cc: <jack@suse.cz>, <yi.zhang@huawei.com>, <yukuai3@huawei.com>
Subject: [PATCH 2/2] qupta: correct error number in free_dqentry()
Date: Fri, 8 Oct 2021 17:38:21 +0800	[thread overview]
Message-ID: <20211008093821.1001186-3-yi.zhang@huawei.com> (raw)
In-Reply-To: <20211008093821.1001186-1-yi.zhang@huawei.com>

Fix the error path in free_dqentry(), pass out the error number if the
freeing block is not correct.

Fixes: 1ccd14b9c271c ("quota: Split off quota tree handling into a separate file")
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Cc: stable@kernel.org
---
 fs/quota/quota_tree.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/quota/quota_tree.c b/fs/quota/quota_tree.c
index 583b7f7715f9..5f2405994280 100644
--- a/fs/quota/quota_tree.c
+++ b/fs/quota/quota_tree.c
@@ -414,6 +414,7 @@ static int free_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot,
 		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);
-- 
2.31.1


  parent reply	other threads:[~2021-10-08  9:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08  9:38 [PATCH 0/2] quota: fix oops when loading corrupted quota file Zhang Yi
2021-10-08  9:38 ` [PATCH 1/2] quota: check block number when reading the block in " Zhang Yi
2021-10-08  9:38 ` Zhang Yi [this message]
2021-10-11  8:58 ` [PATCH 0/2] quota: fix oops when loading corrupted " Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211008093821.1001186-3-yi.zhang@huawei.com \
    --to=yi.zhang@huawei.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).