diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/lib/lvm/libmeta/common/meta_sp.c | 17 | ||||
-rw-r--r-- | usr/src/uts/common/io/lvm/md/md_mddb.c | 18 |
2 files changed, 31 insertions, 4 deletions
diff --git a/usr/src/lib/lvm/libmeta/common/meta_sp.c b/usr/src/lib/lvm/libmeta/common/meta_sp.c index c69c211f00..b71f867c51 100644 --- a/usr/src/lib/lvm/libmeta/common/meta_sp.c +++ b/usr/src/lib/lvm/libmeta/common/meta_sp.c @@ -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. */ @@ -237,7 +237,7 @@ static const sp_ext_offset_t NO_OFFSET = 0ULL; static const uint_t NO_SEQUENCE_NUMBER = 0; static const int ONE_SOFT_PARTITION = 1; -static unsigned long sp_parent_printed[BT_BITOUL(MD_MAXUNITS)]; +static unsigned long *sp_parent_printed[MD_MAXSETS]; #define TEST_SOFT_PARTITION_NAMEP NULL #define TEST_SETNAMEP NULL @@ -2279,6 +2279,8 @@ meta_sp_print( md_sp_t *msp; md_unit_t *mdp; int rval = 0; + set_t setno; + minor_t unit; /* should always have the same set */ assert(sp != NULL); @@ -2341,14 +2343,21 @@ meta_sp_print( if ((mdp = meta_get_mdunit(sp, msp->compnamep, ep)) == NULL) return (-1); + setno = MD_MIN2SET(MD_SID(mdp)); + unit = MD_MIN2UNIT(MD_SID(mdp)); + /* If info not already printed, recurse */ - if (!BT_TEST(sp_parent_printed, MD_MIN2UNIT(MD_SID(mdp)))) { + if (sp_parent_printed[setno] == NULL || + !BT_TEST(sp_parent_printed[setno], unit)) { if (meta_print_name(sp, msp->compnamep, nlpp, fname, fp, (options | PRINT_HEADER | PRINT_SUBDEVS), NULL, ep) != 0) { return (-1); } - BT_SET(sp_parent_printed, MD_MIN2UNIT(MD_SID(mdp))); + if (sp_parent_printed[setno] == NULL) + sp_parent_printed[setno] = + Zalloc(BT_BITOUL(MD_MAXUNITS)); + BT_SET(sp_parent_printed[setno], unit); } } return (0); diff --git a/usr/src/uts/common/io/lvm/md/md_mddb.c b/usr/src/uts/common/io/lvm/md/md_mddb.c index 7eabf9a95e..c1af22711f 100644 --- a/usr/src/uts/common/io/lvm/md/md_mddb.c +++ b/usr/src/uts/common/io/lvm/md/md_mddb.c @@ -9582,6 +9582,8 @@ mddb_getrecstatus( return (e_err); } +static int mddb_commitrec_retries = 5; + /* * Commit given record to disk. * If committing an optimized record, do not call @@ -9610,6 +9612,8 @@ mddb_commitrec( int i, j; int rval; int hit_err = 0; + int retry = mddb_commitrec_retries; + int gave_up = 0; s = mddb_setenter(DBSET(id), MDDB_NOINIT, NULL); ASSERT(s != NULL); @@ -9830,6 +9834,18 @@ mddb_commitrec( if (!(writeoptrecord(s, dep))) break; } + if (--retry == 0) { + cmn_err(CE_WARN, "mddb_commitrec: " + "giving up writing optimized " + "resync record for " + "diskset %s, device %s,%d " + "blkno 0x%x, flags 0x%x\n", + s->s_setname, recerr->r_driver_name, + recerr->r_mnum, recerr->r_blkno, + recerr->r_flags); + gave_up++; + break; + } } kmem_free(kres, sizeof (md_mn_kresult_t)); kmem_free(msg_recerr, @@ -9848,6 +9864,8 @@ mddb_commitrec( mddb_setexit(s); if (md_get_setstatus(s->s_setno) & MD_SET_TOOFEW) { return (MDDB_E_NOTNOW); + } else if (gave_up) { + return (MDDB_E_STALE); } else { return (0); } |