.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd April 19, 2011
+.Dd August 14, 2012
.Dt HAMMER 5
.Os
.Sh NAME
file systems will be brought back into a fully coherent state
when mounting the file system, usually within a few seconds.
.Pp
+In the unlikely case
+.Nm
+mount fails due redo recovery (stage 2 recovery) being corrupted, a
+workaround to skip this stage can be applied by setting the following tunable:
+.Bd -literal -offset indent
+vfs.hammer.skip_redo=<value>
+.Ed
+.Pp
+Possible values are:
+.Bl -tag -width indent
+.It 0
+Run redo recovery normally and fail to mount in the case of error (default).
+.It 1
+Run redo recovery but continue mounting if an error appears.
+.It 2
+Completely bypass redo recovery.
+.El
+.Pp
Related commands:
.Xr mount_hammer 8
.Ss Large File Systems & Multi Volume
extern struct vop_ops hammer_fifo_vops;
extern struct bio_ops hammer_bioops;
+extern int hammer_skip_redo;
extern int hammer_debug_io;
extern int hammer_debug_general;
extern int hammer_debug_debug;
#include "hammer.h"
/*
+ * Specify the way we want to handle stage2 errors.
+ *
+ * Following values are accepted:
+ *
+ * 0 - Run redo recovery normally and fail to mount if
+ * the operation fails (default).
+ * 1 - Run redo recovery, but don't fail to mount if the
+ * operation fails.
+ * 2 - Completely skip redo recovery (only for severe error
+ * conditions and/or debugging.
+ */
+int hammer_skip_redo = 0;
+TUNABLE_INT("vfs.hammer.skip_redo", &hammer_skip_redo);
+
+/*
* Each rterm entry has a list of fifo offsets indicating termination
* points. These are stripped as the scan progresses.
*/
KKASSERT(hmp->ronly == 0);
RB_INIT(&rterm_root);
+ if (hammer_skip_redo == 1)
+ kprintf("HAMMER(%s) recovery redo marked as optional\n",
+ root_volume->ondisk->vol_name);
+
+ if (hammer_skip_redo == 2) {
+ kprintf("HAMMER(%s) recovery redo skipped.\n",
+ root_volume->ondisk->vol_name);
+ return (0);
+ }
+
/*
* Examine the UNDO FIFO. If it is empty the filesystem is clean
* and no action need be taken.
kprintf("HAMMER(%s) End redo recovery\n",
root_volume->ondisk->vol_name);
}
- return (error);
+
+ if (error && hammer_skip_redo == 1)
+ kprintf("HAMMER(%s) recovery redo error %d, "
+ " skipping.\n", root_volume->ondisk->vol_name,
+ error);
+
+ return (hammer_skip_redo ? 0 : error);
}
/*