]> git.proxmox.com Git - mirror_zfs.git/commit
Skip bad DVAs during free by setting zfs_recover=1
authorBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 12 Feb 2015 23:05:21 +0000 (15:05 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Sat, 14 Feb 2015 00:02:04 +0000 (16:02 -0800)
commit7d2868d5fc88a4c30769b44f56a3a88a4277a9ab
tree1549aac1284ba2ee63bd4924d5ca8eb1edd791eb
parentcbedd7b03443f5cf7db142908251251c765ce3a5
Skip bad DVAs during free by setting zfs_recover=1

When a bad DVA is encountered in metaslab_free_dva() the system
should treat it as fatal.  This indicates that somehow a damaged
DVA was written to disk and that should be impossible.

However, we have seen a handful of reports over the years of pools
somehow being damaged in this way.  Since this damage can render
otherwise intact pools unimportable, and the consequence of skipping
the bad DVA is only leaked free space, it makes sense to provide
a mechanism to ignore the bad DVA.  Setting the zfs_recover=1 module
option will cause the DVA to be ignored which may allow the pool to
be imported.

Since zfs_recover=0 by default any pool attempting to free a bad DVA
will treat it as a fatal error preserving the current behavior.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3099
Issue #3090
Issue #2720
module/zfs/metaslab.c