summaryrefslogtreecommitdiffstats
path: root/fs/xfs/scrub/quota.c
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@redhat.com>2017-11-28 03:23:33 +0100
committerDarrick J. Wong <darrick.wong@oracle.com>2017-11-28 17:57:11 +0100
commit712d361d59efa6349a9538f4fd9a49073f0e8127 (patch)
treeccf0021f560ed2c56c6d91b99f662c2792aa4445 /fs/xfs/scrub/quota.c
parentxfs: fix uninitialized variable in xfs_scrub_quota (diff)
downloadlinux-712d361d59efa6349a9538f4fd9a49073f0e8127.tar.xz
linux-712d361d59efa6349a9538f4fd9a49073f0e8127.zip
xfs: calculate correct offset in xfs_scrub_quota_item
It's only used for tracepoints so it's relatively harmless, but the offset is calculated incorrectly in xfs_scrub_quota_item. qi_dqperchunk is the nr. of dquots per "chunk" which we have conveniently *cough* defined to always be 1 FSB. Therefore block_offset * qi_dqperchunk == first id in that chunk, and so offset = id / qi_dqperchunk id * dqperchunk is ... meaningless. Fixes-coverity-id: 1423965 Fixes: c2fc338c ("xfs: scrub quota information") Signed-off-by: Eric Sandeen <sandeen@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/scrub/quota.c')
-rw-r--r--fs/xfs/scrub/quota.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xfs/scrub/quota.c b/fs/xfs/scrub/quota.c
index 613def9692a1..3d9037eceaf1 100644
--- a/fs/xfs/scrub/quota.c
+++ b/fs/xfs/scrub/quota.c
@@ -107,7 +107,7 @@ xfs_scrub_quota_item(
unsigned long long rcount;
xfs_ino_t fs_icount;
- offset = id * qi->qi_dqperchunk;
+ offset = id / qi->qi_dqperchunk;
/*
* We fed $id and DQNEXT into the xfs_qm_dqget call, which means