Whamcloud - gitweb
LU-8056 xattr: update server code for POSIX xattr rename 54/21454/3
authorJames Simmons <uja.ornl@yahoo.com>
Wed, 27 Jul 2016 16:24:31 +0000 (12:24 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 6 Aug 2016 06:25:22 +0000 (06:25 +0000)
Enabling ZFS server support for linux 4.5 kernels showed
that the POSIX_ACL_XATTR_{ACCESS,DEFAULT} change to
XATTR_NAME_POSIX_ACL_{ACCESS,DEFAULT} impacts the server
side code as well. Update server side for this name change.

Change-Id: Ieeef8c047177cd55ca87b04dfdacd59d343b0078
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: http://review.whamcloud.com/21454
Tested-by: Jenkins
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/lustre_compat.h
lustre/llite/xattr.c
lustre/mdd/mdd_internal.h
lustre/mdd/mdd_object.c
lustre/mdt/mdt_handler.c
lustre/osd-zfs/osd_xattr.c

index 10ba323..ce704ac 100644 (file)
 
 #include <linux/fs_struct.h>
 #include <linux/namei.h>
+#include <linux/pagemap.h>
 #include <linux/bio.h>
 
+#include <libcfs/libcfs.h>
 #include <lustre_patchless_compat.h>
 
 #ifdef HAVE_FS_STRUCT_RWLOCK
@@ -280,6 +282,14 @@ unsigned int ll_crypto_tfm_alg_min_keysize(struct crypto_blkcipher *tfm)
 # define TIMES_SET_FLAGS (ATTR_MTIME_SET | ATTR_ATIME_SET)
 #endif
 
+#ifndef XATTR_NAME_POSIX_ACL_ACCESS
+# define XATTR_NAME_POSIX_ACL_ACCESS POSIX_ACL_XATTR_ACCESS
+#endif
+
+#ifndef XATTR_NAME_POSIX_ACL_DEFAULT
+# define XATTR_NAME_POSIX_ACL_DEFAULT POSIX_ACL_XATTR_DEFAULT
+#endif
+
 #ifndef HAVE_LM_XXX_LOCK_MANAGER_OPS
 # define lm_compare_owner      fl_compare_owner
 #endif
index 461a0ba..c4af9c1 100644 (file)
 #define XATTR_NAME_EVM         "security.evm"
 #endif
 
-#ifndef XATTR_NAME_POSIX_ACL_ACCESS
-# define XATTR_NAME_POSIX_ACL_ACCESS POSIX_ACL_XATTR_ACCESS
-#endif
-
-#ifndef XATTR_NAME_POSIX_ACL_DEFAULT
-# define XATTR_NAME_POSIX_ACL_DEFAULT POSIX_ACL_XATTR_DEFAULT
-#endif
-
 #define XATTR_USER_T            (1)
 #define XATTR_TRUSTED_T         (2)
 #define XATTR_SECURITY_T        (3)
index 60094ca..2b7af49 100644 (file)
@@ -42,6 +42,7 @@
 #define _MDD_INTERNAL_H
 
 #include <lustre_acl.h>
+#include <lustre_compat.h>
 #include <lustre_eacl.h>
 #include <md_object.h>
 #include <dt_object.h>
index 0a1164e..478eeb3 100644 (file)
@@ -1098,10 +1098,10 @@ static int mdd_xattr_set(const struct lu_env *env, struct md_object *obj,
                                              handle);
        else if (strncmp(XATTR_USER_PREFIX, name,
                        sizeof(XATTR_USER_PREFIX) - 1) == 0 ||
-           strncmp(POSIX_ACL_XATTR_ACCESS, name,
-                       sizeof(POSIX_ACL_XATTR_ACCESS) - 1) == 0 ||
-           strncmp(POSIX_ACL_XATTR_DEFAULT, name,
-                       sizeof(POSIX_ACL_XATTR_DEFAULT) - 1) == 0)
+           strncmp(XATTR_NAME_POSIX_ACL_ACCESS, name,
+                   sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1) == 0 ||
+           strncmp(XATTR_NAME_POSIX_ACL_DEFAULT, name,
+                   sizeof(XATTR_NAME_POSIX_ACL_DEFAULT) - 1) == 0)
                rc = mdd_changelog_data_store(env, mdd, CL_XATTR, 0, mdd_obj,
                                              handle);
 
