diff options
author | bde <bde@FreeBSD.org> | 2002-10-18 21:41:41 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2002-10-18 21:41:41 +0000 |
commit | 1bac0e0b4c757dd560b18b70ad1a3a28028cf233 (patch) | |
tree | 8227525e1ae65cb6b5ed3cc9e55ec0a3247fa95c | |
parent | b9279f6877f2b6973359a4c2620abacf9fe78d21 (diff) | |
download | FreeBSD-src-1bac0e0b4c757dd560b18b70ad1a3a28028cf233.zip FreeBSD-src-1bac0e0b4c757dd560b18b70ad1a3a28028cf233.tar.gz |
MFufs 1.33:
In the 'found' case for ext2_lookup() the underlying bp's data was
being accessed after the bp had been releaed. A simple move of the
brelse() solves the problem.
The PR reports that this caused panics running the GDB testsuite unless
NO_GEOM is configured.
PR: 44060
Reported by: Mark Kettenis <kettenis@chello.nl>
MFC after: 3 days
-rw-r--r-- | sys/gnu/ext2fs/ext2_lookup.c | 2 | ||||
-rw-r--r-- | sys/gnu/fs/ext2fs/ext2_lookup.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/gnu/ext2fs/ext2_lookup.c b/sys/gnu/ext2fs/ext2_lookup.c index bddc3bb..49caccf 100644 --- a/sys/gnu/ext2fs/ext2_lookup.c +++ b/sys/gnu/ext2fs/ext2_lookup.c @@ -474,7 +474,6 @@ searchloop: */ dp->i_ino = ep->inode; dp->i_reclen = ep->rec_len; - brelse(bp); goto found; } } @@ -569,6 +568,7 @@ found: dp->i_size = entryoffsetinblock+EXT2_DIR_REC_LEN(ep->name_len); dp->i_flag |= IN_CHANGE | IN_UPDATE; } + brelse(bp); /* * Found component in pathname. diff --git a/sys/gnu/fs/ext2fs/ext2_lookup.c b/sys/gnu/fs/ext2fs/ext2_lookup.c index bddc3bb..49caccf 100644 --- a/sys/gnu/fs/ext2fs/ext2_lookup.c +++ b/sys/gnu/fs/ext2fs/ext2_lookup.c @@ -474,7 +474,6 @@ searchloop: */ dp->i_ino = ep->inode; dp->i_reclen = ep->rec_len; - brelse(bp); goto found; } } @@ -569,6 +568,7 @@ found: dp->i_size = entryoffsetinblock+EXT2_DIR_REC_LEN(ep->name_len); dp->i_flag |= IN_CHANGE | IN_UPDATE; } + brelse(bp); /* * Found component in pathname. |