mirror of
https://github.com/freebsd/freebsd-src
synced 2024-07-21 10:19:04 +00:00
automount(8): when flushing autofs, specify fsid
Which should avoid situation where flushed filesystem is not autofs, because it was mounted over autofs mp. Reported and tested by: Andrew "RhodiumToad" Gierth <andrew@tao11.riddles.org.uk> PR: 272446 Reviewed by: mjg Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D42023
This commit is contained in:
parent
21b8e363c4
commit
56c44bd92e
|
@ -229,7 +229,7 @@ mount_unmount(struct node *root)
|
|||
}
|
||||
|
||||
static void
|
||||
flush_autofs(const char *fspath)
|
||||
flush_autofs(const char *fspath, const fsid_t *fsid)
|
||||
{
|
||||
struct iovec *iov = NULL;
|
||||
char errmsg[255];
|
||||
|
@ -242,6 +242,8 @@ flush_autofs(const char *fspath)
|
|||
__DECONST(void *, "autofs"), (size_t)-1);
|
||||
build_iovec(&iov, &iovlen, "fspath",
|
||||
__DECONST(void *, fspath), (size_t)-1);
|
||||
build_iovec(&iov, &iovlen, "fsid",
|
||||
__DECONST(void *, fsid), sizeof(*fsid));
|
||||
build_iovec(&iov, &iovlen, "errmsg",
|
||||
errmsg, sizeof(errmsg));
|
||||
|
||||
|
@ -291,7 +293,7 @@ flush_caches(void)
|
|||
continue;
|
||||
}
|
||||
|
||||
flush_autofs(mntbuf[i].f_mntonname);
|
||||
flush_autofs(mntbuf[i].f_mntonname, &statbuf.f_fsid);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue