From 8ebd072285708c43b9b157f50ca831d345b9456b Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 15 May 2003 04:10:01 +0000 Subject: [PATCH] Fix a large sector size issue in xfs_repair. --- doc/CHANGES | 3 ++- libxfs/init.c | 2 +- repair/sb.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/doc/CHANGES b/doc/CHANGES index b2b672f8f..f45688b7a 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -5,7 +5,8 @@ xfsprogs-2.4.10 (12 May 2003) because xfs_repair uses the correct stripe unit value. - Fix a bug in xfs_logprint, when dumping a corrupt log. - FreeBSD updates from Alexander Kabaev. - - Sector size updates for mkfs (disabled at the moment). + - Large sector size updates for mkfs (disabled at the moment). + - Large sector size fixes for xfs_repair. - Sync up with aeb's mount source for filesystem detection. xfsprogs-2.4.9 (03 May 2003) diff --git a/libxfs/init.c b/libxfs/init.c index e5ffd11a0..8ac8ad670 100644 --- a/libxfs/init.c +++ b/libxfs/init.c @@ -660,7 +660,7 @@ libxfs_mount( /* Allocate and initialize the per-ag data */ size = sbp->sb_agcount * sizeof(xfs_perag_t); - if ((mp->m_perag = calloc(size, 1)) == NULL) { + if (size && (mp->m_perag = calloc(size, 1)) == NULL) { fprintf(stderr, _("%s: failed to alloc %ld bytes: %s\n"), progname, (long)size, strerror(errno)); exit(1); diff --git a/repair/sb.c b/repair/sb.c index 798876fc7..de7fc50b1 100644 --- a/repair/sb.c +++ b/repair/sb.c @@ -157,7 +157,7 @@ find_secondary_sb(xfs_sb_t *rsb) * found one. now verify it by looking * for other secondaries. */ - bcopy(&bufsb, rsb, bufsb.sb_sectsize); + bcopy(&bufsb, rsb, sizeof(xfs_sb_t)); rsb->sb_inprogress = 0; clear_sunit = 1; -- 2.39.5