summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/fs/zfs/zfs_vfsops.c
diff options
context:
space:
mode:
authorNeil Perrin <Neil.Perrin@Sun.COM>2008-09-18 17:18:10 -0600
committerNeil Perrin <Neil.Perrin@Sun.COM>2008-09-18 17:18:10 -0600
commita6e57bd4c7a2bf9cc33be939d674d4c7d3e67cce (patch)
treead4ace2ad4611c1dba1a700fb23f196912165c5f /usr/src/uts/common/fs/zfs/zfs_vfsops.c
parentef18c5ec8528dd90b6150e9cd33c26cf8894be02 (diff)
downloadillumos-gate-a6e57bd4c7a2bf9cc33be939d674d4c7d3e67cce.tar.gz
6741237 zfs hang in txg_wait_open() on boot
Diffstat (limited to 'usr/src/uts/common/fs/zfs/zfs_vfsops.c')
-rw-r--r--usr/src/uts/common/fs/zfs/zfs_vfsops.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/usr/src/uts/common/fs/zfs/zfs_vfsops.c b/usr/src/uts/common/fs/zfs/zfs_vfsops.c
index ed23be8dd7..3ee726bb29 100644
--- a/usr/src/uts/common/fs/zfs/zfs_vfsops.c
+++ b/usr/src/uts/common/fs/zfs/zfs_vfsops.c
@@ -23,8 +23,6 @@
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
@@ -559,7 +557,6 @@ unregister:
static int
zfsvfs_setup(zfsvfs_t *zfsvfs, boolean_t mounting)
{
- uint_t readonly;
int error;
error = zfs_register_callbacks(zfsvfs->z_vfs);
@@ -579,44 +576,22 @@ zfsvfs_setup(zfsvfs_t *zfsvfs, boolean_t mounting)
* operations out since we closed the ZIL.
*/
if (mounting) {
+ boolean_t readonly;
+
/*
* During replay we remove the read only flag to
* allow replays to succeed.
*/
readonly = zfsvfs->z_vfs->vfs_flag & VFS_RDONLY;
- if (readonly != 0)
- zfsvfs->z_vfs->vfs_flag &= ~VFS_RDONLY;
- else
- zfs_unlinked_drain(zfsvfs);
+ zfsvfs->z_vfs->vfs_flag &= ~VFS_RDONLY;
/*
* Parse and replay the intent log.
- *
- * Because of ziltest, this must be done after
- * zfs_unlinked_drain(). (Further note: ziltest doesn't
- * use readonly mounts, where zfs_unlinked_drain() isn't
- * called.) This is because ziltest causes spa_sync()
- * to think it's committed, but actually it is not, so
- * the intent log contains many txg's worth of changes.
- *
- * In particular, if object N is in the unlinked set in
- * the last txg to actually sync, then it could be
- * actually freed in a later txg and then reallocated in
- * a yet later txg. This would write a "create object
- * N" record to the intent log. Normally, this would be
- * fine because the spa_sync() would have written out
- * the fact that object N is free, before we could write
- * the "create object N" intent log record.
- *
- * But when we are in ziltest mode, we advance the "open
- * txg" without actually spa_sync()-ing the changes to
- * disk. So we would see that object N is still
- * allocated and in the unlinked set, and there is an
- * intent log record saying to allocate it.
*/
zil_replay(zfsvfs->z_os, zfsvfs, &zfsvfs->z_assign,
- zfs_replay_vector);
+ zfs_replay_vector, zfs_unlinked_drain);
+ zfs_unlinked_drain(zfsvfs);
zfsvfs->z_vfs->vfs_flag |= readonly; /* restore readonly bit */
}