cluster/ec: Mark self-heal fops as internal
authorPranith Kumar K <pkarampu@redhat.com>
Tue, 17 Nov 2015 11:31:47 +0000 (17:01 +0530)
committerPranith Kumar Karampuri <pkarampu@redhat.com>
Wed, 18 Nov 2015 13:16:03 +0000 (05:16 -0800)
Change-Id: I8ae7af266d3e00460f0cfdc9389a926e5f2fee36
BUG: 1282761
Signed-off-by: Pranith Kumar K <pkarampu@redhat.com>
Reviewed-on: http://review.gluster.org/12598
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Reviewed-by: Xavier Hernandez <xhernandez@datalab.es>
12 files changed:
libglusterfs/src/common-utils.h
xlators/cluster/afr/src/afr-common.c
xlators/cluster/afr/src/afr-inode-write.c
xlators/cluster/afr/src/afr-self-heal-common.c
xlators/cluster/afr/src/afr-self-heald.c
xlators/cluster/ec/src/ec-heal.c
xlators/cluster/ec/src/ec-heald.c
xlators/features/changelog/src/changelog-helpers.h
xlators/features/changetimerecorder/src/ctr-helper.h
xlators/features/marker/src/marker.c
xlators/mgmt/glusterd/src/glusterd-replace-brick.c
xlators/protocol/server/src/server-helpers.c

index 1c9ef13b80afa21435d301ac70d41ef97d710c2a..b2466170931237e27e1da97e80191b684f6a514e 100644 (file)
@@ -117,7 +117,7 @@ enum _gf_client_pid
         GF_CLIENT_PID_DEFRAG            = -3,
         GF_CLIENT_PID_NO_ROOT_SQUASH    = -4,
         GF_CLIENT_PID_QUOTA_MOUNT       = -5,
-        GF_CLIENT_PID_AFR_SELF_HEALD    = -6,
+        GF_CLIENT_PID_SELF_HEALD        = -6,
         GF_CLIENT_PID_GLFS_HEAL         = -7,
         GF_CLIENT_PID_BITD              = -8,
         GF_CLIENT_PID_SCRUB             = -9,
