Mercurial > illumos > illumos-gate
diff usr/src/uts/common/fs/zfs/zfs_vfsops.c @ 9788:f660bc44f2e8
6843700 zfs_znode_move() does not ensure valid file system pointer
author | Tom Erickson <Tom.Erickson@Sun.COM> |
---|---|
date | Thu, 04 Jun 2009 13:01:01 -0700 |
parents | 105f407a2680 |
children | 83c3a84aecef |
line wrap: on
line diff
--- a/usr/src/uts/common/fs/zfs/zfs_vfsops.c Thu Jun 04 15:16:57 2009 -0400 +++ b/usr/src/uts/common/fs/zfs/zfs_vfsops.c Thu Jun 04 13:01:01 2009 -0700 @@ -1037,6 +1037,16 @@ zfsvfs_free(zfsvfs_t *zfsvfs) { int i; + extern krwlock_t zfsvfs_lock; /* in zfs_znode.c */ + + /* + * This is a barrier to prevent the filesystem from going away in + * zfs_znode_move() until we can safely ensure that the filesystem is + * not unmounted. We consider the filesystem valid before the barrier + * and invalid after the barrier. + */ + rw_enter(&zfsvfs_lock, RW_READER); + rw_exit(&zfsvfs_lock); zfs_fuid_destroy(zfsvfs);