summaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorMatthew Ahrens <[email protected]>2014-06-05 13:20:08 -0800
committerBrian Behlendorf <[email protected]>2014-08-04 11:50:52 -0700
commitfbeddd60b79690b6a6ececc9b00b6014d21405aa (patch)
tree67d3e5730537bc17cc5032d84864b3a9a10d3028 /include/sys
parent9b67f605601c77c814037613d8129562db642a29 (diff)
Illumos 4390 - I/O errors can corrupt space map when deleting fs/vol
4390 i/o errors when deleting filesystem/zvol can lead to space map corruption Reviewed by: George Wilson <[email protected]> Reviewed by: Christopher Siden <[email protected]> Reviewed by: Adam Leventhal <[email protected]> Reviewed by: Dan McDonald <[email protected]> Reviewed by: Saso Kiselkov <[email protected]> Approved by: Dan McDonald <[email protected]> References: https://www.illumos.org/issues/4390 https://github.com/illumos/illumos-gate/commit/7fd05ac Porting notes: Previous stack-reduction efforts in traverse_visitb() caused a fair number of un-mergable pieces of code. This patch should reduce its stack footprint a bit more. The new local bptree_entry_phys_t in bptree_add() is dynamically-allocated using kmem_zalloc() for the purpose of stack reduction. The new global zfs_free_leak_on_eio has been defined as an integer rather than a boolean_t as was the case with the related zfs_recover global. Also, zfs_free_leak_on_eio's definition has been inserted into zfs_debug.c for consistency with the existing definition of zfs_recover. Illumos placed it in spa_misc.c. Ported by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2545
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/bptree.h3
-rw-r--r--include/sys/dmu.h1
-rw-r--r--include/sys/dsl_dir.h1
-rw-r--r--include/sys/dsl_pool.h1
-rw-r--r--include/sys/dsl_scan.h1
-rw-r--r--include/sys/fs/zfs.h1
-rw-r--r--include/sys/zfs_debug.h1
7 files changed, 7 insertions, 2 deletions
diff --git a/include/sys/bptree.h b/include/sys/bptree.h
index 971507211..a533cb949 100644
--- a/include/sys/bptree.h
+++ b/include/sys/bptree.h
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright (c) 2013 by Delphix. All rights reserved.
*/
#ifndef _SYS_BPTREE_H
@@ -50,6 +50,7 @@ typedef int bptree_itor_t(void *arg, const blkptr_t *bp, dmu_tx_t *tx);
uint64_t bptree_alloc(objset_t *os, dmu_tx_t *tx);
int bptree_free(objset_t *os, uint64_t obj, dmu_tx_t *tx);
+boolean_t bptree_is_empty(objset_t *os, uint64_t obj);
void bptree_add(objset_t *os, uint64_t obj, blkptr_t *bp, uint64_t birth_txg,
uint64_t bytes, uint64_t comp, uint64_t uncomp, dmu_tx_t *tx);
diff --git a/include/sys/dmu.h b/include/sys/dmu.h
index 89a0e5bd7..aa3e8f25a 100644
--- a/include/sys/dmu.h
+++ b/include/sys/dmu.h
@@ -250,7 +250,6 @@ void zfs_znode_byteswap(void *buf, size_t size);
#define DMU_USERUSED_OBJECT (-1ULL)
#define DMU_GROUPUSED_OBJECT (-2ULL)
-#define DMU_DEADLIST_OBJECT (-3ULL)
/*
* artificial blkids for bonus buffer and spill blocks
diff --git a/include/sys/dsl_dir.h b/include/sys/dsl_dir.h
index d69d47696..3aa775232 100644
--- a/include/sys/dsl_dir.h
+++ b/include/sys/dsl_dir.h
@@ -144,6 +144,7 @@ void dsl_dir_set_reservation_sync_impl(dsl_dir_t *dd, uint64_t value,
#define ORIGIN_DIR_NAME "$ORIGIN"
#define XLATION_DIR_NAME "$XLATION"
#define FREE_DIR_NAME "$FREE"
+#define LEAK_DIR_NAME "$LEAK"
#ifdef ZFS_DEBUG
#define dprintf_dd(dd, fmt, ...) do { \
diff --git a/include/sys/dsl_pool.h b/include/sys/dsl_pool.h
index d5bad8dc1..34dc65ba4 100644
--- a/include/sys/dsl_pool.h
+++ b/include/sys/dsl_pool.h
@@ -87,6 +87,7 @@ typedef struct dsl_pool {
struct dsl_dir *dp_root_dir;
struct dsl_dir *dp_mos_dir;
struct dsl_dir *dp_free_dir;
+ struct dsl_dir *dp_leak_dir;
struct dsl_dataset *dp_origin_snap;
uint64_t dp_root_dir_obj;
struct taskq *dp_iput_taskq;
diff --git a/include/sys/dsl_scan.h b/include/sys/dsl_scan.h
index bcb85d67d..de6a7d17a 100644
--- a/include/sys/dsl_scan.h
+++ b/include/sys/dsl_scan.h
@@ -116,6 +116,7 @@ typedef struct dsl_scan {
/* for freeing blocks */
boolean_t scn_is_bptree;
boolean_t scn_async_destroying;
+ boolean_t scn_async_stalled;
/* for debugging / information */
uint64_t scn_visited_this_txg;
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h
index 5371e12ef..227d8b2fb 100644
--- a/include/sys/fs/zfs.h
+++ b/include/sys/fs/zfs.h
@@ -193,6 +193,7 @@ typedef enum {
ZPOOL_PROP_COMMENT,
ZPOOL_PROP_EXPANDSZ,
ZPOOL_PROP_FREEING,
+ ZPOOL_PROP_LEAKED,
ZPOOL_NUM_PROPS
} zpool_prop_t;
diff --git a/include/sys/zfs_debug.h b/include/sys/zfs_debug.h
index e51207955..829b37a46 100644
--- a/include/sys/zfs_debug.h
+++ b/include/sys/zfs_debug.h
@@ -48,6 +48,7 @@ extern "C" {
extern int zfs_flags;
extern int zfs_recover;
+extern int zfs_free_leak_on_eio;
#define ZFS_DEBUG_DPRINTF (1<<0)
#define ZFS_DEBUG_DBUF_VERIFY (1<<1)