From owner-freebsd-current Fri Jun 23 12: 5:11 2000 Delivered-To: freebsd-current@freebsd.org Received: from mout0.freenet.de (mout0.freenet.de [194.97.50.131]) by hub.freebsd.org (Postfix) with ESMTP id 186EB37C417; Fri, 23 Jun 2000 12:04:57 -0700 (PDT) (envelope-from se@freebsd.org) Received: from [194.97.50.136] (helo=mx3.freenet.de) by mout0.freenet.de with esmtp (Exim 3.14 #3) id 135Yhi-0001uF-00; Fri, 23 Jun 2000 21:01:26 +0200 Received: from [213.6.105.72] (helo=StefanEsser.FreeBSD.org) by mx3.freenet.de with esmtp (Exim 3.14 #3) id 135Yhi-0004Ai-00; Fri, 23 Jun 2000 21:01:26 +0200 Received: by StefanEsser.FreeBSD.org (Postfix, from userid 200) id 5605ECD8; Fri, 23 Jun 2000 21:01:11 +0200 (CEST) Date: Fri, 23 Jun 2000 21:01:10 +0200 From: Stefan Esser To: Matthew Dillon Cc: Poul-Henning Kamp , Peter Wemm , Adrian Chadd , Julian Elischer , Anders Andersson , cvs-all@FreeBSD.ORG, freebsd-current@FreeBSD.ORG, Stefan Esser Subject: Re: cvs commit: src/sys/contrib/softupdates softdep.h ffs_softdep.c Message-ID: <20000623210110.B8626@StefanEsser.FreeBSD.org> Reply-To: Stefan Esser Mail-Followup-To: Stefan Esser , Matthew Dillon , Poul-Henning Kamp , Peter Wemm , Adrian Chadd , Julian Elischer , Anders Andersson , cvs-all@FreeBSD.ORG, freebsd-current@FreeBSD.ORG References: <669.961737829@critter.freebsd.dk> <200006231641.JAA10742@apollo.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <200006231641.JAA10742@apollo.backplane.com>; from dillon@apollo.backplane.com on Fri, Jun 23, 2000 at 09:41:31AM -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On 2000-06-23 09:41 -0700, Matthew Dillon wrote: > Slight problem: We've run out of mount option flags. But there already ist MNT_SOFTDEP in ... #define MNT_SUIDDIR 0x00100000 /* special handling of SUID on dirs */ #define MNT_SOFTDEP 0x00200000 /* soft updates being done */ #define MNT_NOSYMFOLLOW 0x00400000 /* do not follow symlinks */ Hmmm, just checked in and found that the soft-updates state is already kept in the fs_flags element of struct fs (the super-block). /* * Super block for an FFS file system. */ struct fs { ... int8_t fs_flags; /* see FS_ flags below */ ... }; /* * Filesystem flags. */ #define FS_UNCLEAN 0x01 /* filesystem not clean at mount */ #define FS_DOSOFTDEP 0x02 /* filesystem using soft dependencies */ And in fsck/setup.c, I found: bufinit(); if (sblock.fs_flags & FS_DOSOFTDEP) usedsoftdep = 1; else usedsoftdep = 0; return (1); So its obvious, that we could make "-o softdep" a mount option, do away with the tunefs option, and have the *kernel* record the use of soft-updates on a R/W mounted file system when it marks the file system FS_UNCLEAN in the fs_flags files in the super-block. If a file system is unmounted cleanly, the FS_DOSOFTDEP flag can be cleared along with the FS_UNCLEAN bit, since the next mount is free to decide whether to use soft-updates or not. This is more safe than the tunefs method, since FS_DOSOFTDEP will only be set if the last R/W mount was on a kernel that supported soft-updates ... Only problem I see (but that is not different from the current situation) is that "mount -u" can't change the soft-updates state, if a file-system is mounted R/W. This should probably be inforced in the kernel (not the mount command) and there should be *no* way to "force" mount to override this lock. Regards, STefan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message