summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-entry.c
diff options
context:
space:
mode:
authorKaushal M <kaushal@gluster.com>2011-10-20 10:53:58 +0530
committerVijay Bellur <vijay@gluster.com>2011-10-31 05:53:24 -0700
commit32173e1c70dcb53470b0738ed4d0022388193113 (patch)
treed45cd390607d5375b509efac4850e91297244699 /xlators/cluster/afr/src/afr-self-heal-entry.c
parenta29f1a0e36bde5ca7b8f3762f10b210b5e12a875 (diff)
cluster/afr : Fix self-heal of special files
Fixes self-heal of special files like device files, fifo files, socket files etc. Does it by doing the following: * Prevent setting of pending data xattr on a special file during entry self-heal when a new fils is created. * Allow data self-heal to be started on all file types other than directories. During data self-heal, for special files just erase pending xattrs, if those xattrs were set by previous releases of glusterfs. Change-Id: I34d8121e23ad00e85371ae2a36ef30cf3bd5db7a BUG: 3525 Reviewed-on: http://review.gluster.com/618 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pranithk@gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-entry.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c
index 5a3302f7f..12cba1f49 100644
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
@@ -1079,14 +1079,20 @@ afr_sh_entry_impunge_newfile_cbk (call_frame_t *impunge_frame, void *cookie,
ret = -1;
goto out;
}
+
+ /* Pending data xattrs shouldn't be set for special files
+ */
idx = afr_index_for_transaction_type (AFR_METADATA_TRANSACTION);
pending_array[idx] = hton32 (1);
if (IA_ISDIR (stbuf->ia_type))
idx = afr_index_for_transaction_type (AFR_ENTRY_TRANSACTION);
- else
+ else if (IA_ISREG (stbuf->ia_type))
idx = afr_index_for_transaction_type (AFR_DATA_TRANSACTION);
+ else
+ goto cont;
pending_array[idx] = hton32 (1);
+cont:
ret = dict_set_dynptr (xattr, priv->pending_key[child_index],
pending_array,
3 * sizeof (*pending_array));
@@ -1096,7 +1102,6 @@ afr_sh_entry_impunge_newfile_cbk (call_frame_t *impunge_frame, void *cookie,
} else {
pending_array = NULL;
}
-
valid = GF_SET_ATTR_ATIME | GF_SET_ATTR_MTIME;
parentbuf = impunge_sh->parentbuf;
setattr_frame = copy_frame (impunge_frame);