From owner-svn-src-head@FreeBSD.ORG Fri Mar 18 16:51:31 2011 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C185A106564A; Fri, 18 Mar 2011 16:51:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 60A508FC1F; Fri, 18 Mar 2011 16:51:30 +0000 (UTC) Received: from c122-107-125-80.carlnfd1.nsw.optusnet.com.au (c122-107-125-80.carlnfd1.nsw.optusnet.com.au [122.107.125.80]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p2IGpS67013549 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 19 Mar 2011 03:51:29 +1100 Date: Sat, 19 Mar 2011 03:51:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kostik Belousov In-Reply-To: <20110318142844.GB78089@deviant.kiev.zoral.com.ua> Message-ID: <20110319032048.H3038@besplex.bde.org> References: <201103171123.p2HBNCGh025820@svn.freebsd.org> <20110318001402.H1537@besplex.bde.org> <20110318142844.GB78089@deviant.kiev.zoral.com.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r219712 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2011 16:51:31 -0000 On Fri, 18 Mar 2011, Kostik Belousov wrote: > On Fri, Mar 18, 2011 at 12:37:41AM +1100, Bruce Evans wrote: >> On Thu, 17 Mar 2011, Konstantin Belousov wrote: >> >>> Log: >>> Remove the #if defined(FFS) || defined(IFS) braces around the calls to >>> ffs_snapgone(). ufs.ko module is not build with FFS define, causing >>> snapshot inode number slots in superblock never be freed, as well as a >>> reference on the snapshot vnode. >>> >>> IFS was removed several years ago, and UFS/FFS separation was not >>> maintained for real. >>> >>> Reported, analyzed and tested by: Yamagi Burmeister >>> MFC after: 3 days >> >> This seems to leave FFS correctly unused. Most options for file systems >> are put in opt_dontuse.h to inhibit bugs like this (but I never figured >> ... >> the module. opt_ffs_broken_fixme.h also became unnecessary in 2002, >> but remains to generate history lessons :-). > > I went ahead and implemented UFS_SNAPONE() and removal of > opt_ffs_broken_fixme.h. Thanks. At first I thought that UFS_SNAPGONE() was pointless, since there are lots of other layering violations and the macros don't make the spit really work. But ffs_snapgone() was the only function named ffs_*() called from ufs. There are just 2 other references to ffs_*() in ufs. Both are in comments in ufs_inode.c. But there are many other layering violations which are not so obvious because the ffs functions are not spelled ffs_*(). Many are spelled softdep_*(). Soft updates are only implemented for ffs and even their stubs were only implemented for ffs, so ufs without ffs cannot compile. The ufs files are actually selected by the ffs option in conf/files, so ufs without ffs is almost impossible anyway. The ffs module is misnamed ufs, and it links all the ffs and ufs files, so if there were a ext2fs, ifs, lfs or otherfs using ufs, especially if these were in modules there would probably be multiple instances ifs ufs. This may even be the best way -- "fork" ufs by creating separate objects from common sources with a few ifdefs, so that you don't have lots of runtime tests and function pointers and extra source code to initialize the function pointers... Bruce