From 1c65a0eaa3ec2f389512d4dc23dc8b60badc229e Mon Sep 17 00:00:00 2001 From: Yingping Lu Date: Wed, 28 Sep 2005 18:53:35 +0000 Subject: [PATCH] Fix segmentation fault due to allocation size Change version --- VERSION | 2 +- doc/CHANGES | 8 ++++++-- repair/incore.c | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/VERSION b/VERSION index e0934a643..c34c4e5c0 100644 --- a/VERSION +++ b/VERSION @@ -3,5 +3,5 @@ # PKG_MAJOR=2 PKG_MINOR=7 -PKG_REVISION=1 +PKG_REVISION=2 PKG_BUILD=1 diff --git a/doc/CHANGES b/doc/CHANGES index 57c6b59e2..ff7002457 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,10 +1,14 @@ -xfsprogs-2.7.1 (20 Septempber 2005) +xfsprogs-2.7.2 (28 September 2005) + - Fix up xfs_repair segmentation fault due to wrong allocation + size. + +xfsprogs-2.7.1 (20 September 2005) - Fix up reporting of devices in xfs_growfs - now uses /proc/mounts in preference to /etc/mtab. - Fix a strtok-related bug in the extraction of device names, also only affecting xfs_growfs. -xfsprogs-2.7.0 (16 Septempber 2005) +xfsprogs-2.7.0 (16 September 2005) - Support for updated extended attributes format (attr2) - Make xfs_quota tool issue a quota sync in all the needed places, before reporting, to counter affects of delayed diff --git a/repair/incore.c b/repair/incore.c index 8a2a20bbe..09eb1a4a9 100644 --- a/repair/incore.c +++ b/repair/incore.c @@ -79,7 +79,8 @@ setup_bmap(xfs_agnumber_t agno, xfs_agblock_t numblocks, xfs_drtbno_t rtblocks) return; } for (i = 0; i < agno; i++) { - size = roundup(numblocks / (NBBY/XR_BB),sizeof(__uint64_t)); + size = roundup((numblocks+(NBBY/XR_BB)-1) / (NBBY/XR_BB), + sizeof(__uint64_t)); ba_bmap[i] = (__uint64_t*)memalign(sizeof(__uint64_t), size); if (!ba_bmap[i]) { -- 2.47.2