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

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Nov 18 10:19:18 UTC 2019


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;
 


More information about the svn-src-head mailing list