提交 df7e1303 编写于 作者: J Jan Kara 提交者: Linus Torvalds

vfs: Pass setxattr(2) flags properly

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: NJan Kara <jack@suse.cz>
Acked-by: NChristoph Hellwig <hch@lst.de>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 584f7904
...@@ -666,7 +666,7 @@ generic_setxattr(struct dentry *dentry, const char *name, const void *value, siz ...@@ -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); handler = xattr_resolve_name(dentry->d_sb->s_xattr, &name);
if (!handler) if (!handler)
return -EOPNOTSUPP; return -EOPNOTSUPP;
return handler->set(dentry, name, value, size, 0, handler->flags); return handler->set(dentry, name, value, size, flags, handler->flags);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册