public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ulrich Drepper <drepper@redhat.com>
To: akpm@osdl.org, linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: [PATCH] flags parameter for linkat
Date: Thu, 23 Feb 2006 09:10:22 -0500	[thread overview]
Message-ID: <200602231410.k1NEAMk1021578@devserv.devel.redhat.com> (raw)

I'm currently at the POSIX meeting and one thing covered was the
incompatibility of Linux's link() with the POSIX definition.  The
difference is the treatment of symbolic links in the destination
name.  Linux does not follow symlinks, POSIX requires it does.

Even somebody thinks this is a good default behavior we cannot
change this because it would break the ABI.  But the fact remains
that some application might want this behavior.

We have one chance to help implementing this without breaking the
behavior.  For this we could use the new linkat interface which
would need a new flags parameter.  If the new parameter is
AT_SYMLINK_FOLLOW the new behavior could be invoked.

I do not want to introduce such a patch now.  But we could add the
parameter now, just don't use it.  The patch below would do this.
Can we get this late patch applied before the release more or less
fixes the syscall API?

Signed-Off-By: Ulrich Drepper <drepper@redhat.com>


--- fs/namei.c	2006-02-23 05:51:45.000000000 -0800
+++ fs/namei.c-new	2006-02-23 05:58:31.000000000 -0800
@@ -2232,13 +2232,17 @@
  * and other special files.  --ADM
  */
 asmlinkage long sys_linkat(int olddfd, const char __user *oldname,
-			   int newdfd, const char __user *newname)
+			   int newdfd, const char __user *newname,
+			   int flags)
 {
 	struct dentry *new_dentry;
 	struct nameidata nd, old_nd;
 	int error;
 	char * to;
 
+	if (flags != 0)
+		return -EINVAL;
+
 	to = getname(newname);
 	if (IS_ERR(to))
 		return PTR_ERR(to);
@@ -2271,7 +2275,7 @@
 
 asmlinkage long sys_link(const char __user *oldname, const char __user *newname)
 {
-	return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname);
+	return sys_linkat(AT_FDCWD, oldname, AT_FDCWD, newname, 0);
 }
 
 /*
--- ./arch/s390/kernel/compat_wrapper.S-new	2006-02-23 06:00:12.000000000 -0800
+++ ./arch/s390/kernel/compat_wrapper.S	2006-02-23 05:51:32.000000000 -0800
@@ -1552,7 +1552,6 @@
 	llgtr	%r3,%r3			# const char *
 	lgfr	%r4,%r4			# int
 	llgtr	%r5,%r5			# const char *
-	lgfr	%r6,%r6			# int
 	jg	sys_linkat
 
 	.globl sys_symlinkat_wrapper

             reply	other threads:[~2006-02-23 14:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-23 14:10 Ulrich Drepper [this message]
2006-02-23 14:19 ` [PATCH] flags parameter for linkat David Vrabel
2006-02-23 20:26 ` Ralf Baechle
2006-02-25  9:16 ` Christoph Hellwig
2006-02-25 10:13   ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200602231410.k1NEAMk1021578@devserv.devel.redhat.com \
    --to=drepper@redhat.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox