From owner-freebsd-current Mon Oct 13 04:22:09 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id EAA14482 for current-outgoing; Mon, 13 Oct 1997 04:22:09 -0700 (PDT) (envelope-from owner-freebsd-current) Received: from schizo.dk.tfs.com (mail.trw.dk [195.8.133.123]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id EAA14449 for ; Mon, 13 Oct 1997 04:21:51 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (critter.dk.tfs.com [140.145.230.252]) by schizo.dk.tfs.com (8.8.7/8.7.3) with ESMTP id NAA03276; Mon, 13 Oct 1997 13:21:11 +0200 (MET DST) Received: from critter.freebsd.dk (localhost.dk.tfs.com [127.0.0.1]) by critter.freebsd.dk (8.8.7/8.8.7) with ESMTP id NAA26003; Mon, 13 Oct 1997 13:20:42 +0200 (CEST) To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) cc: freebsd-current@FreeBSD.ORG (FreeBSD-current users) Subject: Re: lockmgr panic In-reply-to: Your message of "Mon, 13 Oct 1997 08:41:58 +0200." <19971013084158.HG40991@uriah.heep.sax.de> Date: Mon, 13 Oct 1997 13:20:42 +0200 Message-ID: <26001.876741642@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk I belive you hit "the other" recursive condition in vn, which is the one we have no fix for I belive. The closest we could get would be to just queue the second buffer in vnstrategy() if we're already active, but then it may simply convert to a deadlock... I hacked this little "genuine ram disk driver" up a couple of days ago, if should do everything you would want to have done if this is for release building: /* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * * $Id$ * */ #ifndef RD0_SIZE #define RD0_SIZE (80*2*18*512) #endif /* * Includes */ #include "rd.h" #include #include #include #include #include #include #include /* * Prototypes */ static d_open_t rdopen; static d_close_t rdclose; static d_strategy_t rdstrategy; static d_ioctl_t rdioctl; static d_dump_t rddump; static d_psize_t rdsize; /* * Data */ static struct rd_softc { unsigned long sc_size; u_char *sc_base; struct diskslices *sc_slices; } softc[NRD]; #ifdef RD0_SIZE static u_char rd0_data[RD0_SIZE] = "RD0 Image goes here"; #endif /* RD0_SIZE */ /* * Registation into the kernel data structures */ #define BDEV_MAJOR 24 #define CDEV_MAJOR 84 static struct cdevsw rd_cdevsw; static struct bdevsw rd_bdevsw = { rdopen, rdclose, rdstrategy, rdioctl, rddump, rdsize, D_DISK, "rd", &rd_cdevsw, -1 }; static void rd_drvinit(void *unused) { bdevsw_add_generic(BDEV_MAJOR, CDEV_MAJOR, &rd_bdevsw); #ifdef RD0_SIZE softc[0].sc_base = rd0_data; softc[0].sc_size = RD0_SIZE; #endif /* RD0_SIZE */ } SYSINIT(rddev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,rd_drvinit,NULL) static int rdopen(dev_t dev, int flags, int mode, struct proc *p) { struct rd_softc *sc; struct disklabel label; int error; sc = softc + dkunit(dev); bzero(&label, sizeof label); label.d_secsize = DEV_BSIZE; label.d_nsectors = sc->sc_size / DEV_BSIZE; label.d_ntracks = 1; label.d_ncylinders = 1; label.d_secpercyl = label.d_nsectors; label.d_secperunit = label.d_nsectors; error = dsopen("rd", dev, mode, &sc->sc_slices, &label, rdstrategy, (ds_setgeom_t *)NULL, &rd_bdevsw, &rd_cdevsw); return (error); } static int rdclose(dev_t dev, int flags, int mode, struct proc *p) { struct rd_softc *sc; sc = softc + dkunit(dev); dsclose(dev, mode, sc->sc_slices); return (0); } static void rdstrategy(struct buf *bp) { struct rd_softc *sc; u_char *where; sc = softc + dkunit(bp->b_dev); bp->b_resid = bp->b_bcount; if (dscheck(bp, sc->sc_slices) <= 0) { biodone(bp); return; } where = sc->sc_base + dbtob(bp->b_pblkno); if (bp->b_flags & B_READ) { bcopy(where , bp->b_data, bp->b_bcount); } else { bcopy(bp->b_data, where, bp->b_bcount); } bp->b_resid -= bp->b_bcount; biodone(bp); } static int rdioctl(dev_t dev, int cmd, caddr_t data, int flag, struct proc *p) { struct rd_softc *sc; int error; sc = softc + dkunit(dev); error = dsioctl("rd", dev, cmd, data, flag, &sc->sc_slices, rdstrategy, (ds_setgeom_t *)NULL); if (error == -1) error = ENOTTY; return (error); } static int rddump(dev_t dev) { return (ENODEV); } static int rdsize(dev_t dev) { return (0); } -- Poul-Henning Kamp FreeBSD coreteam member phk@FreeBSD.ORG "Real hackers run -current on their laptop."