Fix error handling for "zpool online -e".
authorEtienne Dechamps <etienne.dechamps@ovh.net>
Fri, 6 Jul 2012 13:44:14 +0000 (15:44 +0200)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 12 Jul 2012 15:58:19 +0000 (08:58 -0700)
commit8adf48642253c2ef9571ece5b233e0bf1f0217a8
tree1ec425d52a1f5490e41f56421244fd340f46ec28
parentc7f2d69de397b02cc803f541dd2d405e0c284e76
Fix error handling for "zpool online -e".

The error handling code around zpool_relabel_disk() is either inexistent
or wrong. The function call itself is not checked, and
zpool_relabel_disk() is generating error messages from an unitialized
buffer.

Before:

    # zpool online -e homez sdb; echo $?
    `: cannot relabel 'sdb1': unable to open device: 2
    0

After:

    # zpool online -e homez sdb; echo $?
    cannot expand sdb: cannot relabel 'sdb1': unable to open device: 2
    1

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #808
lib/libzfs/libzfs_pool.c