]> granicus.if.org Git - zfs/commitdiff
Propagate errors when registering "relatime" property callback.
authorTim Chase <tim@chase2k.com>
Tue, 11 Feb 2014 13:34:17 +0000 (07:34 -0600)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 12 Feb 2014 17:38:28 +0000 (09:38 -0800)
Various errors can occur when registering property callbacks.  As the
author's comments indicate, the code is very paranoid about preserving
the first-seen error when registering callbacks.  This patch causes an
error seen while registering the "relatime" callback to not clobber a
previously-seen error.

Reported-by: Jorgen Lundman <lundman@lundman.net>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2117

module/zfs/zfs_vfsops.c

index ec59bfbd84b8cc48ec7309a9414b8de9e8e7b0cc..a27ac694d5e3c468f84b07214326f1bfd61abe72 100644 (file)
@@ -281,7 +281,7 @@ zfs_register_callbacks(zfs_sb_t *zsb)
        dsl_pool_config_enter(dmu_objset_pool(os), FTAG);
        error = dsl_prop_register(ds,
            zfs_prop_to_name(ZFS_PROP_ATIME), atime_changed_cb, zsb);
-       error = dsl_prop_register(ds,
+       error = error ? error : dsl_prop_register(ds,
            zfs_prop_to_name(ZFS_PROP_RELATIME), relatime_changed_cb, zsb);
        error = error ? error : dsl_prop_register(ds,
            zfs_prop_to_name(ZFS_PROP_XATTR), xattr_changed_cb, zsb);