summaryrefslogtreecommitdiffstats
path: root/sbin/growfs
diff options
context:
space:
mode:
authorle <le@FreeBSD.org>2004-03-26 23:42:32 +0000
committerle <le@FreeBSD.org>2004-03-26 23:42:32 +0000
commit8deb46de83baeba91d59eda98ba8cb9c8b0e40db (patch)
treea0be129977b52082315a3014962f083f53f00604 /sbin/growfs
parent3e9f33ddfa8ae2d049f8e827244fdb7ee5f13790 (diff)
downloadFreeBSD-src-8deb46de83baeba91d59eda98ba8cb9c8b0e40db.zip
FreeBSD-src-8deb46de83baeba91d59eda98ba8cb9c8b0e40db.tar.gz
Don't read an inode which isn't used to avoid problems on UFS2 where not
all inodes are initialized when running newfs. Approved by: grog (mentor)
Diffstat (limited to 'sbin/growfs')
-rw-r--r--sbin/growfs/growfs.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sbin/growfs/growfs.c b/sbin/growfs/growfs.c
index bfd4088..04257f3 100644
--- a/sbin/growfs/growfs.c
+++ b/sbin/growfs/growfs.c
@@ -1836,6 +1836,10 @@ ginode(ino_t inumber, int fsi, int cg)
DBG_ENTER;
inumber += (cg * sblock.fs_ipg);
+ if (isclr(cg_inosused(&aocg), inumber)) {
+ DBG_LEAVE;
+ return NULL;
+ }
if (inumber < ROOTINO || inumber > maxino)
errx(8, "bad inode number %d to ginode", inumber);
if (startinum == 0 ||
@@ -2374,6 +2378,10 @@ updrefs(int cg, ino_t in, struct gfs_bpp *bp, int fsi, int fso, unsigned int
* here by using the bitmap.
*/
ino = ginode(in, fsi, cg);
+ if (ino == NULL) {
+ DBG_LEAVE;
+ return;
+ }
mode = DIP(ino, di_mode) & IFMT;
if (mode != IFDIR && mode != IFREG && mode != IFLNK) {
DBG_LEAVE;
OpenPOWER on IntegriCloud