From owner-freebsd-current Wed Jan 22 4:26:23 2003 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B0DD437B401 for ; Wed, 22 Jan 2003 04:26:20 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id B887A43F6B for ; Wed, 22 Jan 2003 04:26:19 -0800 (PST) (envelope-from phk@freebsd.org) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id h0MCPx6Z025075; Wed, 22 Jan 2003 13:26:14 +0100 (CET) (envelope-from phk@freebsd.org) To: ticso@cicely.de Cc: Joerg Wunsch , freebsd-current@freebsd.org Subject: Re: I want a sysctl kern.allow_shooting_into_my_foot! From: phk@freebsd.org In-Reply-To: Your message of "Wed, 22 Jan 2003 13:17:39 +0100." <20030122121739.GA758@cicely8.cicely.de> Date: Wed, 22 Jan 2003 13:25:59 +0100 Message-ID: <25074.1043238359@critter.freebsd.dk> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG In message <20030122121739.GA758@cicely8.cicely.de>, Bernd Walter writes: >On Tue, Jan 21, 2003 at 11:06:05PM +0100, phk@FreeBSD.ORG wrote: >> In message <20030121225940.G37868@uriah.heep.sax.de>, Joerg Wunsch writes: >> >As phk@freebsd.org wrote: >> > >> >> Hang on. >> >> >> >> If no disk partitions of any kind are open, there is nothing which >> >> prevents you from doing a "dd if=/dev/zero of=/dev/da0 bs=64k". >> > >> >My guess is that vinum scanned the disks when starting, but found >> >nothing on it. >> >> And forgot to close them again ? Well, you know where to look >> for that bug then :-) >> >> (If you look in the "sysctl -b kern.geom.confxml" output, you will >> be able to see the read/write/exclusive open counts, look for >> "r%dw%de%d" strings.) > >Interesting sysctl. Yes, one of the more informative :-) > > > r1w1e0 > da13e > 652329984 > 1024 > > 4 > 652329984 > 1274082 > 0 > 0 > > > >If I got it right it tells me, that da13e is opened for read/write. You can also try this, it's more easily informative: sysctl -n kern.geom.confdot | dot -Tps > _.ps ; gv _.ps You need the graphviz and ghostscript ports for this. >I never complained about this, because the system is rather old >(2002-11-15) and I believed it was already fixed. >But it sounds like Joergs situation may be triggered by the same bug. >Mmmm - I'm using vinum too. >Is there any way to find out which ones open it was? Hmm, since this happens during boot, you cannot set the debug flag with sysctl in time, so you have to compile a custom kernel for it: in sys/geom/geom_kern.c change: int g_debugflags; to int g_debugflags = G_T_ACCESS; and recompile + reboot. This will make GEOM printf all "access" (ie: open/close) changes and you should hopefully be able to deduce where the open of your MO comes from. If this is not enough, you can try to set int g_debugflags = G_T_ACCESS | G_T_TOPOLOGY; But that will result in much more debugging output. You can turn this debugging off from userland with: sysctl kern.geom.debugflags=0 Poul-Henning -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message