summaryrefslogtreecommitdiffstats
path: root/xlators/storage/posix/src/posix-common.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2018-02-11 06:54:35 +0530
committerAmar Tumballi <amarts@redhat.com>2018-02-19 14:57:12 +0000
commit6daa6535692b2c68b493636a9bbfdcbc475b3d80 (patch)
tree7df7839a468dd544103b3e0bc752da718db04fa8 /xlators/storage/posix/src/posix-common.c
parente80c10d5e6fb97e132ff7f1c2846629fb5ad915f (diff)
posix/afr: handle backward compatibility for rchecksum fop
Added a volume option 'fips-mode-rchecksum' tied to op version 4. If not set, rchecksum fop will use MD5 instead of SHA256. updates: #230 Change-Id: Id8ea1303777e6450852c0bc25503cda341a6aec2 Signed-off-by: Ravishankar N <ravishankar@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-common.c')
-rw-r--r--xlators/storage/posix/src/posix-common.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix-common.c b/xlators/storage/posix/src/posix-common.c
index a67b3d7..f1fa81e 100644
--- a/xlators/storage/posix/src/posix-common.c
+++ b/xlators/storage/posix/src/posix-common.c
@@ -387,6 +387,9 @@ posix_reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("max-hardlinks", priv->max_hardlinks,
options, uint32, out);
+
+ GF_OPTION_RECONF ("fips-mode-rchecksum", priv->fips_mode_rchecksum,
+ options, bool, out);
ret = 0;
out:
return ret;
@@ -1076,6 +1079,9 @@ posix_init (xlator_t *this)
_private->create_directory_mask = create_directory_mask;
GF_OPTION_INIT ("max-hardlinks", _private->max_hardlinks, uint32, out);
+
+ GF_OPTION_INIT ("fips-mode-rchecksum", _private->fips_mode_rchecksum,
+ bool, out);
out:
if (ret) {
if (_private) {
@@ -1362,5 +1368,15 @@ struct volume_options options[] = {
.description = "max number of hardlinks allowed on any one inode.\n"
"0 is unlimited, 1 prevents any hardlinking at all."
},
+ {
+ .key = {"fips-mode-rchecksum"},
+ .type = GF_OPTION_TYPE_BOOL,
+ .default_value = "off",
+ .op_version = {GD_OP_VERSION_4_0_0},
+ .flags = OPT_FLAG_SETTABLE,
+ .tags = {"posix"},
+ .description = "If enabled, posix_rchecksum uses the FIPS compliant"
+ "SHA256 checksum. MD5 otherwise."
+ },
{ .key = {NULL} }
};