Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Nov 2019 10:19:17 +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: r354805 - head/sys/compat/linux
Message-ID:  <201911181019.xAIAJHjw051553@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Mon Nov 18 10:19:16 2019
New Revision: 354805
URL: https://svnweb.freebsd.org/changeset/base/354805

Log:
  Make linux(4) open(2)/openat(2) return ELOOP instead of EMLINK,
  when being passed O_NOFOLLOW.  This fixes LTP testcase openat02:5.
  
  Reviewed by:	emaste
  MFC after:	2 weeks
  Sponsored by:	The FreeBSD Foundation
  Differential Revision:	https://reviews.freebsd.org/D22384

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

Modified: head/sys/compat/linux/linux_file.c
==============================================================================
--- head/sys/compat/linux/linux_file.c	Mon Nov 18 09:38:35 2019	(r354804)
+++ head/sys/compat/linux/linux_file.c	Mon Nov 18 10:19:16 2019	(r354805)
@@ -132,8 +132,11 @@ linux_common_open(struct thread *td, int dirfd, char *
 	/* XXX LINUX_O_NOATIME: unable to be easily implemented. */
 
 	error = kern_openat(td, dirfd, path, UIO_SYSSPACE, bsd_flags, mode);
-	if (error != 0)
+	if (error != 0) {
+		if (error == EMLINK)
+			error = ELOOP;
 		goto done;
+	}
 	if (bsd_flags & O_NOCTTY)
 		goto done;
 



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