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/ntfs | |
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/ntfs')
-rw-r--r-- | sys/ntfs/ntfs_vfsops.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/sys/ntfs/ntfs_vfsops.c b/sys/ntfs/ntfs_vfsops.c index e3971e950bb..59b9128bc97 100644 --- a/sys/ntfs/ntfs_vfsops.c +++ b/sys/ntfs/ntfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs_vfsops.c,v 1.48 2016/03/19 12:04:16 natano Exp $ */ +/* $OpenBSD: ntfs_vfsops.c,v 1.49 2016/03/27 11:39:37 bluhm Exp $ */ /* $NetBSD: ntfs_vfsops.c,v 1.7 2003/04/24 07:50:19 christos Exp $ */ /*- @@ -522,10 +522,8 @@ ntfs_unmount(struct mount *mp, int mntflags, struct proc *p) /* lock the device vnode before calling VOP_CLOSE() */ VOP_LOCK(ntmp->ntm_devvp, LK_EXCLUSIVE | LK_RETRY, p); vinvalbuf(ntmp->ntm_devvp, V_SAVE, NOCRED, p, 0, 0); - - error = VOP_CLOSE(ntmp->ntm_devvp, ronly ? FREAD : FREAD|FWRITE, - NOCRED, p); - + (void)VOP_CLOSE(ntmp->ntm_devvp, ronly ? FREAD : FREAD|FWRITE, + NOCRED, p); vput(ntmp->ntm_devvp); /* free the toupper table, if this has been last mounted ntfs volume */ @@ -536,7 +534,7 @@ ntfs_unmount(struct mount *mp, int mntflags, struct proc *p) free(ntmp, M_NTFSMNT, 0); mp->mnt_data = NULL; mp->mnt_flag &= ~MNT_LOCAL; - return (error); + return (0); } int |