NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/39405: ffs snapshot triggers KASSERT(vp == vp->v_specnode->sn_dev->sd_bdevvp)
The following reply was made to PR kern/39405; it has been noted by GNATS.
From: Juergen Hannken-Illjes <hannken%eis.cs.tu-bs.de@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: Manuel Bouyer <bouyer%antioche.lip6.fr@localhost>
Subject: Re: kern/39405: ffs snapshot triggers KASSERT(vp ==
vp->v_specnode->sn_dev->sd_bdevvp)
Date: Tue, 26 Aug 2008 12:33:52 +0200
On Mon, Aug 25, 2008 at 04:10:00PM +0000, Manuel Bouyer wrote:
> >Number: 39405
> >Category: kern
> >Synopsis: ffs snapshot triggers KASSERT(vp ==
> >vp->v_specnode->sn_dev->sd_bdevvp)
Please try the diff attached ...
--
Juergen Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig
(Germany)
Index: fss.c
===================================================================
RCS file: /cvsroot/src/sys/dev/fss.c,v
retrieving revision 1.51
diff -p -u -2 -r1.51 fss.c
--- fss.c 15 Aug 2008 10:31:24 -0000 1.51
+++ fss.c 26 Aug 2008 10:29:40 -0000
@@ -537,4 +537,5 @@ fss_create_files(struct fss_softc *sc, s
{
int error, bits, fsbsize;
+ const struct bdevsw *bdev;
struct timespec ts;
struct partinfo dpart;
@@ -609,13 +610,19 @@ fss_create_files(struct fss_softc *sc, s
}
- error = VOP_IOCTL(nd.ni_vp, DIOCGPART, &dpart, FREAD, l->l_cred);
- if (error) {
- vrele(nd.ni_vp);
+ sc->sc_bdev = nd.ni_vp->v_rdev;
+ vrele(nd.ni_vp);
+
+ /*
+ * Get the block device size.
+ */
+
+ bdev = bdevsw_lookup(sc->sc_bdev);
+ if (bdev == NULL)
+ return ENXIO;
+ error = (*bdev->d_ioctl)(sc->sc_bdev, DIOCGPART, &dpart, FREAD, l);
+ if (error)
return error;
- }
- sc->sc_bdev = nd.ni_vp->v_rdev;
*bsize = (off_t)dpart.disklab->d_secsize*dpart.part->p_size;
- vrele(nd.ni_vp);
/*
Home |
Main Index |
Thread Index |
Old Index