linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Jan Kara <jack@suse.cz>, Christoph Hellwig <hch@lst.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-fsdevel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: [PATCH] vfs: Pass setxattr(2) flags properly
Date: Wed, 20 Apr 2011 16:59:06 -0700	[thread overview]
Message-ID: <BANLkTi=muyG3iVnTp6YCY1-dFuBa6SQGZQ@mail.gmail.com> (raw)
In-Reply-To: <1303324240-26672-1-git-send-email-jack@suse.cz>

Hmm. This patch looks very sane, but it's been that way - ignoring the
'flags' value - since 2009. Does anybody actually _use_ the flags
field?

Judging by commit 431547b3c453 (that introduced the thing), it looks
like a plain mistake, and the previous "flags" was replaced by a "0"
in the call when it added the "hander->flags" argument at the end. But
the fact that it's been two years, and nobody noticed, makes me go
"hmm.."

Christoph added to participants, since he's the cause of that change.

On Wed, Apr 20, 2011 at 11:30 AM, Jan Kara <jack@suse.cz> wrote:
> For some reason generic_setxattr() did not pass flags (XATTR_CREATE,
> XATTR_REPLACE) to the filesystem specific helper. This caused that
> setxattr(2) syscall just ignored these flags.
>
> Fix the bug by passing flags correctly.
>
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  fs/xattr.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
>  Who's handling VFS changes when Al is away? Andrew?

I guess it's mostly me for at least the path handling, but for
something like this I'd like Christoph to take a look too. Even if it
_looks_ like a really obvious fix.

>
> diff --git a/fs/xattr.c b/fs/xattr.c
> index a19acdb..f1ef949 100644
> --- a/fs/xattr.c
> +++ b/fs/xattr.c
> @@ -666,7 +666,7 @@ generic_setxattr(struct dentry *dentry, const char *name, const void *value, siz
>        handler = xattr_resolve_name(dentry->d_sb->s_xattr, &name);
>        if (!handler)
>                return -EOPNOTSUPP;
> -       return handler->set(dentry, name, value, size, 0, handler->flags);
> +       return handler->set(dentry, name, value, size, flags, handler->flags);
>  }
>
>  /*
> --
> 1.7.1
>
>

  reply	other threads:[~2011-04-20 23:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-20 18:30 [PATCH] vfs: Pass setxattr(2) flags properly Jan Kara
2011-04-20 23:59 ` Linus Torvalds [this message]
2011-04-21  3:09   ` Christoph Hellwig
2011-04-21  3:58     ` Linus Torvalds
2011-04-21  4:17       ` Christoph Hellwig

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='BANLkTi=muyG3iVnTp6YCY1-dFuBa6SQGZQ@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=hch@lst.de \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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;
as well as URLs for NNTP newsgroup(s).