diff options
-rw-r--r-- | cli/gluster-block.c | 8 | ||||
-rw-r--r-- | docs/gluster-block.8 | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/cli/gluster-block.c b/cli/gluster-block.c index aca7de5..0196437 100644 --- a/cli/gluster-block.c +++ b/cli/gluster-block.c @@ -35,6 +35,7 @@ } \ } while(0) +# define GB_DEFAULT_SECTOR_SIZE 512 extern const char *argp_program_version; @@ -190,7 +191,7 @@ glusterBlockHelp(void) " [auth <enable|disable>]\n" " [prealloc <full|no>]\n" " <host1[,host2,...]> <size>\n" - " create block device [defaults: ha 1, auth disable, prealloc no]\n" + " create block device [defaults: ha 1, auth disable, prealloc no, size in bytes]\n" "\n" " list <volname>\n" " list available block devices.\n" @@ -408,6 +409,11 @@ glusterBlockCreate(int argcount, char **options, int json) LOG("cli", GB_LOG_ERROR, "failed while parsing size for block <%s/%s>", cobj.volume, cobj.block_name); goto out; + } else if (sparse_ret < GB_DEFAULT_SECTOR_SIZE) { + MSG("minimum acceptable block size is %d bytes\n", GB_DEFAULT_SECTOR_SIZE); + LOG("cli", GB_LOG_ERROR, "minimum acceptable block size is %d bytes <%s/%s>", + GB_DEFAULT_SECTOR_SIZE, cobj.volume, cobj.block_name); + goto out; } cobj.size = sparse_ret; /* size is unsigned long long */ diff --git a/docs/gluster-block.8 b/docs/gluster-block.8 index a23598f..39345a5 100644 --- a/docs/gluster-block.8 +++ b/docs/gluster-block.8 @@ -41,7 +41,7 @@ authentication setting (default: disable) servers in the pool where targets will be exported. .TP <BYTES> -size in KiB|MiB|GiB|TiB|PiB ... +size in B|KiB|MiB|GiB|TiB|PiB ... (default: bytes) .PP .SS |