Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F135381057
D27801.id81266.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
D27801.id81266.diff
View Options
Index: usr.sbin/autofs/automount.c
===================================================================
--- usr.sbin/autofs/automount.c
+++ usr.sbin/autofs/automount.c
@@ -84,6 +84,30 @@
return (error);
}
+static int
+unmount_by_umount(struct statfs* sfp, bool force)
+{
+ FILE *f;
+ char fsid[sizeof(sfp->f_fsid)*2+1];
+ size_t i;
+
+ if (sfp->f_fsid.val[0] == 0 || sfp->f_fsid.val[1] == 0)
+ return (-1);
+
+ /* umount(8) expects the file system ID to be in hexadecimal format */
+ for (i = 0; i < sizeof(sfp->f_fsid); i++)
+ snprintf(fsid+strlen(fsid), sizeof(fsid) - strlen(fsid),
+ "%02x", ((u_char *)&sfp->f_fsid)[i]);
+
+ if (force)
+ f = auto_popen("umount", "-f", fsid, NULL);
+ else
+ f = auto_popen("umount", fsid, NULL);
+
+ assert(f != NULL);
+ return (auto_pclose(f));
+}
+
static const struct statfs *
find_statfs(const struct statfs *mntbuf, int nitems, const char *mountpoint)
{
@@ -304,7 +328,8 @@
continue;
}
- unmount_by_statfs(&(mntbuf[i]), force);
+ if (unmount_by_umount(&(mntbuf[i]), force) != 0)
+ unmount_by_statfs(&(mntbuf[i]), force);
}
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 10, 7:43 AM (6 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25081332
Default Alt Text
D27801.id81266.diff (1 KB)
Attached To
Mode
D27801: automount(8): try umount(8) before unmount(3)
Attached
Detach File
Event Timeline
Log In to Comment