@@ -1126,10 +1126,10 @@ static int mdd_declare_xattr_del(const struct lu_env *env,
        /* Only record system & user xattr changes */
        if (strncmp(XATTR_USER_PREFIX, name,
                        sizeof(XATTR_USER_PREFIX) - 1) == 0 ||
-               strncmp(POSIX_ACL_XATTR_ACCESS, name,
-                       sizeof(POSIX_ACL_XATTR_ACCESS) - 1) == 0 ||
-               strncmp(POSIX_ACL_XATTR_DEFAULT, name,
-                       sizeof(POSIX_ACL_XATTR_DEFAULT) - 1) == 0)
+               strncmp(XATTR_NAME_POSIX_ACL_ACCESS, name,
+                       sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1) == 0 ||
+               strncmp(XATTR_NAME_POSIX_ACL_DEFAULT, name,
+                       sizeof(XATTR_NAME_POSIX_ACL_DEFAULT) - 1) == 0)
                rc = mdd_declare_changelog_store(env, mdd, NULL, NULL, handle);
 
        return rc;
@@ -1178,10 +1178,10 @@ static int mdd_xattr_del(const struct lu_env *env, struct md_object *obj,
         /* Only record system & user xattr changes */
        if (strncmp(XATTR_USER_PREFIX, name,
                                   sizeof(XATTR_USER_PREFIX) - 1) == 0 ||
-                          strncmp(POSIX_ACL_XATTR_ACCESS, name,
-                                  sizeof(POSIX_ACL_XATTR_ACCESS) - 1) == 0 ||
-                          strncmp(POSIX_ACL_XATTR_DEFAULT, name,
-                                 sizeof(POSIX_ACL_XATTR_DEFAULT) - 1) == 0)
+                         strncmp(XATTR_NAME_POSIX_ACL_ACCESS, name,
+                                 sizeof(XATTR_NAME_POSIX_ACL_ACCESS) - 1) == 0 ||
+                         strncmp(XATTR_NAME_POSIX_ACL_DEFAULT, name,
+                                 sizeof(XATTR_NAME_POSIX_ACL_DEFAULT) - 1) == 0)
                 rc = mdd_changelog_data_store(env, mdd, CL_XATTR, 0, mdd_obj,
                                               handle);
 
index acc008f..ab44bfd 100644 (file)
@@ -49,6 +49,7 @@
 #define DEBUG_SUBSYSTEM S_MDS
 
 #include <linux/module.h>
+#include <linux/pagemap.h>
 
 #include <dt_object.h>
 #include <lustre_acl.h>
index 9fd2437..7e5d932 100644 (file)
@@ -252,8 +252,8 @@ int osd_xattr_get(const struct lu_env *env, struct dt_object *dt,
        LASSERT(osd_invariant(obj));
 
        if (!osd_obj2dev(obj)->od_posix_acl &&
-           (strcmp(name, POSIX_ACL_XATTR_ACCESS) == 0 ||
-            strcmp(name, POSIX_ACL_XATTR_DEFAULT) == 0))
+           (strcmp(name, XATTR_NAME_POSIX_ACL_ACCESS) == 0 ||
+            strcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0))
                RETURN(-EOPNOTSUPP);
 
        down_read(&obj->oo_guard);
@@ -626,8 +626,8 @@ int osd_xattr_set(const struct lu_env *env, struct dt_object *dt,
        LASSERT(osd_invariant(obj));
 
        if (!osd_obj2dev(obj)->od_posix_acl &&
-           (strcmp(name, POSIX_ACL_XATTR_ACCESS) == 0 ||
-            strcmp(name, POSIX_ACL_XATTR_DEFAULT) == 0))
+           (strcmp(name, XATTR_NAME_POSIX_ACL_ACCESS) == 0 ||
+            strcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0))
                RETURN(-EOPNOTSUPP);
 
        if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LINKEA_OVERFLOW) &&
@@ -773,8 +773,8 @@ int osd_xattr_del(const struct lu_env *env, struct dt_object *dt,
        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))
+           (strcmp(name, XATTR_NAME_POSIX_ACL_ACCESS) == 0 ||
+            strcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0))
                RETURN(-EOPNOTSUPP);
 
        down_write(&obj->oo_guard);
@@ -894,8 +894,8 @@ osd_sa_xattr_list(const struct lu_env *env, struct osd_object *obj,
                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))
+                   (strcmp(name, XATTR_NAME_POSIX_ACL_ACCESS) == 0 ||
+                    strcmp(name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0))
                        continue;
 
                len = strlen(name);
@@ -942,8 +942,8 @@ int osd_xattr_list(const struct lu_env *env, struct dt_object *dt,
 
        while ((rc = -zap_cursor_retrieve(zc, za)) == 0) {
                if (!osd_obj2dev(obj)->od_posix_acl &&
-                   (strcmp(za->za_name, POSIX_ACL_XATTR_ACCESS) == 0 ||
-                    strcmp(za->za_name, POSIX_ACL_XATTR_DEFAULT) == 0)) {
+                   (strcmp(za->za_name, XATTR_NAME_POSIX_ACL_ACCESS) == 0 ||
+                    strcmp(za->za_name, XATTR_NAME_POSIX_ACL_DEFAULT) == 0)) {
                        zap_cursor_advance(zc);
                        continue;
                }