mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
xfs: truncate quota file correctly when repairing quota file
LOLLM noticed that xrep_quota_data_fork screws up the unit handling when
it computes the offset at which to start truncating the quota file.
max_dquid_off is the file block offset containing the highest possible
dquot, and xfs_bunmapi_range takes the starting file block offset.
Therefore, it makes no sense to multiply max_dquid_off by the blocksize;
all we need to do is start truncating at the next block.
Cc: stable@vger.kernel.org # v6.8
Fixes: a5b9155540 ("xfs: repair quotas")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Assisted-by: LOLLM # finding obvious bugs
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
parent
8c71ad4d4f
commit
0fc67528f5
|
|
@ -455,8 +455,7 @@ xrep_quota_data_fork(
|
|||
|
||||
if (truncate) {
|
||||
/* Erase everything after the block containing the max dquot */
|
||||
error = xfs_bunmapi_range(&sc->tp, sc->ip, 0,
|
||||
max_dqid_off * sc->mp->m_sb.sb_blocksize,
|
||||
error = xfs_bunmapi_range(&sc->tp, sc->ip, 0, max_dqid_off + 1,
|
||||
XFS_MAX_FILEOFF);
|
||||
if (error)
|
||||
goto out;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user