Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151636549
D12366.id33061.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D12366.id33061.diff
View Options
Index: sys/kern/vfs_mount.c
===================================================================
--- sys/kern/vfs_mount.c
+++ sys/kern/vfs_mount.c
@@ -1365,21 +1365,14 @@
cache_purgevfs(mp, false); /* remove cache entries for this file sys */
vfs_deallocate_syncvnode(mp);
/*
- * For forced unmounts, move process cdir/rdir refs on the fs root
- * vnode to the covered vnode. For non-forced unmounts we want
- * such references to cause an EBUSY error.
+ * Record a root vnode of the unmounted filesystem for the subsequent
+ * rootvnode check. We do not add a new reference here as rootvnode
+ * should already be referenced.
*/
- if ((flags & MNT_FORCE) &&
- VFS_ROOT(mp, LK_EXCLUSIVE, &fsrootvp) == 0) {
- if (mp->mnt_vnodecovered != NULL &&
- (mp->mnt_flag & MNT_IGNORE) == 0)
- mountcheckdirs(fsrootvp, mp->mnt_vnodecovered);
- if (fsrootvp == rootvnode) {
- vrele(rootvnode);
- rootvnode = NULL;
- }
+ if ((flags & MNT_FORCE) && VFS_ROOT(mp, LK_EXCLUSIVE, &fsrootvp) == 0)
vput(fsrootvp);
- }
+ else
+ fsrootvp = NULL;
if ((mp->mnt_flag & MNT_RDONLY) != 0 || (flags & MNT_FORCE) != 0 ||
(error = VFS_SYNC(mp, MNT_WAIT)) == 0)
error = VFS_UNMOUNT(mp, flags);
@@ -1391,17 +1384,6 @@
* it doesn't exist anymore.
*/
if (error && error != ENXIO) {
- if ((flags & MNT_FORCE) &&
- VFS_ROOT(mp, LK_EXCLUSIVE, &fsrootvp) == 0) {
- if (mp->mnt_vnodecovered != NULL &&
- (mp->mnt_flag & MNT_IGNORE) == 0)
- mountcheckdirs(mp->mnt_vnodecovered, fsrootvp);
- if (rootvnode == NULL) {
- rootvnode = fsrootvp;
- vref(rootvnode);
- }
- vput(fsrootvp);
- }
MNT_ILOCK(mp);
mp->mnt_kern_flag &= ~MNTK_NOINSMNTQ;
if ((mp->mnt_flag & MNT_RDONLY) == 0) {
@@ -1432,6 +1414,10 @@
VOP_UNLOCK(coveredvp, 0);
}
vfs_event_signal(NULL, VQ_UNMOUNT, 0);
+ if (fsrootvp == rootvnode && rootvnode != NULL) {
+ vrele(rootvnode);
+ rootvnode = NULL;
+ }
if (mp == rootdevmp)
rootdevmp = NULL;
vfs_mount_destroy(mp);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 10, 4:32 PM (6 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31208982
Default Alt Text
D12366.id33061.diff (1 KB)
Attached To
Mode
D12366: remove process and jail directory machinations from dounmount
Attached
Detach File
Event Timeline
Log In to Comment