index dae1b9d8a48ca9e634a8e86a6849eb8a3ea8e031..9f47484e04309bcff9404264357d08ce1f952cec 100644 (file)
@@ -824,7 +824,7 @@ afr_inode_refresh_done (call_frame_t *frame, xlator_t *this)
        if (ret && afr_selfheal_enabled (this)) {
                heal = copy_frame (frame);
                if (heal)
-                       heal->root->pid = GF_CLIENT_PID_AFR_SELF_HEALD;
+                       heal->root->pid = GF_CLIENT_PID_SELF_HEALD;
                ret = synctask_new (this->ctx->env, afr_refresh_selfheal_wrap,
                                    afr_refresh_selfheal_done, heal, frame);
                if (ret)
@@ -1912,7 +1912,7 @@ afr_lookup_metadata_heal_check (call_frame_t *frame, xlator_t *this)
 
         heal = copy_frame (frame);
         if (heal)
-                heal->root->pid = GF_CLIENT_PID_AFR_SELF_HEALD;
+                heal->root->pid = GF_CLIENT_PID_SELF_HEALD;
         ret = synctask_new (this->ctx->env, afr_lookup_sh_metadata_wrap,
                             afr_refresh_selfheal_done, heal, frame);
         if(ret)
@@ -2000,7 +2000,7 @@ afr_lookup_entry_heal (call_frame_t *frame, xlator_t *this)
        if (need_heal) {
                heal = copy_frame (frame);
                if (heal)
-                       heal->root->pid = GF_CLIENT_PID_AFR_SELF_HEALD;
+                       heal->root->pid = GF_CLIENT_PID_SELF_HEALD;
                ret = synctask_new (this->ctx->env, afr_lookup_selfheal_wrap,
                                    afr_refresh_selfheal_done, heal, frame);
                if (ret)
index 454124fadb175b4c51eaedd10f364b25cd4991a5..297d7b8b0dd9e874732275dd8326c1f3065362f4 100644 (file)
@@ -1419,7 +1419,7 @@ afr_handle_replace_brick (xlator_t *this, call_frame_t *frame, loc_t *loc,
         ret =  dict_get_str (dict, GF_AFR_REPLACE_BRICK, &replace_brick);
 
         if (!ret) {
-                if (frame->root->pid != GF_CLIENT_PID_AFR_SELF_HEALD) {
+                if (frame->root->pid != GF_CLIENT_PID_SELF_HEALD) {
                         gf_log (this->name, GF_LOG_ERROR, "'%s' is an internal"
                                 " extended attribute : %s.",
                                 GF_AFR_REPLACE_BRICK, strerror (EPERM));
index cd2dc10be27aa3274655ba712172a8c09b55b707..c2ea4e96dc9667135f5241563ff92bc83f587595 100644 (file)
@@ -1262,7 +1262,7 @@ afr_frame_create (xlator_t *this)
        call_frame_t *frame    = NULL;
        afr_local_t  *local    = NULL;
        int           op_errno = 0;
-       pid_t         pid      = GF_CLIENT_PID_AFR_SELF_HEALD;
+       pid_t         pid      = GF_CLIENT_PID_SELF_HEALD;
 
        frame = create_frame (this, this->ctx->pool);
        if (!frame)
index c408abb444ee9ba63866428a4035dd81194a0878..028d3ec42567dc092b9c9611e029259bc843d707 100644 (file)
@@ -442,7 +442,7 @@ afr_shd_index_sweep (struct subvol_healer *healer)
                return -errno;
        }
 
-        ret = syncop_dir_scan (subvol, &loc, GF_CLIENT_PID_AFR_SELF_HEALD,
+        ret = syncop_dir_scan (subvol, &loc, GF_CLIENT_PID_SELF_HEALD,
                                healer, afr_shd_index_heal);
 
         inode_forget (loc.inode, 1);
@@ -483,7 +483,7 @@ afr_shd_full_sweep (struct subvol_healer *healer, inode_t *inode)
         priv = healer->this->private;
         loc.inode = inode;
         return syncop_ftw (priv->children[healer->subvol], &loc,
-                           GF_CLIENT_PID_AFR_SELF_HEALD, healer,
+                           GF_CLIENT_PID_SELF_HEALD, healer,
                            afr_shd_full_heal);
 }
 
@@ -900,7 +900,7 @@ afr_shd_gather_index_entries (xlator_t *this, int child, dict_t *output)
                 return -errno;
         }
 
-        ret = syncop_dir_scan (subvol, &loc, GF_CLIENT_PID_AFR_SELF_HEALD,
+        ret = syncop_dir_scan (subvol, &loc, GF_CLIENT_PID_SELF_HEALD,
                                output, afr_shd_gather_entry);
         inode_forget (loc.inode, 1);
         loc_wipe (&loc);
index 10dc9f158e779f485f4711c88df3b49b0b4a03ce..d80cdabc5aba9d411a02bdb26c8c524d65a65dec 100644 (file)
@@ -1369,7 +1369,7 @@ ec_heal_names (call_frame_t *frame, ec_t *ec, inode_t *inode,
                 if (!participants[i])
                         continue;
                 syncop_dir_scan (ec->xl_list[i], &loc,
-                                GF_CLIENT_PID_AFR_SELF_HEALD, &name_data,
+                                GF_CLIENT_PID_SELF_HEALD, &name_data,
                                 ec_name_heal_handler);
                 for (j = 0; j < ec->nodes; j++)
                         if (name_data.failed_on[j])
@@ -2325,6 +2325,8 @@ ec_heal_do (xlator_t *this, void *data, loc_t *loc, int32_t partial)
         /*Do heal as root*/
         frame->root->uid = 0;
         frame->root->gid = 0;
+        /*Mark the fops as internal*/
+        frame->root->pid = GF_CLIENT_PID_SELF_HEALD;
         participants = alloca0(ec->nodes);
         ec_mask_to_char_array (ec->xl_up, participants, ec->nodes);
         if (loc->name && strlen (loc->name)) {
index 20724c778bf39f08ca5ab0014d4d0897b1eac7c3..95cff00b283b4780269f0d298387c8d40f75cd6d 100644 (file)
@@ -294,7 +294,7 @@ ec_shd_index_sweep (struct subvol_healer *healer)
                 goto out;
         }
 
-        ret = syncop_dir_scan (subvol, &loc, GF_CLIENT_PID_AFR_SELF_HEALD,
+        ret = syncop_dir_scan (subvol, &loc, GF_CLIENT_PID_SELF_HEALD,
                                healer, ec_shd_index_heal);
 out:
         if (loc.inode)
@@ -352,7 +352,7 @@ ec_shd_full_sweep (struct subvol_healer *healer, inode_t *inode)
         ec = healer->this->private;
         loc.inode = inode;
         return syncop_ftw (ec->xl_list[healer->subvol], &loc,
-                           GF_CLIENT_PID_AFR_SELF_HEALD, healer,
+                           GF_CLIENT_PID_SELF_HEALD, healer,
                            ec_shd_full_heal);
 }
 
index 7d1a86e7b33a7c571d6ba571c576fc023967b277..df307382d34a60b0774e21b4c40b0359dbeb811e 100644 (file)
@@ -626,7 +626,7 @@ resolve_pargfid_to_path (xlator_t *this, uuid_t gfid, char **path, char *bname);
  * ignore internal fops for all clients except AFR self-heal daemon
  */
 #define CHANGELOG_IF_INTERNAL_FOP_THEN_GOTO(frame, dict, label) do {    \
-                if ((frame->root->pid != GF_CLIENT_PID_AFR_SELF_HEALD)  \
+                if ((frame->root->pid != GF_CLIENT_PID_SELF_HEALD)      \
                     && dict                                             \
                     && dict_get (dict, GLUSTERFS_INTERNAL_FOP_KEY))     \
                         goto label;                                     \
index 161fff2d7743b6dee0027f687be0661fc09f45db..6ddc5b8ca195a393278c4524fdb44c8185f135d9 100644 (file)
@@ -278,7 +278,7 @@ do {\
  * If its a AFR SELF HEAL
  * */
  #define AFR_SELF_HEAL_FOP(frame)\
-        (frame->root->pid == GF_CLIENT_PID_AFR_SELF_HEALD)
+        (frame->root->pid == GF_CLIENT_PID_SELF_HEALD)
 
 /*
  * if a rebalancer fop goto
index 77d8a89abd000bef2769371d00db636d3a77e1fc..e388bf85d2be7adb8d0bc452a23ce645b890431c 100644 (file)
@@ -991,7 +991,7 @@ marker_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
         marker_conf_t      *priv    = NULL;
         marker_local_t     *local   = NULL;
         uint32_t            nlink   = -1;
-        int32_t             ret     = 0;
+        GF_UNUSED int32_t   ret     = 0;
 
         if (op_ret == -1) {
                 gf_log (this->name, GF_LOG_TRACE,
index 4c59f0fe0f5ae6984d51cc6bfdcc352b2b5a7df5..3ecb4f064f1fd6b32247f0854f278ae5feaff78a 100644 (file)
@@ -75,7 +75,7 @@ glusterd_handle_replicate_replace_brick (glusterd_volinfo_t *volinfo,
                   DEFAULT_LOG_FILE_DIRECTORY"/%s-replace-brick-mount.log",
                   volinfo->volname);
 
-        ret = gf_asprintf (&pid, "%d", GF_CLIENT_PID_AFR_SELF_HEALD);
+        ret = gf_asprintf (&pid, "%d", GF_CLIENT_PID_SELF_HEALD);
         if (ret < 0)
                 goto out;
 
index b369e835b24b83c78bb9d907810360f555d30fdf..528f4b5bc3b09127dc35e92ae7c527ee900548e6 100644 (file)
@@ -475,7 +475,7 @@ get_frame_from_request (rpcsvc_request_t *req)
                             req->pid != GF_CLIENT_PID_NO_ROOT_SQUASH &&
                             req->pid != GF_CLIENT_PID_GSYNCD &&
                             req->pid != GF_CLIENT_PID_DEFRAG &&
-                            req->pid != GF_CLIENT_PID_AFR_SELF_HEALD &&
+                            req->pid != GF_CLIENT_PID_SELF_HEALD &&
                             req->pid != GF_CLIENT_PID_QUOTA_MOUNT)
                                 RPC_AUTH_ROOT_SQUASH (req);