don't allow stripe with just one subvolume

stripe code assumes in many places that it will have more than one subvolume,
but the strict check was not there in init, hence, if somebody configures stripe
with just one subvolume, it will cause many fops with frame loss.

Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>

BUG: 340 (Kernel Compilation fail in stripe)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=340
This commit is contained in:
Amar Tumballi 2009-11-26 03:29:46 +00:00 committed by Anand V. Avati
parent d1f3cdc4dc
commit b80fac5417

View File

@ -3661,7 +3661,13 @@ init (xlator_t *this)
gf_log (this->name, GF_LOG_WARNING,
"dangling volume. check volfile ");
}
if (count == 1) {
gf_log (this->name, GF_LOG_ERROR,
"stripe configured with only one \"subvolumes\" option."
" please check the volume. exiting");
goto out;
}
priv = CALLOC (1, sizeof (stripe_private_t));
if (!priv)
goto out;