Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/ffs PR/39371: Tobias Nygren: Don't fail mounting roo...



details:   https://anonhg.NetBSD.org/src/rev/3d4b1a20aadd
branches:  trunk
changeset: 335576:3d4b1a20aadd
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jan 16 03:57:52 2015 +0000

description:
PR/39371: Tobias Nygren: Don't fail mounting root if WAPBL log is corrupt.
Patch from Sergio L. Pascual.
XXX: pullup-7

diffstat:

 sys/ufs/ffs/ffs_vfsops.c |  21 +++++++++++++--------
 1 files changed, 13 insertions(+), 8 deletions(-)

diffs (44 lines):

diff -r 0b33c28e57a0 -r 3d4b1a20aadd sys/ufs/ffs/ffs_vfsops.c
--- a/sys/ufs/ffs/ffs_vfsops.c  Fri Jan 16 03:45:53 2015 +0000
+++ b/sys/ufs/ffs/ffs_vfsops.c  Fri Jan 16 03:57:52 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_vfsops.c,v 1.304 2014/12/14 01:13:57 christos Exp $        */
+/*     $NetBSD: ffs_vfsops.c,v 1.305 2015/01/16 03:57:52 christos Exp $        */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.304 2014/12/14 01:13:57 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.305 2015/01/16 03:57:52 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
@@ -585,14 +585,19 @@
                        fs->fs_fmod = 1;
 #ifdef WAPBL
                        if (fs->fs_flags & FS_DOWAPBL) {
-                               printf("%s: replaying log to disk\n",
-                                   mp->mnt_stat.f_mntonname);
-                               KDASSERT(mp->mnt_wapbl_replay);
+                               const char *nm = mp->mnt_stat.f_mntonname;
+                               if (!mp->mnt_wapbl_replay) {
+                                       printf("%s: log corrupted;"
+                                           " replay cancelled\n", nm);
+                                       return EFTYPE;
+                               }
+                               printf("%s: replaying log to disk\n", nm);
                                error = wapbl_replay_write(mp->mnt_wapbl_replay,
-                                                          devvp);
+                                   devvp);
                                if (error) {
-                                       DPRINTF(("%s: wapbl_replay_write %d\n",
-                                           __func__, error));
+                                       DPRINTF((
+                                           "%s: %s: wapbl_replay_write %d\n",
+                                           __func__, nm, error));
                                        return error;
                                }
                                wapbl_replay_stop(mp->mnt_wapbl_replay);



Home | Main Index | Thread Index | Old Index