From owner-svn-src-all@FreeBSD.ORG Tue Jan 20 22:49:50 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6850B10656C1; Tue, 20 Jan 2009 22:49:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57AEE8FC18; Tue, 20 Jan 2009 22:49:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0KMnoDK059329; Tue, 20 Jan 2009 22:49:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0KMno0c059325; Tue, 20 Jan 2009 22:49:50 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <200901202249.n0KMno0c059325@svn.freebsd.org> From: Xin LI Date: Tue, 20 Jan 2009 22:49:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187501 - head/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2009 22:49:51 -0000 Author: delphij Date: Tue Jan 20 22:49:49 2009 New Revision: 187501 URL: http://svn.freebsd.org/changeset/base/187501 Log: Rename option 'C' to 'D' (damaged) in order to avoid a conflict with upcoming Juniper 'C' (clean) flag. Requested by: obrien MFC after: 1 week Modified: head/sbin/fsck_ffs/fsck.h head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/fsck_ffs/fsutil.c head/sbin/fsck_ffs/main.c Modified: head/sbin/fsck_ffs/fsck.h ============================================================================== --- head/sbin/fsck_ffs/fsck.h Tue Jan 20 22:48:52 2009 (r187500) +++ head/sbin/fsck_ffs/fsck.h Tue Jan 20 22:49:49 2009 (r187501) @@ -270,7 +270,7 @@ char yflag; /* assume a yes response * int bkgrdflag; /* use a snapshot to run on an active system */ int bflag; /* location of alternate super block */ int debug; /* output debugging info */ -char catastrophicflag; /* run in catastrophic mode */ +char damagedflag; /* run in damaged mode */ int cvtlevel; /* convert to newer file system format */ int bkgrdcheck; /* determine if background check is possible */ int bkgrdsumadj; /* whether the kernel have ability to adjust superblock summary */ Modified: head/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- head/sbin/fsck_ffs/fsck_ffs.8 Tue Jan 20 22:48:52 2009 (r187500) +++ head/sbin/fsck_ffs/fsck_ffs.8 Tue Jan 20 22:49:49 2009 (r187501) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd January 20, 2009 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -38,7 +38,7 @@ .Nd file system consistency check and interactive repair .Sh SYNOPSIS .Nm -.Op Fl BCFpfny +.Op Fl BDFpfny .Op Fl b Ar block .Op Fl c Ar level .Op Fl m Ar mode @@ -175,26 +175,6 @@ Use the block specified immediately afte the super block for the file system. An alternate super block is usually located at block 32 for UFS1, and block 160 for UFS2. -.It Fl C -Run -.Nm -in 'catastrophic recovery' mode, which will enable certain aggressive -operations that can make -.Nm -to survive with file systems that has very serious data damage, which -is an useful last resort when on disk data damage is very serious -and causes -.Nm -to crash otherwise. Be -.Em very careful -using this flag, it is dangerous if there are data transmission hazards -because a false positive cylinder group magic number mismatch could -cause -.Em irrevertible data loss! -.Pp -This option implies the -.Fl f -flag. .It Fl c Convert the file system to the specified level. Note that the level of a file system can only be raised. @@ -228,6 +208,26 @@ are being converted at once. The format of a file system can be determined from the first line of output from .Xr dumpfs 8 . +.It Fl D +Run +.Nm +in 'damaged recovery' mode, which will enable certain aggressive +operations that can make +.Nm +to survive with file systems that has very serious data damage, which +is an useful last resort when on disk data damage is very serious +and causes +.Nm +to crash otherwise. Be +.Em very careful +using this flag, it is dangerous if there are data transmission hazards +because a false positive cylinder group magic number mismatch could +cause +.Em irrevertible data loss! +.Pp +This option implies the +.Fl f +flag. .It Fl f Force .Nm Modified: head/sbin/fsck_ffs/fsutil.c ============================================================================== --- head/sbin/fsck_ffs/fsutil.c Tue Jan 20 22:48:52 2009 (r187500) +++ head/sbin/fsck_ffs/fsutil.c Tue Jan 20 22:49:49 2009 (r187501) @@ -427,7 +427,7 @@ check_cgmagic(int cg, struct cg *cgp) if (!cg_chkmagic(cgp)) { pwarn("CG %d: BAD MAGIC NUMBER\n", cg); - if (catastrophicflag) { + if (damagedflag) { if (reply("CLEAR CG")) { memset(cgp, 0, (size_t)sblock.fs_cgsize); cgp->cg_initediblk = sblock.fs_ipg; Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Tue Jan 20 22:48:52 2009 (r187500) +++ head/sbin/fsck_ffs/main.c Tue Jan 20 22:49:49 2009 (r187501) @@ -81,8 +81,8 @@ main(int argc, char *argv[]) sync(); skipclean = 1; - catastrophicflag = 0; - while ((ch = getopt(argc, argv, "b:Bc:CdfFm:npy")) != -1) { + damagedflag = 0; + while ((ch = getopt(argc, argv, "b:Bc:dDfFm:npy")) != -1) { switch (ch) { case 'b': skipclean = 0; @@ -106,8 +106,8 @@ main(int argc, char *argv[]) debug++; break; - case 'C': - catastrophicflag = 1; + case 'D': + damagedflag = 1; /* FALLTHROUGH */ case 'f':