summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1998-01-09 20:41:55 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1998-01-09 20:41:55 +0000
commit0d4b9057eae023631f224fbd6fd209246cc813f8 (patch)
tree5fe90f784f9bf05d9fe9d465c8fb4becbef18d8f /sys
parent603148636aa98e7bbc644c7cf99ada8f2fb1a5d3 (diff)
Similar race in Ext2FS
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ext2fs/ext2fs_vfsops.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/ufs/ext2fs/ext2fs_vfsops.c b/sys/ufs/ext2fs/ext2fs_vfsops.c
index 6324e7b99f1..2a6efb270c1 100644
--- a/sys/ufs/ext2fs/ext2fs_vfsops.c
+++ b/sys/ufs/ext2fs/ext2fs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_vfsops.c,v 1.7 1997/11/10 19:30:24 provos Exp $ */
+/* $OpenBSD: ext2fs_vfsops.c,v 1.8 1998/01/09 20:41:54 csapuntz Exp $ */
/* $NetBSD: ext2fs_vfsops.c,v 1.1 1997/06/11 09:34:07 bouyer Exp $ */
/*
@@ -850,6 +850,8 @@ ext2fs_vget(mp, ino, vpp)
ump = VFSTOUFS(mp);
dev = ump->um_dev;
+
+ retry:
if ((*vpp = ufs_ihashget(dev, ino)) != NULL)
return (0);
@@ -875,7 +877,16 @@ ext2fs_vget(mp, ino, vpp)
* for old data structures to be purged or for the contents of the
* disk portion of this inode to be read.
*/
- ufs_ihashins(ip);
+ error = ufs_ihashins(ip);
+
+ if (error) {
+ vrele(vp);
+
+ if (error == EEXIST)
+ goto retry;
+
+ return (error);
+ }
/* Read in the disk contents for the inode, copy into the inode. */
error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ino)),