From owner-cvs-src@FreeBSD.ORG Fri Apr 25 08:46:58 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 1380737B41A for ; Fri, 25 Apr 2003 08:46:58 -0700 (PDT) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 52C1F43FDF for ; Fri, 25 Apr 2003 08:46:56 -0700 (PDT) (envelope-from nate@rootlabs.com) Received: (qmail 65222 invoked by uid 1000); 25 Apr 2003 15:46:56 -0000 Date: Fri, 25 Apr 2003 08:46:56 -0700 (PDT) From: Nate Lawson To: "Tim J. Robbins" In-Reply-To: <20030425100758.561E137B4B0@hub.freebsd.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.sbin/quot quot.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: Fri, 25 Apr 2003 15:46:59 -0000 On Fri, 25 Apr 2003, Tim J. Robbins wrote: > Repair the UFS2 superblock location consistency check so that it succeeds > on valid superblocks instead of issuing the error "not a BSD filesystem". > fs_sblockloc is a byte offset, not a fragment number. This change makes > quot work properly on UFS2 filesystems, which is important now that UFS2 > is the default. > > Revision Changes Path > 1.21 +1 -1 src/usr.sbin/quot/quot.c > > --- src/usr.sbin/quot/quot.c:1.20 Mon Dec 30 10:21:47 2002 > +++ src/usr.sbin/quot/quot.c Fri Apr 25 03:07:50 2003 > @@ -563,7 +563,7 @@ > fs = (struct fs *)superblock; > if ((fs->fs_magic == FS_UFS1_MAGIC || > (fs->fs_magic == FS_UFS2_MAGIC && > - fs->fs_sblockloc == numfrags(fs, sblock_try[i]))) && > + fs->fs_sblockloc == sblock_try[i])) && > fs->fs_bsize <= MAXBSIZE && > fs->fs_bsize >= sizeof(struct fs)) > break; There's actually a UFS1 case where sblockloc is in bytes, if fs_old_flags & FLAGS_UPDATED. See ffs_compat_read(). (Func names inexact since I don't have the code in front of me, send me email if it's not clear). I am working on merging all this into a single, user/kernel shared function for updating the superblock so we don't have this many places to make a change. -Nate