diff options
author | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-03-27 11:39:38 +0000 |
---|---|---|
committer | Alexander Bluhm <bluhm@cvs.openbsd.org> | 2016-03-27 11:39:38 +0000 |
commit | b84b61b7ae2a04b2bf8baf435e862aefad8358e9 (patch) | |
tree | 4a11186029a4164181c652e019bfcdb5e0c4e1ca /sys/msdosfs/msdosfs_vfsops.c | |
parent | 3bec36070f359db69a5dbfe04ba988b93c7dc45c (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/msdosfs/msdosfs_vfsops.c')
-rw-r--r-- | sys/msdosfs/msdosfs_vfsops.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/msdosfs/msdosfs_vfsops.c b/sys/msdosfs/msdosfs_vfsops.c index 4edf1875cd6..a6d60f52b9c 100644 --- a/sys/msdosfs/msdosfs_vfsops.c +++ b/sys/msdosfs/msdosfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_vfsops.c,v 1.75 2016/03/19 12:04:16 natano Exp $ */ +/* $OpenBSD: msdosfs_vfsops.c,v 1.76 2016/03/27 11:39:37 bluhm Exp $ */ /* $NetBSD: msdosfs_vfsops.c,v 1.48 1997/10/18 02:54:57 briggs Exp $ */ /*- @@ -626,14 +626,14 @@ msdosfs_unmount(struct mount *mp, int mntflags,struct proc *p) vprint("msdosfs_umount(): just before calling VOP_CLOSE()\n", vp); #endif vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, p); - error = VOP_CLOSE(vp, - pmp->pm_flags & MSDOSFSMNT_RONLY ? FREAD : FREAD|FWRITE, NOCRED, p); + (void)VOP_CLOSE(vp, + pmp->pm_flags & MSDOSFSMNT_RONLY ? FREAD : FREAD|FWRITE, NOCRED, p); vput(vp); free(pmp->pm_inusemap, M_MSDOSFSFAT, 0); free(pmp, M_MSDOSFSMNT, 0); mp->mnt_data = NULL; mp->mnt_flag &= ~MNT_LOCAL; - return (error); + return (0); } int |