summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorM. Mohan Kumar <mohan@in.ibm.com>2013-12-24 18:51:33 +0530
committerVijay Bellur <vbellur@redhat.com>2014-01-01 16:54:59 -0800
commite1dd28c5b74d9687f48c5bc315423b054fc4ec7f (patch)
treea8e12149518d9148a98b7ed578c1c70522718981
parent2b82cde22d808a70693d8368e1d87f91b30daf24 (diff)
bd: Check for capabilities for creating thin lv
Check capabitlies of the volume before trying to create thin LV. BUG: 1028672 Change-Id: Ie4e2281265e193458ccd16736960daf69d3e1b29 Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com> Reviewed-on: http://review.gluster.org/6590 Reviewed-by: Vijay Bellur <vbellur@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
-rw-r--r--xlators/storage/bd/src/bd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/storage/bd/src/bd.c b/xlators/storage/bd/src/bd.c
index 17a9a5f159a..4c3a7e14e65 100644
--- a/xlators/storage/bd/src/bd.c
+++ b/xlators/storage/bd/src/bd.c
@@ -1015,6 +1015,13 @@ bd_setx_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
goto out;
}
+ if (!strcmp (type, BD_THIN) && !(priv->caps & BD_CAPS_THIN)) {
+ gf_log (this->name, GF_LOG_WARNING, "THIN lv not supported by "
+ "this volume");
+ op_errno = EOPNOTSUPP;
+ goto out;
+ }
+
s_size = strtok_r (NULL, ":", &p);
/* If size not specified get default size */