From owner-freebsd-arch@FreeBSD.ORG Tue Mar 19 20:11:51 2013 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5FA016BF for ; Tue, 19 Mar 2013 20:11:51 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from mail.ambrisko.com (mail.ambrisko.com [70.91.206.90]) by mx1.freebsd.org (Postfix) with ESMTP id 4494D22F for ; Tue, 19 Mar 2013 20:11:51 +0000 (UTC) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO internal.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 19 Mar 2013 13:14:19 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by internal.ambrisko.com (8.14.4/8.14.4) with ESMTP id r2JKBj18033162 for ; Tue, 19 Mar 2013 13:11:45 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.14.4/8.14.4/Submit) id r2JKBjkm033161 for arch@freebsd.org; Tue, 19 Mar 2013 13:11:45 -0700 (PDT) (envelope-from ambrisko) Date: Tue, 19 Mar 2013 13:11:45 -0700 From: Doug Ambrisko To: arch@freebsd.org Subject: Increase the mount path to MAXPATHLEN? Message-ID: <20130319201145.GA19260@ambrisko.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Mar 2013 20:11:51 -0000 At work we use lots of chroots and mount things within those chroots like dev, proc etc. so it looks like a running system. We also do some trickery so that we chroot into different versions of FreeBSD and pull in some of the native binaries so things like mount, ps etc. work inside. We will also create chroots inside that. Since these things live in home directories and mount points can be in various tree's the mount points are getting pretty long. It seems that checking before was weak and let some of these mount worked by accident in prior versions of FreeBSD. Now there is better error checking and the mounts fail since it exceeds MNAMELEN which was 88. I did notice before that sometimes unmount would unmount other things and could be an issues with multiple scripts running at the same time. This doesn't seem to be a problem now. I'd like to bump the mount point to support a larger value then MNAMELEN (88) and to some what avoid this problem in the future thought we should just use MAXPATHLEN. I figure that once start hitting that limit probably a bunch of things are going to pop up. This means we'll need to create new system calls for stat calls and compatibility. It is a pain, since you need to build and install a new kernel before you can run code with the new values. So there is some pain involved. I've made this change locally on a system and has been running for a few months. However, since other people can add system call numbers then conflicts can be a pain to deal with. So if we are going to do something like this then it would be nice to reserve the new number before someone else grabs them. I'd hate to have a bunch of binaries distributed that could cause major issues like this. I noticed STATFS_VERSION defined as: #define STATFS_VERSION 0x20030518 /* current version number */ I'm not sure if we can use that to change the length without changing the system call number. It also might be good if we had a private system call number range so companies could extend them. I recall we had that for major numbers before devfs. I have a patch at: http://people.freebsd.org/~ambrisko/statf.patch that people can glance at. If this approach is the right way to go then I update it for the latest -current and update it. Right now I'm looking at doing this for an internal 9.1 release and would like to grab the system call numbers so I can make that compatible with the future and have future FreeBSD releases support those binaries. I expect as people starting using chroot/jails/vimage as more general purpose on multi-user machines that more people will run into this. This especially happens if the mount points are in home directories etc. I've now started to spin up light weight vimages via doing a nullfs mount of installworld into a machine name, unionfs a backing store to that and then launch a machine via vimage. A simple script can fire up a new machine quickly. Sometimes these "test" machines are just for routing so the diff between them is really small and is captured in the unionfs backing store. Then I can upgrade them via a new installworld to the source nullfs mount and everything gets the new image. To make this easier to support differnt versions of FreeBSD I have some patches so that in a jail you can change the sysctl for kern.osrelease etc. This is easier then trying to get UNAME_* environment variables set for everything. So I find this really useful. Please let me know if there are better methods to do this. Thanks, Doug A.