Whamcloud - gitweb
tune2fs: Fix conversion of quota files
authorJan Kara <jack@suse.cz>
Mon, 23 Aug 2021 15:41:24 +0000 (17:41 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 3 Sep 2021 18:34:58 +0000 (14:34 -0400)
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>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
misc/tune2fs.c

index f459d5d..7f023ad 100644 (file)
@@ -1679,7 +1679,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)"),