From owner-svn-src-all@freebsd.org Sat Dec 28 13:35:54 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B35A71E8AE1; Sat, 28 Dec 2019 13:35:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47lPpf4HHMz4N4H; Sat, 28 Dec 2019 13:35:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E25E1C8B; Sat, 28 Dec 2019 13:35:54 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBSDZsVu065399; Sat, 28 Dec 2019 13:35:54 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBSDZs9W065398; Sat, 28 Dec 2019 13:35:54 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912281335.xBSDZs9W065398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sat, 28 Dec 2019 13:35:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r356147 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 356147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Dec 2019 13:35:54 -0000 Author: trasz Date: Sat Dec 28 13:35:54 2019 New Revision: 356147 URL: https://svnweb.freebsd.org/changeset/base/356147 Log: Make linux mount(2) tolerate NULL 'from' argument, and fix flag handling. This should unbreak access04, acct01, chmod06, creat06, and fchmod06 LTP tests. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/compat/linux/linux_file.c Modified: head/sys/compat/linux/linux_file.c ============================================================================== --- head/sys/compat/linux/linux_file.c Sat Dec 28 12:16:40 2019 (r356146) +++ head/sys/compat/linux/linux_file.c Sat Dec 28 13:35:54 2019 (r356147) @@ -1016,9 +1016,13 @@ linux_mount(struct thread *td, struct linux_mount_args NULL); if (error != 0) goto out; - error = copyinstr(args->specialfile, mntfromname, MNAMELEN - 1, NULL); - if (error != 0) - goto out; + if (args->specialfile != NULL) { + error = copyinstr(args->specialfile, mntfromname, MNAMELEN - 1, NULL); + if (error != 0) + goto out; + } else { + mntfromname[0] = '\0'; + } error = copyinstr(args->dir, mntonname, MNAMELEN - 1, NULL); if (error != 0) goto out; @@ -1033,20 +1037,18 @@ linux_mount(struct thread *td, struct linux_mount_args fsflags = 0; - if ((args->rwflag & 0xffff0000) == 0xc0ed0000) { - /* - * Linux SYNC flag is not included; the closest equivalent - * FreeBSD has is !ASYNC, which is our default. - */ - if (args->rwflag & LINUX_MS_RDONLY) - fsflags |= MNT_RDONLY; - if (args->rwflag & LINUX_MS_NOSUID) - fsflags |= MNT_NOSUID; - if (args->rwflag & LINUX_MS_NOEXEC) - fsflags |= MNT_NOEXEC; - if (args->rwflag & LINUX_MS_REMOUNT) - fsflags |= MNT_UPDATE; - } + /* + * Linux SYNC flag is not included; the closest equivalent + * FreeBSD has is !ASYNC, which is our default. + */ + if (args->rwflag & LINUX_MS_RDONLY) + fsflags |= MNT_RDONLY; + if (args->rwflag & LINUX_MS_NOSUID) + fsflags |= MNT_NOSUID; + if (args->rwflag & LINUX_MS_NOEXEC) + fsflags |= MNT_NOEXEC; + if (args->rwflag & LINUX_MS_REMOUNT) + fsflags |= MNT_UPDATE; error = kernel_vmount(fsflags, "fstype", fstypename,