Instead of passing MNT_UPDATE, MNT_SNAPSHOT, MNT_RELOAD from
userspace to kernel via nmount(), pass in the strings "update", "snapshot", "reload". We want to move away from passing MNT_ flags from userspace -> kernel via nmount(), and instead favor passing the string options.
This commit is contained in:
parent
40d2569e47
commit
88d03d8d09
@ -344,7 +344,6 @@ checkfilesys(char *filesys)
|
||||
snprintf(snapname, sizeof snapname,
|
||||
"%s/.snap/fsck_snapshot", mntp->f_mntonname);
|
||||
fflags = mntp->f_flags;
|
||||
fflags = fflags | MNT_UPDATE | MNT_SNAPSHOT;
|
||||
build_iovec(&iov, &iovlen, "fstype", "ffs", 4);
|
||||
build_iovec(&iov, &iovlen, "from", snapname,
|
||||
(size_t)-1);
|
||||
@ -352,6 +351,8 @@ checkfilesys(char *filesys)
|
||||
(size_t)-1);
|
||||
build_iovec(&iov, &iovlen, "errmsg", errmsg,
|
||||
sizeof(errmsg));
|
||||
build_iovec(&iov, &iovlen, "update", NULL, 0);
|
||||
build_iovec(&iov, &iovlen, "snapshot", NULL, 0);
|
||||
|
||||
while (nmount(iov, iovlen, fflags) < 0) {
|
||||
if (errno == EEXIST && unlink(snapname) == 0)
|
||||
@ -537,7 +538,6 @@ chkdoreload(struct statfs *mntp)
|
||||
* as safely as possible.
|
||||
*/
|
||||
if (mntp->f_flags & MNT_RDONLY) {
|
||||
fflags = fflags | MNT_RELOAD;
|
||||
build_iovec(&iov, &iovlen, "fstype", "ffs", 4);
|
||||
build_iovec(&iov, &iovlen, "from", mntp->f_mntfromname,
|
||||
(size_t)-1);
|
||||
@ -546,6 +546,7 @@ chkdoreload(struct statfs *mntp)
|
||||
build_iovec(&iov, &iovlen, "errmsg", errmsg,
|
||||
sizeof(errmsg));
|
||||
build_iovec(&iov, &iovlen, "update", NULL, 0);
|
||||
build_iovec(&iov, &iovlen, "reload", NULL, 0);
|
||||
/*
|
||||
* XX: We need the following line until we clean up
|
||||
* nmount parsing of root mounts and NFS root mounts.
|
||||
|
Loading…
Reference in New Issue
Block a user