From eb5b0bc42e2bd9517ce418b62a95f540f6625dce Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Fri, 18 Oct 2002 21:41:41 +0000 Subject: 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 MFC after: 3 days --- sys/gnu/ext2fs/ext2_lookup.c | 2 +- sys/gnu/fs/ext2fs/ext2_lookup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/gnu') diff --git a/sys/gnu/ext2fs/ext2_lookup.c b/sys/gnu/ext2fs/ext2_lookup.c index bddc3bbfa084d..49caccfb8684f 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 bddc3bbfa084d..49caccfb8684f 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. -- cgit v1.3