Deleted Added
full compact
spa.c (302408) spa.c (307045)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 1982 unchanged lines hidden (view full) ---

1991
1992 zio_nowait(zio_read(rio, spa, bp, data, size,
1993 spa_load_verify_done, rio->io_private, ZIO_PRIORITY_SCRUB,
1994 ZIO_FLAG_SPECULATIVE | ZIO_FLAG_CANFAIL |
1995 ZIO_FLAG_SCRUB | ZIO_FLAG_RAW, zb));
1996 return (0);
1997}
1998
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 1982 unchanged lines hidden (view full) ---

1991
1992 zio_nowait(zio_read(rio, spa, bp, data, size,
1993 spa_load_verify_done, rio->io_private, ZIO_PRIORITY_SCRUB,
1994 ZIO_FLAG_SPECULATIVE | ZIO_FLAG_CANFAIL |
1995 ZIO_FLAG_SCRUB | ZIO_FLAG_RAW, zb));
1996 return (0);
1997}
1998
1999/* ARGSUSED */
2000int
2001verify_dataset_name_len(dsl_pool_t *dp, dsl_dataset_t *ds, void *arg)
2002{
2003 char namebuf[MAXPATHLEN];
2004 dsl_dataset_name(ds, namebuf);
2005 if (strlen(namebuf) > MAXNAMELEN) {
2006 return (SET_ERROR(ENAMETOOLONG));
2007 }
2008
2009 return (0);
2010}
2011
1999static int
2000spa_load_verify(spa_t *spa)
2001{
2002 zio_t *rio;
2003 spa_load_error_t sle = { 0 };
2004 zpool_rewind_policy_t policy;
2005 boolean_t verify_ok = B_FALSE;
2006 int error = 0;
2007
2008 zpool_get_rewind_policy(spa->spa_config, &policy);
2009
2010 if (policy.zrp_request & ZPOOL_NEVER_REWIND)
2011 return (0);
2012
2012static int
2013spa_load_verify(spa_t *spa)
2014{
2015 zio_t *rio;
2016 spa_load_error_t sle = { 0 };
2017 zpool_rewind_policy_t policy;
2018 boolean_t verify_ok = B_FALSE;
2019 int error = 0;
2020
2021 zpool_get_rewind_policy(spa->spa_config, &policy);
2022
2023 if (policy.zrp_request & ZPOOL_NEVER_REWIND)
2024 return (0);
2025
2026 dsl_pool_config_enter(spa->spa_dsl_pool, FTAG);
2027 error = dmu_objset_find_dp(spa->spa_dsl_pool,
2028 spa->spa_dsl_pool->dp_root_dir_obj, verify_dataset_name_len, NULL,
2029 DS_FIND_CHILDREN);
2030 dsl_pool_config_exit(spa->spa_dsl_pool, FTAG);
2031 if (error != 0)
2032 return (error);
2033
2013 rio = zio_root(spa, NULL, &sle,
2014 ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE);
2015
2016 if (spa_load_verify_metadata) {
2017 error = traverse_pool(spa, spa->spa_verify_min_txg,
2018 TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA,
2019 spa_load_verify_cb, rio);
2020 }

--- 5249 unchanged lines hidden ---
2034 rio = zio_root(spa, NULL, &sle,
2035 ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE);
2036
2037 if (spa_load_verify_metadata) {
2038 error = traverse_pool(spa, spa->spa_verify_min_txg,
2039 TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA,
2040 spa_load_verify_cb, rio);
2041 }

--- 5249 unchanged lines hidden ---