summaryrefslogtreecommitdiffstats
path: root/tests/volume.rc
diff options
context:
space:
mode:
authorXavier Hernandez <xhernandez@datalab.es>2015-05-21 18:45:12 +0200
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-05-28 22:54:34 -0700
commit02e53c084953399a5f73905085a109b61d9606c8 (patch)
tree7102a97b006d09b28acacd1e54c4af819f4ee1f3 /tests/volume.rc
parent5364a02d2dbb116952086958010ec508956b259b (diff)
posix: Do not update unmodified xattr in (f)xattrop
Backport of http://review.gluster.org/10886 If a (f)xattrop is issued with a value that only contains 0's, then we don't modify or create the extended attribute. This is useful to avoid ctime modifications when the only purpose of the xattrop was to get the current value. Change-Id: Ia62494e9009962e683c8276783f671da17a8b03a BUG: 1225320 Signed-off-by: Xavier Hernandez <xhernandez@datalab.es> Reviewed-on: http://review.gluster.org/10928 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'tests/volume.rc')
-rw-r--r--tests/volume.rc6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/volume.rc b/tests/volume.rc
index 9e01fff687d..5a7d0343a14 100644
--- a/tests/volume.rc
+++ b/tests/volume.rc
@@ -209,7 +209,11 @@ function check_option_help_presence {
function afr_get_changelog_xattr {
local file=$1
local xkey=$2
- getfattr -n $xkey -e hex $file 2>/dev/null | grep "$xkey" | cut -f2 -d'='
+ local xval=$(getfattr -n $xkey -e hex $file 2>/dev/null | grep "$xkey" | cut -f2 -d'=')
+ if [ -z $xval ]; then
+ xval="0x000000000000000000000000"
+ fi
+ echo $xval
}
function afr_get_pending_heal_count {