From owner-freebsd-current@FreeBSD.ORG Mon Jul 19 15:00:49 2010 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E66C81065678 for ; Mon, 19 Jul 2010 15:00:49 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by mx1.freebsd.org (Postfix) with ESMTP id A432D8FC0A for ; Mon, 19 Jul 2010 15:00:49 +0000 (UTC) Received: from a91-153-117-195.elisa-laajakaista.fi (a91-153-117-195.elisa-laajakaista.fi [91.153.117.195]) by gw01.mail.saunalahti.fi (Postfix) with SMTP id 0ACD9151616 for ; Mon, 19 Jul 2010 18:00:46 +0300 (EEST) Date: Mon, 19 Jul 2010 18:00:46 +0300 From: Jaakko Heinonen To: freebsd-current@FreeBSD.org Message-ID: <20100719150046.GA913@a91-153-117-195.elisa-laajakaista.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: [CFR] devfs improvements X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2010 15:00:50 -0000 Hi, I have been working on some devfs improvements and I am now posting the patch for wider review and testing. Especially testing from people using multiple devfs mounts and/or symbolic links would be useful. The patch: http://people.freebsd.org/~jh/patches/devfs.7.diff Notable changes: - Automatically remove empty directories. - Allow user created symbolic links to cover device files and directories if the device file appears after the link creation. - It's now possible to report if the device file already exists or is invalid to make_dev_credf(9) and make_dev_p(9) callers. There is a new flag MAKEDEV_CHECKNAME to indicate that the caller is prepared to handle such error. If the flag is not specified and the device name is invalid, a panic will occur. This code is not yet enabled because there are some driver issues which need to be sorted out before. (See "#ifdef notyet" in make_dev_credv().) In addition the patch should fix these bugs: - kern/114057 - fstat(2) could return stale information through open file descriptors. My main motivation for these changes was erratic handling of duplicate and invalid device names. For example currently you can crash the system through geom_label by inserting a specially crafted CD. Driver bugs causing duplicate device registrations weren't detected either. Most of the ideas implemented in the patch are from Kostik Belousov. Special thanks for him providing help and reviews during the development. Additional patches: A patch for GEOM to convert g_dev_taste() to use make_dev_p() with MAKEDEV_CHECKNAME flag instead of make_dev(). http://people.freebsd.org/~jh/patches/geom_dev-checkname.diff Enable panicking on invalid device names: http://people.freebsd.org/~jh/patches/make_dev-checkname.diff -- Jaakko