NetBSD Problem Report #52045

From www@NetBSD.org  Tue Mar  7 08:02:45 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id C2D3D7A1BE
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  7 Mar 2017 08:02:45 +0000 (UTC)
Message-Id: <20170307080244.9DC617A27B@mollari.NetBSD.org>
Date: Tue,  7 Mar 2017 08:02:44 +0000 (UTC)
From: ozaki-r@netbsd.org
Reply-To: ozaki-r@netbsd.org
To: gnats-bugs@NetBSD.org
Subject: panic: ffs_sync: rofs mod, fs=/ after fsck
X-Send-Pr-Version: www-1.0

>Number:         52045
>Category:       kern
>Synopsis:       panic: ffs_sync: rofs mod, fs=/ after fsck
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Mar 07 08:05:00 +0000 2017
>Closed-Date:    Wed Mar 08 05:32:56 +0000 2017
>Last-Modified:  Thu Feb 28 13:33:28 +0000 2019
>Originator:     Ryota Ozaki
>Release:        -current
>Organization:
>Environment:
NetBSD kvm 7.99.64 NetBSD 7.99.64 (KVM) #808: Fri Mar  3 14:10:00 JST 2017  ozaki-r@rangeley:(hidden) amd64
NetBSD kvm 7.99.65 NetBSD 7.99.65 (KVM) #824: Tue Mar  7 11:09:30 JST 2017  ozaki-r@rangeley:(hidden) amd64
>Description:
A kernel of -current failed to boot up with the panic:

  panic: ffs_sync: rofs mod, fs=/
  fatal breakpoint trap in supervisor mode
  trap type 1 code 0 rip ffffffff80215455 cs 8 rflags 246 cr2 7f7ff6cf38cc ilevel 0 rsp fffffe80036dbd80
  curlwp 0xfffffe803fa1b2e0 pid 0.76 lowest kstack 0xfffffe80036d82c0
  Stopped in pid 0.76 (system) at netbsd:breakpoint+0x5:  leave
  db{1}> bt    
  breakpoint() at netbsd:breakpoint+0x5
  vpanic() at netbsd:vpanic+0x140
  panic() at netbsd:panic+0x3c
  ffs_sync() at netbsd:ffs_sync+0x26b
  VFS_SYNC() at netbsd:VFS_SYNC+0x1c
  sched_sync() at netbsd:sched_sync+0x27b
  db{1}>

The panic happens after fsck ("Starting root file system check:") runs
and does something. If fsck does nothing, the panic doesn't happen.

The panic doesn't happen with a kernel of -current at 2/28-ish and
happen with one at 3/3-ish. IOW 7.99.63 is ok, but 7.99.64 isn't.

You can find other examples of the panic at http://mail-index.netbsd.org/current-users/2017/03/05/msg031260.html .

>How-To-Repeat:
- Make the filesystem unclean
  - By reseting the machine, entering the DDB and rebooting from it, or whatever
- Boot up the machine
- See what happens

You may need several trials to cause the panic.
>Fix:
n/a

>Release-Note:

>Audit-Trail:
From: "Juergen Hannken-Illjes" <hannken@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52045 CVS commit: src/sys/kern
Date: Tue, 7 Mar 2017 11:54:17 +0000

 Module Name:	src
 Committed By:	hannken
 Date:		Tue Mar  7 11:54:17 UTC 2017

 Modified Files:
 	src/sys/kern: vfs_syscalls.c

 Log Message:
 Fix a logic error introduced with Rev. 1.507: defer setting MNT_RDONLY
 only if going from read-write to read-only.

 Should fix PR kern/52045 (panic: ffs_sync: rofs mod, fs=/ after fsck)


 To generate a diff of this commit:
 cvs rdiff -u -r1.508 -r1.509 src/sys/kern/vfs_syscalls.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: ozaki-r@NetBSD.org
State-Changed-When: Wed, 08 Mar 2017 05:32:56 +0000
State-Changed-Why:
The panic disappeared by the fix. Thanks!

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.