diff options
author | Otto Moerbeek <otto@cvs.openbsd.org> | 2010-03-08 11:19:05 +0000 |
---|---|---|
committer | Otto Moerbeek <otto@cvs.openbsd.org> | 2010-03-08 11:19:05 +0000 |
commit | 32bbf947f33708215506e776902dcc604be24f03 (patch) | |
tree | 21c6d33b839bb5fe40a37379302bf5cb32b40242 /sbin/fsck_ext2fs | |
parent | 5c5b099904f76093358cea153a527b0111411953 (diff) |
if ncg == 1, there's no alternate superblock; from NetBSD; ok deraadt@
Diffstat (limited to 'sbin/fsck_ext2fs')
-rw-r--r-- | sbin/fsck_ext2fs/setup.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sbin/fsck_ext2fs/setup.c b/sbin/fsck_ext2fs/setup.c index 06cc0dbdc82..febaf3fb99d 100644 --- a/sbin/fsck_ext2fs/setup.c +++ b/sbin/fsck_ext2fs/setup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: setup.c,v 1.15 2007/09/02 15:19:23 deraadt Exp $ */ +/* $OpenBSD: setup.c,v 1.16 2010/03/08 11:19:04 otto Exp $ */ /* $NetBSD: setup.c,v 1.1 1997/06/11 11:22:01 bouyer Exp $ */ /* @@ -297,6 +297,12 @@ readsb(int listerr) dev_bsize = sblock.e2fs_bsize / fsbtodb(&sblock, 1); sblk.b_bno = super / dev_bsize; + if (sblock.e2fs_ncg == 1) { + /* no alternate superblock; assume it's okey */ + havesb = 1; + return 1; + } + getblk(&asblk, 1 * sblock.e2fs.e2fs_bpg + sblock.e2fs.e2fs_first_dblock, (long)SBSIZE); if (asblk.b_errs) |