NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/47020: fss(4) panic
The following reply was made to PR kern/47020; it has been noted by GNATS.
From: "J. Hannken-Illjes" <hannken%eis.cs.tu-bs.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: kern/47020: fss(4) panic
Date: Sun, 20 Jan 2013 10:11:52 +0100
--Apple-Mail=_2713A985-26FE-4C89-BCCB-EC1063C2ED44
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii
This assertion fires when creating an external snapshot of
the root file system.
Manuel, please try the attached patch.
--
J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig
(Germany)
--Apple-Mail=_2713A985-26FE-4C89-BCCB-EC1063C2ED44
Content-Disposition: attachment;
filename=fss.c.diff
Content-Type: application/octet-stream;
name="fss.c.diff"
Content-Transfer-Encoding: 7bit
Index: fss.c
===================================================================
RCS file: /cvsroot/src/sys/dev/fss.c,v
retrieving revision 1.83
diff -p -u -2 -r1.83 fss.c
--- fss.c 28 Jul 2012 16:14:17 -0000 1.83
+++ fss.c 20 Jan 2013 09:07:40 -0000
@@ -622,5 +622,5 @@ fss_create_files(struct fss_softc *sc, s
off_t *bsize, struct lwp *l)
{
- int error, bits, fsbsize;
+ int i, error, bits, fsbsize;
uint64_t numsec;
unsigned int secsize;
@@ -693,23 +693,29 @@ fss_create_files(struct fss_softc *sc, s
/*
- * Get the block device it is mounted on.
+ * Get the block device it is mounted on and its size.
*/
- error = namei_simple_kernel(sc->sc_mount->mnt_stat.f_mntfromname,
- NSM_FOLLOW_NOEMULROOT, &vp);
- if (error != 0)
- return error;
-
- if (vp->v_type != VBLK) {
- vrele(vp);
+ mutex_enter(&device_lock);
+ for (i = 0; i < SPECHSZ; i++) {
+ for (vp = specfs_hash[i]; vp; vp = vp->v_specnext) {
+ if (vp->v_type == VBLK &&
+ vp == vp->v_specnode->sn_dev->sd_bdevvp &&
+ vp->v_specmountpoint == sc->sc_mount)
+ break;
+ }
+ if (vp != NULL)
+ break;
+ }
+ if (vp == NULL) {
+ mutex_exit(&device_lock);
return EINVAL;
}
-
+ mutex_enter(vp->v_interlock);
+ mutex_exit(&device_lock);
+ error = vget(vp, 0);
+ if (error)
+ return error;
sc->sc_bdev = vp->v_rdev;
- /*
- * Get the block device size.
- */
-
error = getdisksize(vp, &numsec, &secsize);
vrele(vp);
--Apple-Mail=_2713A985-26FE-4C89-BCCB-EC1063C2ED44--
Home |
Main Index |
Thread Index |
Old Index