From owner-svn-src-head@freebsd.org Thu Apr 5 00:32:02 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D128F83567; Thu, 5 Apr 2018 00:32:02 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B70727C4E8; Thu, 5 Apr 2018 00:32:01 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1DF71B2D0; Thu, 5 Apr 2018 00:32:01 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w350W1n6005994; Thu, 5 Apr 2018 00:32:01 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w350W196005991; Thu, 5 Apr 2018 00:32:01 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201804050032.w350W196005991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Thu, 5 Apr 2018 00:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332055 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 332055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 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: Thu, 05 Apr 2018 00:32:02 -0000 Author: mckusick Date: Thu Apr 5 00:32:01 2018 New Revision: 332055 URL: https://svnweb.freebsd.org/changeset/base/332055 Log: Renumber soft-update types starting at 1 instead of 0 to avoid confusion of zero'ed memory appearing to have a valid soft-update type. Also correct some comments. Reviewed by: kib Modified: head/sys/ufs/ffs/ffs_softdep.c head/sys/ufs/ffs/softdep.h Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Thu Apr 5 00:03:38 2018 (r332054) +++ head/sys/ufs/ffs/ffs_softdep.c Thu Apr 5 00:32:01 2018 (r332055) @@ -688,6 +688,7 @@ static MALLOC_DEFINE(M_MOUNTDATA, "softdep", "Softdep * MUST match the defines above, such that memtype[D_XXX] == M_XXX */ static struct malloc_type *memtype[] = { + NULL, M_PAGEDEP, M_INODEDEP, M_BMSAFEMAP, @@ -724,7 +725,8 @@ static struct malloc_type *memtype[] = { * Names of malloc types. */ #define TYPENAME(type) \ - ((unsigned)(type) <= D_LAST ? memtype[type]->ks_shortdesc : "???") + ((unsigned)(type) <= D_LAST && (unsigned)(type) >= D_FIRST ? \ + memtype[type]->ks_shortdesc : "???") /* * End system adaptation definitions. */ @@ -12960,7 +12962,7 @@ flush_newblk_dep(vp, mp, lbn) break; } if (newblk->nb_list.wk_type != D_ALLOCDIRECT) - panic("flush_newblk_deps: Bad newblk %p", newblk); + panic("flush_newblk_dep: Bad newblk %p", newblk); /* * Flush the journal. */ Modified: head/sys/ufs/ffs/softdep.h ============================================================================== --- head/sys/ufs/ffs/softdep.h Thu Apr 5 00:03:38 2018 (r332054) +++ head/sys/ufs/ffs/softdep.h Thu Apr 5 00:32:01 2018 (r332055) @@ -146,37 +146,45 @@ #define ALLCOMPLETE (ATTACHED | COMPLETE | DEPCOMPLETE) +#define PRINT_SOFTDEP_FLAGS "\20\27writesucceeded\26unlinkonlist" \ + "\25unlinkprev\24unlinknext\23unlinked\22ondeplist\21iowaiting" \ + "\20onworklist\17extdata\16ufs1fmt\15inprogress\14newblock" \ + "\13delayedfree\12iostarted\11goingaway\10dirchg\7rmdir\6mkdir_body" \ + "\5mkdir_parent\4depcomplete\3complete\2undone\1attached" + /* * Values for each of the soft dependency types. */ -#define D_PAGEDEP 0 -#define D_INODEDEP 1 -#define D_BMSAFEMAP 2 -#define D_NEWBLK 3 -#define D_ALLOCDIRECT 4 -#define D_INDIRDEP 5 -#define D_ALLOCINDIR 6 -#define D_FREEFRAG 7 -#define D_FREEBLKS 8 -#define D_FREEFILE 9 -#define D_DIRADD 10 -#define D_MKDIR 11 -#define D_DIRREM 12 -#define D_NEWDIRBLK 13 -#define D_FREEWORK 14 -#define D_FREEDEP 15 -#define D_JADDREF 16 -#define D_JREMREF 17 -#define D_JMVREF 18 -#define D_JNEWBLK 19 -#define D_JFREEBLK 20 -#define D_JFREEFRAG 21 -#define D_JSEG 22 -#define D_JSEGDEP 23 -#define D_SBDEP 24 -#define D_JTRUNC 25 -#define D_JFSYNC 26 -#define D_SENTINEL 27 +#define D_UNUSED 0 +#define D_FIRST D_PAGEDEP +#define D_PAGEDEP 1 +#define D_INODEDEP 2 +#define D_BMSAFEMAP 3 +#define D_NEWBLK 4 +#define D_ALLOCDIRECT 5 +#define D_INDIRDEP 6 +#define D_ALLOCINDIR 7 +#define D_FREEFRAG 8 +#define D_FREEBLKS 9 +#define D_FREEFILE 10 +#define D_DIRADD 11 +#define D_MKDIR 12 +#define D_DIRREM 13 +#define D_NEWDIRBLK 14 +#define D_FREEWORK 15 +#define D_FREEDEP 16 +#define D_JADDREF 17 +#define D_JREMREF 18 +#define D_JMVREF 19 +#define D_JNEWBLK 20 +#define D_JFREEBLK 21 +#define D_JFREEFRAG 22 +#define D_JSEG 23 +#define D_JSEGDEP 24 +#define D_SBDEP 25 +#define D_JTRUNC 26 +#define D_JFSYNC 27 +#define D_SENTINEL 28 #define D_LAST D_SENTINEL /* @@ -469,17 +477,17 @@ struct allocdirect { * A single "indirdep" structure manages all allocation dependencies for * pointers in an indirect block. The up-to-date state of the indirect * block is stored in ir_savedata. The set of pointers that may be safely - * written to the disk is stored in ir_safecopy. The state field is used + * written to the disk is stored in ir_savebp. The state field is used * only to track whether the buffer is currently being written (in which - * case it is not safe to update ir_safecopy). Ir_deplisthd contains the + * case it is not safe to update ir_savebp). Ir_deplisthd contains the * list of allocindir structures, one for each block that needs to be * written to disk. Once the block and its bitmap allocation have been * written the safecopy can be updated to reflect the allocation and the * allocindir structure freed. If ir_state indicates that an I/O on the - * indirect block is in progress when ir_safecopy is to be updated, the + * indirect block is in progress when ir_savebp is to be updated, the * update is deferred by placing the allocindir on the ir_donehd list. * When the I/O on the indirect block completes, the entries on the - * ir_donehd list are processed by updating their corresponding ir_safecopy + * ir_donehd list are processed by updating their corresponding ir_savebp * pointers and then freeing the allocindir structure. */ struct indirdep {