NetBSD-Bugs archive

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

Re: kern/41192: wapbl diagnostic panic during cgdconfig



The following reply was made to PR kern/41192; it has been noted by GNATS.

From: Alan Barrett <apb%cequrux.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/41192: wapbl diagnostic panic during cgdconfig
Date: Mon, 20 Apr 2009 09:42:18 +0200

 On Sun, 12 Apr 2009, apb%cequrux.com@localhost wrote:
 >      + cgdconfig /dev/cgd1d /dev/wd0e /etc/cgd/wd0e
 >      /dev/wd0e's passphrase: <enter passphrase here>
 >      cgd1: unable to open device, error = 16
 >      panic: kernel diagnostic assertion "rw_lock_held(&wl->wl_rwlock)"
 >      failed: file ".../kern/vfs_wapbl.c", line 1537
 
 If the root file system is mounted without wapbl, then this panic does
 not occur.
 
 >      stopped in pid 11.1 (cgdconfig) ...
 >      db{0}> bt
 >       breakpoint ... panic ... __kernassert ... wapbl_jlock_assert
 >       ... wapbl_add_buf ... bdwrite ... ffs_update ... ffs_full_sync
 >       ... ffs_fsync ... VOP_FSYNC ... vinvalbuf ... spec_close ...
 >       VOP_CLOSE ... vn_close ... vn_closefile ... closef ... fd_close
 >       ... syscall ...
 
 This is apparently when cgdconfig(8) calls close(2) on the fd that is
 open to /dev/wd0e, where /dev is on the root file system, and the root
 file system is ffs+wapbl.
 
 ffs_full_sync above is a typo for ffs_full_fsync.
 
 I have the following ideas:
 
   1) In the spec_close -> vinvalbuf -> VOP_FSYNC path, perhaps it would
      make sense to add the FSYNC_DATAONLY flag, since I see no obvious
      need for metadata such as the mtime of the device node to be synced
      when a block device is closed.  If this change were made, then
      ffs_full_fsync() would return before caling ffs_update(); see line
      445 of ffs_vnops.c:
        if ((flags & (FSYNC_DATAONLY | FSYNC_LAZY)) != 0)
 
   2) Do these lines in vfs_bios.c::bdwrite() need locking?
        913 if (wapbl_vphaswapbl(bp->b_vp)) {
        914         struct mount *mp = wapbl_vptomp(bp->b_vp);
        915
        916         if (bp->b_iodone != mp->mnt_wapbl_op->wo_wapbl_biodone) {
        917                 WAPBL_ADD_BUF(mp, bp);
        918         }
        919 }
 
 --apb (Alan Barrett)
 


Home | Main Index | Thread Index | Old Index