zfs/cmd
Ned Bass 3ee56c292b Make rollbacks fail gracefully
Support for rolling back datasets require a functional ZPL, which we currently
do not have.  The zfs command does not check for ZPL support before attempting
a rollback, and in preparation for rolling back a zvol it removes the minor
node of the device.  To prevent the zvol device node from disappearing after a
failed rollback operation, this change wraps the zfs_do_rollback() function in
an #ifdef HAVE_ZPL and returns ENOSYS in the absence of a ZPL.  This is
consistent with the behavior of other ZPL dependent commands such as mount.

The orginal error message observed with this bug was rather confusing:

    internal error: Unknown error 524
    Aborted

This was because zfs_ioc_rollback() returns ENOTSUP if we don't HAVE_ZPL, but
Linux actually has no such error code.  It should instead return EOPNOTSUPP, as
that is how ENOTSUP is defined in user space.  With that we would have gotten
the somewhat more helpful message

    cannot rollback 'tank/fish': unsupported version

This is rather a moot point with the above changes since we will no longer make
that ioctl call without a ZPL.  But, this change updates the error code just in
case.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
2010-11-08 14:03:36 -08:00
..
zdb Add FAILFAST support 2010-10-12 14:55:02 -07:00
zfs Make rollbacks fail gracefully 2010-11-08 14:03:36 -08:00
zinject Add FAILFAST support 2010-10-12 14:55:02 -07:00
zpios Add FAILFAST support 2010-10-12 14:55:02 -07:00
zpool Fix intermittent 'zpool add' failures 2010-10-22 12:38:58 -07:00
zpool_id Add FAILFAST support 2010-10-12 14:55:02 -07:00
zpool_layout Add FAILFAST support 2010-10-12 14:55:02 -07:00
ztest Add FAILFAST support 2010-10-12 14:55:02 -07:00
Makefile.am Add linux zpios support 2010-08-31 13:42:01 -07:00
Makefile.in Add FAILFAST support 2010-10-12 14:55:02 -07:00