Date: Tue, 12 May 98 15:47:23 EDT From: luoqi@watermarkgroup.com (Luoqi Chen) To: bde@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG, cvs-sys@FreeBSD.ORG Subject: Re: cvs commit: src/sys/i386/i386 autoconf.c src/sys/kern kern_shutdown.c Message-ID: <9805121947.AA29566@watermarkgroup.com>
next in thread | raw e-mail | index | archive | help
> bde 1998/05/12 10:34:04 PDT > > Modified files: > sys/i386/i386 autoconf.c > sys/kern kern_shutdown.c > Log: > Backed out previous commit. It is invalid to call d_ioctl() on > possibly non-open devices, and we don't want to restrict dumping > to swap devices anwyay. It is especially invalid to call d_ioctl() > in non-process context for panics. d_psize() can be called on > non-open devices, at least on non-SLICED ones that support d_dump(), > and setdumpdev() has depended on this for a long time although it > is probably wrong, but even d_psize() can't be called in non-process > context - that's why dumpsys() depends on previously computed values > although these values may be stale. The historical restriction to > devices with dkpart(dev) == SWAP_PART should go away. > > Revision Changes Path > 1.97 +2 -5 src/sys/i386/i386/autoconf.c > 1.31 +3 -8 src/sys/kern/kern_shutdown.c > I know it is a kludge when I submit. But the specific ioctl (DIOCGPART) is only intended to be called (if I understand correctly) from a kernel context, so absence of a process context shouldn't really matter. As to calling d_ioctl on non-open devices, I have to admit it's inapporiate. But again for the DIOCGPART ioctl, it is no more evil than calling d_psize or d_dump -- they all make the same assumption (i.e. slices are initialized). The previous commit is necessary to enable dump for a SLICE kernel. An alternative would be to get rid of the bogus swap partition check. One has to be extremely careful not to point dump dev to a fs partition after this safty check is gone. We will still have problem with d_dump and d_psize for device that has never been opened (and thus slices not initialized) unless we switch to a SLICE kernel. Or call dsinit() in an interrupt hook just as what the slice device does. -lq
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9805121947.AA29566>