Skip to content

Commit

Permalink
vfs: Pass setxattr(2) flags properly
Browse files Browse the repository at this point in the history
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>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Jan Kara authored and Linus Torvalds committed Apr 21, 2011
1 parent 584f790 commit df7e130
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down

0 comments on commit df7e130

Please sign in to comment.