Mercurial > illumos > illumos-gate
comparison usr/src/uts/common/fs/zfs/zfs_vnops.c @ 13765:9410cf539b11
backout 3006: causes 3046 (panics after mounting root)
author | Richard Lowe <richlowe@richlowe.net> |
---|---|
date | Wed, 01 Aug 2012 16:40:39 -0400 |
parents | 38b4aca480b3 |
children | e3a9ae14a119 |
comparison
equal
deleted
inserted
replaced
13764:38b4aca480b3 | 13765:9410cf539b11 |
---|---|
18 * | 18 * |
19 * CDDL HEADER END | 19 * CDDL HEADER END |
20 */ | 20 */ |
21 /* | 21 /* |
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. | 22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
23 * Copyright (c) 2012 by Delphix. All rights reserved. | |
24 */ | 23 */ |
25 | |
26 | |
27 | |
28 | 24 |
29 /* Portions Copyright 2007 Jeremy Teo */ | 25 /* Portions Copyright 2007 Jeremy Teo */ |
30 /* Portions Copyright 2010 Robert Milkowski */ | 26 /* Portions Copyright 2010 Robert Milkowski */ |
31 | 27 |
32 #include <sys/types.h> | 28 #include <sys/types.h> |
1643 /* are there any extended attributes? */ | 1639 /* are there any extended attributes? */ |
1644 error = sa_lookup(zp->z_sa_hdl, SA_ZPL_XATTR(zfsvfs), | 1640 error = sa_lookup(zp->z_sa_hdl, SA_ZPL_XATTR(zfsvfs), |
1645 &xattr_obj, sizeof (xattr_obj)); | 1641 &xattr_obj, sizeof (xattr_obj)); |
1646 if (error == 0 && xattr_obj) { | 1642 if (error == 0 && xattr_obj) { |
1647 error = zfs_zget(zfsvfs, xattr_obj, &xzp); | 1643 error = zfs_zget(zfsvfs, xattr_obj, &xzp); |
1648 ASSERT0(error); | 1644 ASSERT3U(error, ==, 0); |
1649 dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_TRUE); | 1645 dmu_tx_hold_sa(tx, zp->z_sa_hdl, B_TRUE); |
1650 dmu_tx_hold_sa(tx, xzp->z_sa_hdl, B_FALSE); | 1646 dmu_tx_hold_sa(tx, xzp->z_sa_hdl, B_FALSE); |
1651 } | 1647 } |
1652 | 1648 |
1653 mutex_enter(&zp->z_lock); | 1649 mutex_enter(&zp->z_lock); |
1721 SA_ZPL_XATTR(zfsvfs), tx); | 1717 SA_ZPL_XATTR(zfsvfs), tx); |
1722 else | 1718 else |
1723 error = sa_update(zp->z_sa_hdl, | 1719 error = sa_update(zp->z_sa_hdl, |
1724 SA_ZPL_XATTR(zfsvfs), &null_xattr, | 1720 SA_ZPL_XATTR(zfsvfs), &null_xattr, |
1725 sizeof (uint64_t), tx); | 1721 sizeof (uint64_t), tx); |
1726 ASSERT0(error); | 1722 ASSERT3U(error, ==, 0); |
1727 } | 1723 } |
1728 mutex_enter(&vp->v_lock); | 1724 mutex_enter(&vp->v_lock); |
1729 vp->v_count--; | 1725 vp->v_count--; |
1730 ASSERT0(vp->v_count); | 1726 ASSERT3U(vp->v_count, ==, 0); |
1731 mutex_exit(&vp->v_lock); | 1727 mutex_exit(&vp->v_lock); |
1732 mutex_exit(&zp->z_lock); | 1728 mutex_exit(&zp->z_lock); |
1733 zfs_znode_delete(zp, tx); | 1729 zfs_znode_delete(zp, tx); |
1734 } else if (unlinked) { | 1730 } else if (unlinked) { |
1735 mutex_exit(&zp->z_lock); | 1731 mutex_exit(&zp->z_lock); |
3098 SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MODE(zfsvfs), NULL, | 3094 SA_ADD_BULK_ATTR(bulk, count, SA_ZPL_MODE(zfsvfs), NULL, |
3099 &new_mode, sizeof (new_mode)); | 3095 &new_mode, sizeof (new_mode)); |
3100 zp->z_mode = new_mode; | 3096 zp->z_mode = new_mode; |
3101 ASSERT3U((uintptr_t)aclp, !=, NULL); | 3097 ASSERT3U((uintptr_t)aclp, !=, NULL); |
3102 err = zfs_aclset_common(zp, aclp, cr, tx); | 3098 err = zfs_aclset_common(zp, aclp, cr, tx); |
3103 ASSERT0(err); | 3099 ASSERT3U(err, ==, 0); |
3104 if (zp->z_acl_cached) | 3100 if (zp->z_acl_cached) |
3105 zfs_acl_free(zp->z_acl_cached); | 3101 zfs_acl_free(zp->z_acl_cached); |
3106 zp->z_acl_cached = aclp; | 3102 zp->z_acl_cached = aclp; |
3107 aclp = NULL; | 3103 aclp = NULL; |
3108 } | 3104 } |
3621 if (error == 0) { | 3617 if (error == 0) { |
3622 szp->z_pflags |= ZFS_AV_MODIFIED; | 3618 szp->z_pflags |= ZFS_AV_MODIFIED; |
3623 | 3619 |
3624 error = sa_update(szp->z_sa_hdl, SA_ZPL_FLAGS(zfsvfs), | 3620 error = sa_update(szp->z_sa_hdl, SA_ZPL_FLAGS(zfsvfs), |
3625 (void *)&szp->z_pflags, sizeof (uint64_t), tx); | 3621 (void *)&szp->z_pflags, sizeof (uint64_t), tx); |
3626 ASSERT0(error); | 3622 ASSERT3U(error, ==, 0); |
3627 | 3623 |
3628 error = zfs_link_destroy(sdl, szp, tx, ZRENAMING, NULL); | 3624 error = zfs_link_destroy(sdl, szp, tx, ZRENAMING, NULL); |
3629 if (error == 0) { | 3625 if (error == 0) { |
3630 zfs_log_rename(zilog, tx, TX_RENAME | | 3626 zfs_log_rename(zilog, tx, TX_RENAME | |
3631 (flags & FIGNORECASE ? TX_CI : 0), sdzp, | 3627 (flags & FIGNORECASE ? TX_CI : 0), sdzp, |