summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/xattr.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/xattr.c')
-rw-r--r--fs/btrfs/xattr.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/fs/btrfs/xattr.c b/fs/btrfs/xattr.c
index 6730b59..121c955 100644
--- a/fs/btrfs/xattr.c
+++ b/fs/btrfs/xattr.c
@@ -26,25 +26,27 @@
#include "transaction.h"
#include "xattr.h"
#include "disk-io.h"
+
static struct xattr_handler *btrfs_xattr_handler_map[] = {
[BTRFS_XATTR_INDEX_USER] = &btrfs_xattr_user_handler,
#ifdef CONFIG_FS_POSIX_ACL
-// [BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS] = &btrfs_xattr_acl_access_handler,
-// [BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT] = &btrfs_xattr_acl_default_handler,
+ [BTRFS_XATTR_INDEX_POSIX_ACL_ACCESS] = &btrfs_xattr_acl_access_handler,
+ [BTRFS_XATTR_INDEX_POSIX_ACL_DEFAULT] = &btrfs_xattr_acl_default_handler,
#endif
[BTRFS_XATTR_INDEX_TRUSTED] = &btrfs_xattr_trusted_handler,
[BTRFS_XATTR_INDEX_SECURITY] = &btrfs_xattr_security_handler,
-// [BTRFS_XATTR_INDEX_SYSTEM] = &btrfs_xattr_system_handler,
+ [BTRFS_XATTR_INDEX_SYSTEM] = &btrfs_xattr_system_handler,
};
+
struct xattr_handler *btrfs_xattr_handlers[] = {
&btrfs_xattr_user_handler,
#ifdef CONFIG_FS_POSIX_ACL
-// &btrfs_xattr_acl_access_handler,
-// &btrfs_xattr_acl_default_handler,
+ &btrfs_xattr_acl_access_handler,
+ &btrfs_xattr_acl_default_handler,
#endif
&btrfs_xattr_trusted_handler,
&btrfs_xattr_security_handler,
-// &btrfs_xattr_system_handler,
+ &btrfs_xattr_system_handler,
NULL,
};
@@ -237,10 +239,14 @@ int btrfs_xattr_set(struct inode *inode, int name_index,
mod = 1;
goto out;
}
- } else if (flags & XATTR_REPLACE) {
- /* we couldn't find the attr to replace, so error out */
- ret = -ENODATA;
- goto out;
+ } else {
+ btrfs_release_path(root, path);
+
+ if (flags & XATTR_REPLACE) {
+ /* we couldn't find the attr to replace */
+ ret = -ENODATA;
+ goto out;
+ }
}
/* ok we have to create a completely new xattr */
OpenPOWER on IntegriCloud