From f86c618cd0943930c391e6bf55fdf977b3245f36 Mon Sep 17 00:00:00 2001 From: "M. Mohan Kumar" Date: Mon, 23 Dec 2013 16:27:42 +0530 Subject: bd: Check for capabilities for creating thin lv Check capabitlies of the volume before trying to create thin LV. BUG: 1028672 Change-Id: I1375f6f2a7576e223fc5d7cd40315999446db86a Signed-off-by: M. Mohan Kumar Reviewed-on: http://review.gluster.org/6577 Reviewed-by: Vijay Bellur Tested-by: Gluster Build System --- xlators/storage/bd/src/bd.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'xlators/storage/bd/src') diff --git a/xlators/storage/bd/src/bd.c b/xlators/storage/bd/src/bd.c index 17a9a5f15..4c3a7e14e 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 */ -- cgit