From: Jan Kara Date: Mon, 23 Aug 2021 15:41:24 +0000 (+0200) Subject: tune2fs: Fix conversion of quota files X-Git-Tag: v1.46.5~26 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d9612de393bd5ac13ff61fba4a5c576c455fbadb;p=tools%2Fe2fsprogs.git tune2fs: Fix conversion of quota files 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 Signed-off-by: Theodore Ts'o --- diff --git a/misc/tune2fs.c b/misc/tune2fs.c index f459d5d..7f023ad 100644 --- a/misc/tune2fs.c +++ b/misc/tune2fs.c @@ -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)"),