svn commit: r356912 - head/sys/compat/linux

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Jan 20 12:16:33 UTC 2020


Author: trasz
Date: Mon Jan 20 12:16:32 2020
New Revision: 356912
URL: https://svnweb.freebsd.org/changeset/base/356912

Log:
  Properly translate MNT_FORCE flag to Linux umount2(2).  Previously
  it worked by accident.
  
  MFC after:	2 weeks
  Sponsored by:	DARPA

Modified:
  head/sys/compat/linux/linux_file.c
  head/sys/compat/linux/linux_file.h

Modified: head/sys/compat/linux/linux_file.c
==============================================================================
--- head/sys/compat/linux/linux_file.c	Mon Jan 20 11:54:00 2020	(r356911)
+++ head/sys/compat/linux/linux_file.c	Mon Jan 20 12:16:32 2020	(r356912)
@@ -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

Modified: head/sys/compat/linux/linux_file.h
==============================================================================
--- head/sys/compat/linux/linux_file.h	Mon Jan 20 11:54:00 2020	(r356911)
+++ head/sys/compat/linux/linux_file.h	Mon Jan 20 12:16:32 2020	(r356912)
@@ -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


More information about the svn-src-head mailing list