From owner-cvs-src@FreeBSD.ORG Mon Nov 3 23:34:33 2003 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 795D716A4CE; Mon, 3 Nov 2003 23:34:33 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id D09E043FAF; Mon, 3 Nov 2003 23:34:32 -0800 (PST) (envelope-from mckusick@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hA47YWXJ080359; Mon, 3 Nov 2003 23:34:32 -0800 (PST) (envelope-from mckusick@repoman.freebsd.org) Received: (from mckusick@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hA47YWfl080358; Mon, 3 Nov 2003 23:34:32 -0800 (PST) (envelope-from mckusick) Message-Id: <200311040734.hA47YWfl080358@repoman.freebsd.org> From: Kirk McKusick Date: Mon, 3 Nov 2003 23:34:32 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sbin/newfs mkfs.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Nov 2003 07:34:33 -0000 mckusick 2003/11/03 23:34:32 PST FreeBSD src repository Modified files: sbin/newfs mkfs.c Log: Create a .snap directory mode 770 group operator in the root of a new filesystem. Dump and fsck will create snapshots in this directory rather than in the root for two reasons: 1) For terabyte-sized filesystems, the snapshot may require many minutes to build. Although the filesystem will not be suspended during most of the snapshot build, the snapshot file itself is locked during the entire snapshot build period. Thus, if it is accessed during the period that it is being built, the process trying to access it will block holding its containing directory locked. If the snapshot is in the root, the root will lock and the system will come to a halt until the snapshot finishes. By putting the snapshot in a subdirectory, it is out of the likely path of any process traversing through the root and hence much less likely to cause a lock race to the root. 2) The dump program is usually run by a non-root user running with operator group privilege. Such a user is typically not permitted to create files in the root of a filesystem. By having a directory in group operator with group write access available, such a user will be able to create a snapshot there. Having the dump program create its snapshot in a subdirectory below the root will benefit from point (1) as well. Sponsored by: DARPA & NAI Labs. Revision Changes Path 1.79 +45 -6 src/sbin/newfs/mkfs.c