diff options
author | shishir gowda <shishirng@gluster.com> | 2011-05-02 05:08:39 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-05-11 19:18:08 -0700 |
commit | 276c0cecadbe763e98c5cfd18b3ad32822964789 (patch) | |
tree | 78057ddcabcd688c99fcdea84556a9b088393522 /xlators/cluster | |
parent | 0f020affb2cbbcf7c3a25f9f10fe8f14bf012b8e (diff) |
Validate stripe-block-size option
Minimum size is 512 bytes and should be a multiple of 512 bytes.
Signed-off-by: shishir gowda <shishirng@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2861 (Stripe block-size has no check for valid option)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2861
Diffstat (limited to 'xlators/cluster')
-rw-r--r-- | xlators/cluster/stripe/src/stripe.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index a06d275df..8f6790777 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -3750,6 +3750,18 @@ set_stripe_block_size (xlator_t *this, stripe_private_t *priv, char *data) "invalid number format \"%s\"", num); goto out; } + + if (stripe_opt->block_size < 512) { + gf_log (this->name, GF_LOG_ERROR, "Invalid Block-size: " + "%s. Should be atleast 512 bytes", num); + goto out; + } + if (stripe_opt->block_size % 512) { + gf_log (this->name, GF_LOG_ERROR, "Block-size: %s should" + " be a multiple of 512 bytes", num); + goto out; + } + memcpy (stripe_opt->path_pattern, pattern, strlen (pattern)); gf_log (this->name, GF_LOG_DEBUG, |