projects/linux·commit df7e1303

vfs: Pass setxattr(2) flags properly

df7e1303 · Jan Kara <[email protected]> · 2011-04-20 20:30:40 +02:00

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 <[email protected]>
Acked-by: Christoph Hellwig <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
df7e130384efd1c732aa08648dad46687fee3d96
Parents
584f7904

Changes

1 files changed · +1 −1

FileStatusAddDelContent
fs/xattr.cmodified+1−1View file

fs/xattr.c

View file
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);
}
/*