diff options
author | Brian Behlendorf <[email protected]> | 2013-07-17 09:15:46 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2013-07-17 09:22:23 -0700 |
commit | c9ada6d5a00ba66fd54d62b4a1684e561fe2c9a4 (patch) | |
tree | 967ba0391eee1d532474cc87c720e7a26c6d8379 /module/zfs/zfs_vfsops.c | |
parent | 76351672c222f28ea1b681097a9eff58a6791555 (diff) |
Fix read-only pool hang on unmount
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 <[email protected]>
Closes #1338
Diffstat (limited to 'module/zfs/zfs_vfsops.c')
-rw-r--r-- | module/zfs/zfs_vfsops.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/module/zfs/zfs_vfsops.c b/module/zfs/zfs_vfsops.c index 602c332ea..9ae7ab500 100644 --- a/module/zfs/zfs_vfsops.c +++ b/module/zfs/zfs_vfsops.c @@ -233,10 +233,11 @@ zfs_register_callbacks(zfs_sb_t *zsb) { 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. @@ -271,6 +272,9 @@ zfs_register_callbacks(zfs_sb_t *zsb) if (error) goto unregister; + if (do_readonly) + readonly_changed_cb(zsb, B_TRUE); + return (0); unregister: |