During mount a filesystem dataset would have the MS_RDONLY bit
incorrectly cleared even if the entire pool was read-only.
There is existing to code to handle this case but it was being run
before the property callbacks were registered. To resolve the
issue we move this read-only code after the callback registration.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1338
{
struct dsl_dataset *ds = NULL;
objset_t *os = zsb->z_os;
+ boolean_t do_readonly = B_FALSE;
int error = 0;
if (zfs_is_readonly(zsb) || !spa_writeable(dmu_objset_spa(os)))
- readonly_changed_cb(zsb, B_TRUE);
+ do_readonly = B_TRUE;
/*
* Register property callbacks.
if (error)
goto unregister;
+ if (do_readonly)
+ readonly_changed_cb(zsb, B_TRUE);
+
return (0);
unregister: