* Author: Mike Pershin <tappro@whamcloud.com>
*/
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
#define DEBUG_SUBSYSTEM S_OSD
#include <lustre_ver.h>
#include <sys/sa_impl.h>
#include <sys/txg.h>
+#include <linux/posix_acl_xattr.h>
/*
* Copy an extended attribute into the buffer provided, or compute the
LASSERT(osd_invariant(obj));
LASSERT(dt_object_exists(dt));
+ if (!osd_obj2dev(obj)->od_posix_acl &&
+ (strcmp(name, POSIX_ACL_XATTR_ACCESS) == 0 ||
+ strcmp(name, POSIX_ACL_XATTR_DEFAULT) == 0))
+ RETURN(-EOPNOTSUPP);
+
down(&obj->oo_guard);
rc = __osd_xattr_get(env, obj, buf, name, &size);
up(&obj->oo_guard);
return rc;
}
+ /* Ensure xattr doesn't exist in ZAP */
+ if (obj->oo_xattr != ZFS_NO_OBJECT) {
+ udmu_objset_t *uos = &osd_obj2dev(obj)->od_objset;
+ uint64_t xa_data_obj;
+ rc = -zap_lookup(uos->os, obj->oo_xattr,
+ name, 8, 1, &xa_data_obj);
+ if (rc == 0) {
+ rc = __osd_object_free(uos, xa_data_obj, oh->ot_tx);
+ if (rc == 0)
+ zap_remove(uos->os, obj->oo_xattr,
+ name, oh->ot_tx);
+ }
+ }
+
rc = -nvlist_add_byte_array(obj->oo_sa_xattr, name,
(uchar_t *)buf->lb_buf, buf->lb_len);
if (rc)
LASSERT(dt_object_exists(dt));
LASSERT(obj->oo_db);
+ if (!osd_obj2dev(obj)->od_posix_acl &&
+ (strcmp(name, POSIX_ACL_XATTR_ACCESS) == 0 ||
+ strcmp(name, POSIX_ACL_XATTR_DEFAULT) == 0))
+ RETURN(-EOPNOTSUPP);
+
oh = container_of0(handle, struct osd_thandle, ot_super);
down(&obj->oo_guard);
oh = container_of0(handle, struct osd_thandle, ot_super);
LASSERT(oh->ot_tx != NULL);
+ if (!osd_obj2dev(obj)->od_posix_acl &&
+ (strcmp(name, POSIX_ACL_XATTR_ACCESS) == 0 ||
+ strcmp(name, POSIX_ACL_XATTR_DEFAULT) == 0))
+ RETURN(-EOPNOTSUPP);
+
down(&obj->oo_guard);
rc = __osd_xattr_del(env, obj, name, oh);
up(&obj->oo_guard);
LASSERT(obj->oo_sa_xattr);
while ((nvp = nvlist_next_nvpair(obj->oo_sa_xattr, nvp)) != NULL) {
+ const char *name = nvpair_name(nvp);
+
+ if (!osd_obj2dev(obj)->od_posix_acl &&
+ (strcmp(name, POSIX_ACL_XATTR_ACCESS) == 0 ||
+ strcmp(name, POSIX_ACL_XATTR_DEFAULT) == 0))
+ continue;
+
len = strlen(nvpair_name(nvp));
if (lb->lb_buf != NULL) {
if (len + 1 > remain)
return -ERANGE;
- memcpy(lb->lb_buf, nvpair_name(nvp), len);
+ memcpy(lb->lb_buf, name, len);
lb->lb_buf += len;
*((char *)lb->lb_buf) = '\0';
lb->lb_buf++;
while ((rc = -udmu_zap_cursor_retrieve_key(env, zc, oti->oti_key,
MAXNAMELEN)) == 0) {
+ if (!osd_obj2dev(obj)->od_posix_acl &&
+ (strcmp(oti->oti_key, POSIX_ACL_XATTR_ACCESS) == 0 ||
+ strcmp(oti->oti_key, POSIX_ACL_XATTR_DEFAULT) == 0)) {
+ zap_cursor_advance(zc);
+ continue;
+ }
+
rc = strlen(oti->oti_key);
if (lb->lb_buf != NULL) {
if (rc + 1 > remain)