Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Jan 2020 12:16:32 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r356912 - head/sys/compat/linux
Message-ID:  <202001201216.00KCGW7N094850@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001201216.00KCGW7N094850>