Date: Thu, 17 Jun 2010 22:38:23 +0000 (UTC) From: Martin Matuska <mm@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r209274 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Message-ID: <201006172238.o5HMcN0T069733@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mm Date: Thu Jun 17 22:38:23 2010 New Revision: 209274 URL: http://svn.freebsd.org/changeset/base/209274 Log: MFC r209093-r209101: MFC r209093: Fix unable to remove a file over NFS after hitting refquota limit OpenSolaris onnv rev: 8890:8c2bd5f17bf2 OpenSolaris Bug ID: 6798878 MFC r209094: Fix zfs destroy fails to free object in open context, stops up txg train OpenSolaris onnv rev: 9409:9dc3f17354ed OpenSolaris Bug ID: 6809683 MFC r209095: Fix incomplete resilvering after disk replacement (raidz) OpenSolaris onnv rev: 9434:3bebded7c76a OpenSolaris Bug ID: 6794570 MFC r209096: Fix vdev_probe() starvation brings txg train to a screeching halt OpenSolaris onnv rev: 9722:e3866bad4e96 OpenSolaris Bug ID: 6844069 MFC r209097: Fix ZFS panic deadlock: cycle in blocking chain via zfs_zget OpenSolaris onnv rev: 9774:0bb234ab2287 OpenSolaris Bug ID: 6788152 MFC r209098: Fix zpool resilver stalls with spa_scrub_thread in a 3 way deadlock OpenSolaris onnv rev: 9997:174d75a29a1c OpenSolaris Bug ID: 6843235 MFC r209099: Fix possible zfs panic on zpool import OpenSolaris onnv rev: 10040:38b25aeeaf7a OpenSolaris Bug ID: 6857012 MFC r209100: Fix panic in zfs_getsecattr OpenSolaris onnv rev: 10295:f7a18a1e9610 OpenSolaris Bug ID: 6870564 MFC r209101: Fix arc_read_done may try to byteswap undefined data (sparc related) OpenSolaris onnv rev: 10839:cf83b553a2ab OpenSolaris Bug ID: 6836714 Obtained from: OpenSolaris (multiple Bug IDs) Approved by: pjd, delphij (mentor) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jun 17 21:17:35 2010 (r209273) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Jun 17 22:38:23 2010 (r209274) @@ -2687,7 +2687,7 @@ arc_read_done(zio_t *zio) /* byteswap if necessary */ callback_list = hdr->b_acb; ASSERT(callback_list != NULL); - if (BP_SHOULD_BYTESWAP(zio->io_bp)) { + if (BP_SHOULD_BYTESWAP(zio->io_bp) && zio->io_error == 0) { arc_byteswap_func_t *func = BP_GET_LEVEL(zio->io_bp) > 0 ? byteswap_uint64_array : dmu_ot[BP_GET_TYPE(zio->io_bp)].ot_byteswap; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Thu Jun 17 21:17:35 2010 (r209273) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Thu Jun 17 22:38:23 2010 (r209274) @@ -582,9 +582,9 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o txh->txh_space_tooverwrite += SPA_MAXBLOCKSIZE; } else { txh->txh_space_towrite += SPA_MAXBLOCKSIZE; - txh->txh_space_tounref += - BP_GET_ASIZE(dn->dn_phys->dn_blkptr); } + if (dn->dn_phys->dn_blkptr[0].blk_birth) + txh->txh_space_tounref += SPA_MAXBLOCKSIZE; return; } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Jun 17 21:17:35 2010 (r209273) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Thu Jun 17 22:38:23 2010 (r209274) @@ -1317,16 +1317,7 @@ dnode_next_offset_level(dnode_t *dn, int for (i = (*offset >> span) & (blkfill - 1); i >= 0 && i < blkfill; i += inc) { - boolean_t newcontents = B_TRUE; - if (txg) { - int j; - newcontents = B_FALSE; - for (j = 0; j < dnp[i].dn_nblkptr; j++) { - if (dnp[i].dn_blkptr[j].blk_birth > txg) - newcontents = B_TRUE; - } - } - if (!dnp[i].dn_type == hole && newcontents) + if ((dnp[i].dn_type == DMU_OT_NONE) == hole) break; *offset += (1ULL << span) * inc; } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Thu Jun 17 21:17:35 2010 (r209273) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Thu Jun 17 22:38:23 2010 (r209274) @@ -96,7 +96,6 @@ dsl_dir_open_obj(dsl_pool_t *dp, uint64_ #endif if (dd == NULL) { dsl_dir_t *winner; - int err; dd = kmem_zalloc(sizeof (dsl_dir_t), KM_SLEEP); dd->dd_object = ddobj; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c Thu Jun 17 21:17:35 2010 (r209273) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c Thu Jun 17 22:38:23 2010 (r209274) @@ -1008,6 +1008,8 @@ dsl_pool_scrub_clean_cb(dsl_pool_t *dp, int dsl_pool_scrub_clean(dsl_pool_t *dp) { + spa_t *spa = dp->dp_spa; + /* * Purge all vdev caches. We do this here rather than in sync * context because this requires a writer lock on the spa_config @@ -1015,11 +1017,11 @@ dsl_pool_scrub_clean(dsl_pool_t *dp) * spa_scrub_reopen flag indicates that vdev_open() should not * attempt to start another scrub. */ - spa_config_enter(dp->dp_spa, SCL_ALL, FTAG, RW_WRITER); - dp->dp_spa->spa_scrub_reopen = B_TRUE; - vdev_reopen(dp->dp_spa->spa_root_vdev); - dp->dp_spa->spa_scrub_reopen = B_FALSE; - spa_config_exit(dp->dp_spa, SCL_ALL, FTAG); + spa_vdev_state_enter(spa); + spa->spa_scrub_reopen = B_TRUE; + vdev_reopen(spa->spa_root_vdev); + spa->spa_scrub_reopen = B_FALSE; + (void) spa_vdev_state_exit(spa, NULL, 0); return (dsl_pool_scrub_setup(dp, SCRUB_FUNC_CLEAN)); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Thu Jun 17 21:17:35 2010 (r209273) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Thu Jun 17 22:38:23 2010 (r209274) @@ -20,7 +20,7 @@ */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -697,7 +697,7 @@ vdev_raidz_io_start(zio_t *zio) continue; } if (c >= rm->rm_firstdatacol || rm->rm_missingdata > 0 || - (zio->io_flags & ZIO_FLAG_SCRUB)) { + (zio->io_flags & (ZIO_FLAG_SCRUB | ZIO_FLAG_RESILVER))) { zio_nowait(zio_vdev_child_io(zio, NULL, cvd, rc->rc_offset, rc->rc_data, rc->rc_size, zio->io_type, zio->io_priority, 0, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Jun 17 21:17:35 2010 (r209273) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Jun 17 22:38:23 2010 (r209274) @@ -1984,8 +1984,6 @@ zfs_getacl(znode_t *zp, vsecattr_t *vsec if (mask & VSA_ACE) { size_t aclsz; - zfs_acl_node_t *aclnode = list_head(&aclp->z_acl); - aclsz = count * sizeof (ace_t) + sizeof (ace_object_t) * largeace; @@ -1996,8 +1994,17 @@ zfs_getacl(znode_t *zp, vsecattr_t *vsec zfs_copy_fuid_2_ace(zp->z_zfsvfs, aclp, cr, vsecp->vsa_aclentp, !(mask & VSA_ACE_ALLTYPES)); else { - bcopy(aclnode->z_acldata, vsecp->vsa_aclentp, - count * sizeof (ace_t)); + zfs_acl_node_t *aclnode; + void *start = vsecp->vsa_aclentp; + + for (aclnode = list_head(&aclp->z_acl); aclnode; + aclnode = list_next(&aclp->z_acl, aclnode)) { + bcopy(aclnode->z_acldata, start, + aclnode->z_size); + start = (caddr_t)start + aclnode->z_size; + } + ASSERT((caddr_t)start - (caddr_t)vsecp->vsa_aclentp == + aclp->z_acl_bytes); } } if (mask & VSA_ACE_ACLFLAGS) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jun 17 21:17:35 2010 (r209273) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Thu Jun 17 22:38:23 2010 (r209274) @@ -2344,8 +2344,6 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i ZFS_VERIFY_ZP(zp); pzp = zp->z_phys; - mutex_enter(&zp->z_lock); - /* * If ACL is trivial don't bother looking for ACE_READ_ATTRIBUTES. * Also, if we are the owner don't bother, since owner should @@ -2355,7 +2353,6 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i (pzp->zp_uid != crgetuid(cr))) { if (error = zfs_zaccess(zp, ACE_READ_ATTRIBUTES, 0, skipaclchk, cr)) { - mutex_exit(&zp->z_lock); ZFS_EXIT(zfsvfs); return (error); } @@ -2366,6 +2363,7 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, i * than to determine whether we were asked the question. */ + mutex_enter(&zp->z_lock); vap->va_type = IFTOVT(pzp->zp_mode); vap->va_mode = pzp->zp_mode & ~S_IFMT; zfs_fuid_map_ids(zp, cr, &vap->va_uid, &vap->va_gid); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jun 17 21:17:35 2010 (r209273) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Jun 17 22:38:23 2010 (r209274) @@ -890,11 +890,11 @@ zio_taskq_dispatch(zio_t *zio, enum zio_ zio_type_t t = zio->io_type; /* - * If we're a config writer, the normal issue and interrupt threads - * may all be blocked waiting for the config lock. In this case, - * select the otherwise-unused taskq for ZIO_TYPE_NULL. + * If we're a config writer or a probe, the normal issue and + * interrupt threads may all be blocked waiting for the config lock. + * In this case, select the otherwise-unused taskq for ZIO_TYPE_NULL. */ - if (zio->io_flags & ZIO_FLAG_CONFIG_WRITER) + if (zio->io_flags & (ZIO_FLAG_CONFIG_WRITER | ZIO_FLAG_PROBE)) t = ZIO_TYPE_NULL; /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006172238.o5HMcN0T069733>