diff options
author | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2020-01-20 12:16:32 +0000 |
---|---|---|
committer | Edward Tomasz Napierala <trasz@FreeBSD.org> | 2020-01-20 12:16:32 +0000 |
commit | 66632fe7bbe732c6fd09e391dcc16b599e1b7f67 (patch) | |
tree | f2bbefdcb2df14b15638487155b9ccc0abbd1f4e /sys | |
parent | 6507380fb9f73b45726970c2f5942c805d222ffe (diff) | |
download | src-66632fe7bbe732c6fd09e391dcc16b599e1b7f67.tar.gz src-66632fe7bbe732c6fd09e391dcc16b599e1b7f67.zip |
Properly translate MNT_FORCE flag to Linux umount2(2). Previously
it worked by accident.
MFC after: 2 weeks
Sponsored by: DARPA
Notes
Notes:
svn path=/head/; revision=356912
Diffstat (limited to 'sys')
-rw-r--r-- | sys/compat/linux/linux_file.c | 7 | ||||
-rw-r--r-- | sys/compat/linux/linux_file.h | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index 565fc562fdf8..f341e67b11e7 100644 --- a/sys/compat/linux/linux_file.c +++ b/sys/compat/linux/linux_file.c @@ -1078,9 +1078,14 @@ int linux_umount(struct thread *td, struct linux_umount_args *args) { struct unmount_args bsd; + int flags; + + flags = 0; + if ((args->flags & LINUX_MNT_FORCE) != 0) + flags |= MNT_FORCE; bsd.path = args->path; - bsd.flags = args->flags; /* XXX correct? */ + bsd.flags = flags; return (sys_unmount(td, &bsd)); } #endif diff --git a/sys/compat/linux/linux_file.h b/sys/compat/linux/linux_file.h index 40384c52a066..574feec3f26f 100644 --- a/sys/compat/linux/linux_file.h +++ b/sys/compat/linux/linux_file.h @@ -57,6 +57,11 @@ #define LINUX_MS_REMOUNT 0x0020 /* + * umount2 flags + */ +#define LINUX_MNT_FORCE 0x0001 + +/* * common open/fcntl flags */ #define LINUX_O_RDONLY 00000000 |