linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Ted Tso <tytso@mit.edu>
Cc: <linux-ext4@vger.kernel.org>, Jan Kara <jack@suse.cz>
Subject: [PATCH 4/8] tune2fs: Fix conversion of quota files
Date: Mon, 23 Aug 2021 17:41:24 +0200	[thread overview]
Message-ID: <20210823154128.16615-5-jack@suse.cz> (raw)
In-Reply-To: <20210823154128.16615-1-jack@suse.cz>

When tune2fs is enabling quota feature, it looks for old-style quota
files and tries to transfer limits stored in these files into newly
created hidded quota files. However the code doing the transfer setups
the quota scan wrongly and instead of transferring limits we transfer
usage. So not only quota limits are lost (at least they can still be
recovered from the old quota files) but also usage information may be
wrong if the accounting in e2fsprogs does not exactly match the
accounting in quota-tools (which is actually the case). Fix the setup of
the quota scan.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 misc/tune2fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/tune2fs.c b/misc/tune2fs.c
index bb08f8026918..0f6ef3d6df6b 100644
--- a/misc/tune2fs.c
+++ b/misc/tune2fs.c
@@ -1673,7 +1673,7 @@ static int handle_quota_options(ext2_filsys fs)
 			if ((qf_ino = quota_file_exists(fs, qtype)) > 0) {
 				retval = quota_read_all_dquots(qctx, qf_ino,
 							       qtype,
-							       QREAD_USAGE);
+							       QREAD_LIMITS);
 				if (retval) {
 					com_err(program_name, retval,
 						_("while updating quota limits (%d)"),
-- 
2.26.2


  parent reply	other threads:[~2021-08-23 15:41 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-23 15:41 [PATCH 0/8 v2] Quota fixes for e2fsprogs Jan Kara
2021-08-23 15:41 ` [PATCH 1/8] quota: Add support to version 0 quota format Jan Kara
2021-09-30 17:32   ` Theodore Ts'o
2021-08-23 15:41 ` [PATCH 2/8] quota: Fold quota_read_all_dquots() into quota_update_limits() Jan Kara
2021-08-23 15:41 ` [PATCH 3/8] quota: Rename quota_update_limits() to quota_read_all_dquots() Jan Kara
2021-08-23 15:41 ` Jan Kara [this message]
2021-08-23 15:41 ` [PATCH 5/8] e2fsck: Do not trash user limits when processing orphan list Jan Kara
2021-08-23 15:41 ` [PATCH 6/8] tests: Expand test checking quota and orphan processing interaction Jan Kara
2021-08-23 15:41 ` [PATCH 7/8] debugfs: Fix headers for quota commands Jan Kara
2021-08-23 15:41 ` [PATCH 8/8] quota: Drop dead code Jan Kara
2021-09-15  9:30 ` [PATCH 0/8 v2] Quota fixes for e2fsprogs 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=20210823154128.16615-5-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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).