summaryrefslogtreecommitdiff
path: root/sys/ufs/ffs
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2016-03-27 11:39:38 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2016-03-27 11:39:38 +0000
commitb84b61b7ae2a04b2bf8baf435e862aefad8358e9 (patch)
tree4a11186029a4164181c652e019bfcdb5e0c4e1ca /sys/ufs/ffs
parent3bec36070f359db69a5dbfe04ba988b93c7dc45c (diff)
When pulling and unmounting an umass USB stick, the file system
could end up in an inconsistent state. The fstype dependent mp->mnt_data was NULL, but the general mp was still listed as a valid mount point. Next access to the file system would crash with a NULL pointer dereference. If closing the device fails, the mount point must go away anyway. There is nothing we can do about it. Remove the workaround for the EIO error in the general unmount code, but do not generate any error in the file system specific unmount functions. OK natano@ beck@
Diffstat (limited to 'sys/ufs/ffs')
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 2b24d1d32cb..4fa6553689c 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_vfsops.c,v 1.154 2016/03/19 12:04:16 natano Exp $ */
+/* $OpenBSD: ffs_vfsops.c,v 1.155 2016/03/27 11:39:37 bluhm Exp $ */
/* $NetBSD: ffs_vfsops.c,v 1.19 1996/02/09 22:22:26 christos Exp $ */
/*
@@ -1027,15 +1027,15 @@ ffs_unmount(struct mount *mp, int mntflags, struct proc *p)
vn_lock(ump->um_devvp, LK_EXCLUSIVE | LK_RETRY, p);
vinvalbuf(ump->um_devvp, V_SAVE, NOCRED, p, 0, 0);
- error = VOP_CLOSE(ump->um_devvp, fs->fs_ronly ? FREAD : FREAD|FWRITE,
- NOCRED, p);
+ (void)VOP_CLOSE(ump->um_devvp, fs->fs_ronly ? FREAD : FREAD|FWRITE,
+ NOCRED, p);
vput(ump->um_devvp);
free(fs->fs_csp, M_UFSMNT, 0);
free(fs, M_UFSMNT, fs->fs_sbsize);
free(ump, M_UFSMNT, sizeof(*ump));
mp->mnt_data = NULL;
mp->mnt_flag &= ~MNT_LOCAL;
- return (error);
+ return (0);
}
/*