From owner-svn-src-stable@freebsd.org Fri Mar 8 02:33:26 2019 Return-Path: Delivered-To: svn-src-stable@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 D989C152F606 for ; Fri, 8 Mar 2019 02:33:25 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCBA186691 for ; Fri, 8 Mar 2019 02:33:24 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk1-x743.google.com with SMTP id u22so1488293qkj.11 for ; Thu, 07 Mar 2019 18:33:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=zpCZgzC7YhxkvgG2q3Bjz4ENl8ySLlRyNsXj8WmtvGs=; b=TygGPw/1teJKUGhLCa0LtJmAjQ4RVa0HtwRMKGC5LGiLLOzFqkhhdiEIEnfnd2K9hL MRZ4zlOVjDuUdLT+ZKngHfXLrwU8hZRUtcmRzQxDXKTp7L3+3mWtBNWibr9PfQv+/5jJ dFmH65n+KYRX+ZRnI+MYKBykYiC84yQ7uJJFg2htl5j08lAz6+HHGdc5qLe64XIyd/qK L9mlo9OhpPDqUO6ngkahk1i/Ow95ig6S+jGgxkfvdZWfblp8tXYeJc5gj6aAzmRyFDcj IgDlf63cPhRAF/BOdYe/ynFLtqTjK5Cq5TfS8uJsoRvjtKvbQoq8r4q+ur6sgCahSSmD L+fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=zpCZgzC7YhxkvgG2q3Bjz4ENl8ySLlRyNsXj8WmtvGs=; b=LG0QyZSdxgtraY3OAna/O9bBLROBIiMxRH2az6SAWPabMcvRc6/FU4TEHOF3TTM+sv AWDF/XQuhEs5DQX6U36Yu8bUPsQibrfxv/gLr/odfpUJ8mY4YZvAttP69T1hT+bWY3I5 DAIEnEtj7lvMCVw6Lce+SUlKwdBw0UjdUhg0c/EOUfHqWJg26Pi8VruCWLwJE2YETvaI mWJxL6AKEyu9woi3giBnOzGP/M8bjxZSdIUW6N+EOxoRhXcFFEyAEKel/DjayMkX66V8 LOFak5HaBeVzVbeiuiLcQJyYS+e6aBcGvXb7ViYMl/ZIUdOtLMQ4C3ndTfB1RBtmLGl0 oC4Q== X-Gm-Message-State: APjAAAX9L2qjS5/Kyp7i0ToAiZQx02w6qECEmvXhtS4yufzdze0sbwga WdTwOlEGbvK0KPtcGSPy2CDY+g== X-Google-Smtp-Source: APXvYqwRYj53IGS6MgJu+S2mMB4quYQFZqOKtlBnPw8F4/dlXLBFdFoS3r+Bqbu4Q5qqf1AIHPP0WQ== X-Received: by 2002:a37:a38e:: with SMTP id m136mr12141120qke.120.1552012404117; Thu, 07 Mar 2019 18:33:24 -0800 (PST) Received: from mutt-hbsd ([151.196.118.239]) by smtp.gmail.com with ESMTPSA id f7sm3522562qke.28.2019.03.07.18.33.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 18:33:23 -0800 (PST) Date: Thu, 7 Mar 2019 21:32:46 -0500 From: Shawn Webb To: Kirk McKusick Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r344861 - in stable/11: sbin/fsck_ffs sbin/fsdb sys/ufs/ffs Message-ID: <20190308023246.6krhyatucbugjtsx@mutt-hbsd> References: <201903062359.x26NxugE086319@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6pkb3iuc6mfvhrdi" Content-Disposition: inline In-Reply-To: <201903062359.x26NxugE086319@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hbsd 13.0-CURRENT-HBSD FreeBSD 13.0-CURRENT-HBSD HARDENEDBSD-13-CURRENT amd64 X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: NeoMutt/20180716 X-Rspamd-Queue-Id: BCBA186691 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=hardenedbsd.org header.s=google header.b=TygGPw/1; spf=pass (mx1.freebsd.org: domain of shawn.webb@hardenedbsd.org designates 2607:f8b0:4864:20::743 as permitted sender) smtp.mailfrom=shawn.webb@hardenedbsd.org X-Spamd-Result: default: False [-5.33 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[hardenedbsd.org:+]; MX_GOOD(-0.01)[alt1.aspmx.l.google.com,aspmx.l.google.com,aspmx2.googlemail.com,alt2.aspmx.l.google.com,aspmx3.googlemail.com]; NEURAL_HAM_SHORT(-0.88)[-0.882,0]; SIGNED_PGP(-2.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; IP_SCORE(-0.33)[ip: (3.17), ipnet: 2607:f8b0::/32(-2.72), asn: 15169(-2.05), country: US(-0.07)]; RECEIVED_SPAMHAUS_PBL(0.00)[239.118.196.151.zen.spamhaus.org : 127.0.0.10]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[hardenedbsd.org:s=google]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-stable@freebsd.org]; DMARC_NA(0.00)[hardenedbsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[3.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; MID_RHS_NOT_FQDN(0.50)[] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Mar 2019 02:33:26 -0000 --6pkb3iuc6mfvhrdi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 06, 2019 at 11:59:56PM +0000, Kirk McKusick wrote: > Author: mckusick > Date: Wed Mar 6 23:59:56 2019 > New Revision: 344861 > URL: https://svnweb.freebsd.org/changeset/base/344861 >=20 > Log: > MFC of 344552 and 344732 > =20 > Have fsck_ffs adjust size for files with hole at end > =20 > Tighten last lbn calculation > =20 > Sponsored by: Netflix >=20 > Modified: > stable/11/sbin/fsck_ffs/fsck.h > stable/11/sbin/fsck_ffs/globs.c > stable/11/sbin/fsck_ffs/inode.c > stable/11/sbin/fsck_ffs/pass1.c > stable/11/sbin/fsck_ffs/setup.c > stable/11/sbin/fsdb/fsdb.c > stable/11/sys/ufs/ffs/ffs_alloc.c > stable/11/sys/ufs/ffs/fs.h > Directory Properties: > stable/11/ (props changed) >=20 > Modified: stable/11/sbin/fsck_ffs/fsck.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/11/sbin/fsck_ffs/fsck.h Wed Mar 6 23:54:55 2019 (r344860) > +++ stable/11/sbin/fsck_ffs/fsck.h Wed Mar 6 23:59:56 2019 (r344861) > @@ -230,6 +230,7 @@ struct inodesc { > ufs_lbn_t id_lbn; /* logical block number of current block */ > ufs2_daddr_t id_blkno; /* current block number being examined */ > int id_numfrags; /* number of frags contained in block */ > + ufs_lbn_t id_lballoc; /* pass1: last LBN that is allocated */ > off_t id_filesize; /* for DATA nodes, the size of the directory */ > ufs2_daddr_t id_entryno;/* for DATA nodes, current entry number */ > int id_loc; /* for DATA nodes, current location in dir */ > @@ -289,6 +290,7 @@ extern long countdirs; /* number of directories we ac > #define MIBSIZE 3 /* size of fsck sysctl MIBs */ > extern int adjrefcnt[MIBSIZE]; /* MIB command to adjust inode reference = cnt */ > extern int adjblkcnt[MIBSIZE]; /* MIB command to adjust inode block coun= t */ > +extern int setsize[MIBSIZE]; /* MIB command to set inode size */ > extern int adjndir[MIBSIZE]; /* MIB command to adjust number of director= ies */ > extern int adjnbfree[MIBSIZE]; /* MIB command to adjust number of free b= locks */ > extern int adjnifree[MIBSIZE]; /* MIB command to adjust number of free i= nodes */ >=20 > Modified: stable/11/sbin/fsck_ffs/globs.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/11/sbin/fsck_ffs/globs.c Wed Mar 6 23:54:55 2019 (r344860) > +++ stable/11/sbin/fsck_ffs/globs.c Wed Mar 6 23:59:56 2019 (r344861) > @@ -61,6 +61,7 @@ unsigned long numdirs, listmax; > long countdirs; /* number of directories we actually found */ > int adjrefcnt[MIBSIZE]; /* MIB command to adjust inode reference cnt */ > int adjblkcnt[MIBSIZE]; /* MIB command to adjust inode block count */ > +int setsize[MIBSIZE]; /* MIB command to set inode size */ > int adjndir[MIBSIZE]; /* MIB command to adjust number of directories */ > int adjnbfree[MIBSIZE]; /* MIB command to adjust number of free blocks */ > int adjnifree[MIBSIZE]; /* MIB command to adjust number of free inodes */ > @@ -128,6 +129,7 @@ fsckinit(void) > countdirs =3D 0; > bzero(adjrefcnt, sizeof(int) * MIBSIZE); > bzero(adjblkcnt, sizeof(int) * MIBSIZE); > + bzero(setsize, sizeof(int) * MIBSIZE); > bzero(adjndir, sizeof(int) * MIBSIZE); > bzero(adjnbfree, sizeof(int) * MIBSIZE); > bzero(adjnifree, sizeof(int) * MIBSIZE); >=20 > Modified: stable/11/sbin/fsck_ffs/inode.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/11/sbin/fsck_ffs/inode.c Wed Mar 6 23:54:55 2019 (r344860) > +++ stable/11/sbin/fsck_ffs/inode.c Wed Mar 6 23:59:56 2019 (r344861) > @@ -124,9 +124,9 @@ ckinode(union dinode *dp, struct inodesc *idesc) > ret =3D iblock(idesc, i + 1, remsize, BT_LEVEL1 + i); > if (ret & STOP) > return (ret); > - } else { > + } else if (remsize > 0) { > idesc->id_lbn +=3D sizepb / sblock.fs_bsize; > - if (idesc->id_type =3D=3D DATA && remsize > 0) { > + if (idesc->id_type =3D=3D DATA) { > /* An empty block in a directory XXX */ > getpathname(pathbuf, idesc->id_number, > idesc->id_number); >=20 > Modified: stable/11/sbin/fsck_ffs/pass1.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/11/sbin/fsck_ffs/pass1.c Wed Mar 6 23:54:55 2019 (r344860) > +++ stable/11/sbin/fsck_ffs/pass1.c Wed Mar 6 23:59:56 2019 (r344861) > @@ -245,6 +245,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r > off_t kernmaxfilesize; > ufs2_daddr_t ndb; > mode_t mode; > + uintmax_t fixsize; > int j, ret, offset; > =20 > if ((dp =3D getnextinode(inumber, rebuildcg)) =3D=3D NULL) > @@ -375,6 +376,7 @@ checkinode(ino_t inumber, struct inodesc *idesc, int r > idesc->id_type =3D SNAP; > else > idesc->id_type =3D ADDR; > + idesc->id_lballoc =3D -1; > (void)ckinode(dp, idesc); > if (sblock.fs_magic =3D=3D FS_UFS2_MAGIC && dp->dp2.di_extsize > 0) { > idesc->id_type =3D ADDR; > @@ -420,6 +422,46 @@ checkinode(ino_t inumber, struct inodesc *idesc, int= r > rwerror("ADJUST INODE BLOCK COUNT", cmd.value); > } > } > + /* > + * Soft updates will always ensure that the file size is correct > + * for files that contain only direct block pointers. However > + * soft updates does not roll back sizes for files with indirect > + * blocks that it has set to unallocated because their contents > + * have not yet been written to disk. Hence, the file can appear > + * to have a hole at its end because the block pointer has been > + * rolled back to zero. Thus, id_lballoc tracks the last allocated > + * block in the file. Here, for files that extend into indirect > + * blocks, we check for a size past the last allocated block of > + * the file and if that is found, shorten the file to reference > + * the last allocated block to avoid having it reference a hole > + * at its end. > + */ > + if (DIP(dp, di_size) > UFS_NDADDR * sblock.fs_bsize && > + idesc->id_lballoc < lblkno(&sblock, DIP(dp, di_size) - 1)) { > + fixsize =3D lblktosize(&sblock, idesc->id_lballoc + 1); > + pwarn("INODE %lu: FILE SIZE %ju BEYOND END OF ALLOCATED FILE, " > + "SIZE SHOULD BE %ju", (u_long)inumber, > + (uintmax_t)DIP(dp, di_size), fixsize); > + if (preen) > + printf(" (ADJUSTED)\n"); > + else if (reply("ADJUST") =3D=3D 0) > + return (1); > + if (bkgrdflag =3D=3D 0) { > + dp =3D ginode(inumber); > + DIP_SET(dp, di_size, fixsize); > + inodirty(dp); > + } else { > + cmd.value =3D idesc->id_number; > + cmd.size =3D fixsize; > + if (debug) > + printf("setsize ino %ju size set to %ju\n", > + (uintmax_t)cmd.value, (uintmax_t)cmd.size); > + if (sysctl(setsize, MIBSIZE, 0, 0, > + &cmd, sizeof cmd) =3D=3D -1) > + rwerror("SET INODE SIZE", cmd.value); > + } > + > + } > return (1); > unknown: > pfatal("UNKNOWN FILE TYPE I=3D%lu", (u_long)inumber); > @@ -521,5 +563,7 @@ pass1check(struct inodesc *idesc) > */ > idesc->id_entryno++; > } > + if (idesc->id_lballoc =3D=3D -1 || idesc->id_lballoc < idesc->id_lbn) > + idesc->id_lballoc =3D idesc->id_lbn; > return (res); > } >=20 > Modified: stable/11/sbin/fsck_ffs/setup.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/11/sbin/fsck_ffs/setup.c Wed Mar 6 23:54:55 2019 (r344860) > +++ stable/11/sbin/fsck_ffs/setup.c Wed Mar 6 23:59:56 2019 (r344861) > @@ -134,6 +134,7 @@ setup(char *dev) > size =3D MIBSIZE; > if (sysctlnametomib("vfs.ffs.adjrefcnt", adjrefcnt, &size) < 0|| > sysctlnametomib("vfs.ffs.adjblkcnt", adjblkcnt, &size) < 0|| > + sysctlnametomib("vfs.ffs.setsize", setsize, &size) < 0 || > sysctlnametomib("vfs.ffs.freefiles", freefiles, &size) < 0|| > sysctlnametomib("vfs.ffs.freedirs", freedirs, &size) < 0 || > sysctlnametomib("vfs.ffs.freeblks", freeblks, &size) < 0) { >=20 > Modified: stable/11/sbin/fsdb/fsdb.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/11/sbin/fsdb/fsdb.c Wed Mar 6 23:54:55 2019 (r344860) > +++ stable/11/sbin/fsdb/fsdb.c Wed Mar 6 23:59:56 2019 (r344861) > @@ -157,6 +157,7 @@ CMDFUNC(chctime); /* Change ctime */ > CMDFUNC(chatime); /* Change atime */ > CMDFUNC(chinum); /* Change inode # of dirent */ > CMDFUNC(chname); /* Change dirname of dirent */ > +CMDFUNC(chsize); /* Change size */ > =20 > struct cmdtable cmds[] =3D { > { "help", "Print out help", 1, 1, FL_RO, helpfn }, > @@ -186,6 +187,7 @@ struct cmdtable cmds[] =3D { > { "chgrp", "Change group of current inode to GROUP", 2, 2, FL_WR, chgro= up }, > { "chflags", "Change flags of current inode to FLAGS", 2, 2, FL_WR, cha= flags }, > { "chgen", "Change generation number of current inode to GEN", 2, 2, FL= _WR, chgen }, > + { "chsize", "Change size of current inode to SIZE", 2, 2, FL_WR, chsize= }, > { "btime", "Change btime of current inode to BTIME", 2, 2, FL_WR, chbti= me }, > { "mtime", "Change mtime of current inode to MTIME", 2, 2, FL_WR, chmti= me }, > { "ctime", "Change ctime of current inode to CTIME", 2, 2, FL_WR, chcti= me }, > @@ -1009,6 +1011,31 @@ CMDFUNCSTART(chgen) > } > DIP_SET(curinode, di_gen, gen); > inodirty(); > + printactive(0); > + return rval; > +} > + > +CMDFUNCSTART(chsize) > +{ > + int rval =3D 1; > + off_t size; > + char *cp; > + > + if (!checkactive()) > + return 1; > + > + size =3D strtoll(argv[1], &cp, 0); > + if (cp =3D=3D argv[1] || *cp !=3D '\0') { > + warnx("bad size `%s'", argv[1]); > + return 1; > + } > + > + if (size < 0) { > + warnx("size set to negative (%jd)\n", (intmax_t)size); > + return(1); > + } > + DIP_SET(curinode, di_size, size); > + inodirty(curinode); > printactive(0); > return rval; > } >=20 > Modified: stable/11/sys/ufs/ffs/ffs_alloc.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/11/sys/ufs/ffs/ffs_alloc.c Wed Mar 6 23:54:55 2019 (r344860) > +++ stable/11/sys/ufs/ffs/ffs_alloc.c Wed Mar 6 23:59:56 2019 (r344861) > @@ -2688,6 +2688,8 @@ ffs_fserr(fs, inum, cp) > * the count to zero will cause the inode to be freed. > * adjblkcnt(inode, amt) - adjust the number of blocks used by the > * inode by the specified amount. > + * adjsize(inode, size) - set the size of the inode to the > + * specified size. > * adjndir, adjbfree, adjifree, adjffree, adjnumclusters(amt) - > * adjust the superblock summary. > * freedirs(inode, count) - directory inodes [inode..inode + count - 1] > @@ -2729,6 +2731,9 @@ SYSCTL_PROC(_vfs_ffs, FFS_ADJ_REFCNT, adjrefcnt, CT= LFL > static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_BLKCNT, adjblkcnt, CTLFLAG_WR, > sysctl_ffs_fsck, "Adjust Inode Used Blocks Count"); > =20 > +static SYSCTL_NODE(_vfs_ffs, FFS_SET_SIZE, setsize, CTLFLAG_WR, > + sysctl_ffs_fsck, "Set the inode size"); > + > static SYSCTL_NODE(_vfs_ffs, FFS_ADJ_NDIR, adjndir, CTLFLAG_WR, > sysctl_ffs_fsck, "Adjust number of directories"); > =20 > @@ -2875,6 +2880,23 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) > break; > ip =3D VTOI(vp); > DIP_SET(ip, i_blocks, DIP(ip, i_blocks) + cmd.size); > + ip->i_flag |=3D IN_CHANGE | IN_MODIFIED; > + error =3D ffs_update(vp, 1); > + vput(vp); > + break; > + > + case FFS_SET_SIZE: > +#ifdef DEBUG > + if (fsckcmds) { > + printf("%s: set inode %jd size to %jd\n", > + mp->mnt_stat.f_mntonname, (intmax_t)cmd.value, > + (intmax_t)cmd.size); > + } > +#endif /* DEBUG */ > + if ((error =3D ffs_vget(mp, (ino_t)cmd.value, LK_EXCLUSIVE, &vp))) > + break; > + ip =3D VTOI(vp); > + DIP_SET(ip, i_size, cmd.size); > ip->i_flag |=3D IN_CHANGE | IN_MODIFIED; > error =3D ffs_update(vp, 1); > vput(vp); >=20 > Modified: stable/11/sys/ufs/ffs/fs.h > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/11/sys/ufs/ffs/fs.h Wed Mar 6 23:54:55 2019 (r344860) > +++ stable/11/sys/ufs/ffs/fs.h Wed Mar 6 23:59:56 2019 (r344861) > @@ -219,7 +219,8 @@ > #define FFS_UNLINK 14 /* remove a name in the filesystem */ > #define FFS_SET_INODE 15 /* update an on-disk inode */ > #define FFS_SET_BUFOUTPUT 16 /* set buffered writing on descriptor */ > -#define FFS_MAXID 16 /* number of valid ffs ids */ > +#define FFS_SET_SIZE 17 /* set inode size */ > +#define FFS_MAXID 17 /* number of valid ffs ids */ Hey Kirk, This MFC breaks buildworld: http://jenkins.hardenedbsd.org/jenkins/job/HardenedBSD-11-STABLE-amd64/904/= console I'll take a look at providing a patch to fix it soon, unless you're able to get to it before I am. Thanks, --=20 Shawn Webb Cofounder and Security Engineer HardenedBSD Tor-ified Signal: +1 443-546-8752 Tor+XMPP+OTR: lattera@is.a.hacker.sx GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --6pkb3iuc6mfvhrdi Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEKrq2ve9q9Ia+iT2eaoRlj1JFbu4FAlyB1E0ACgkQaoRlj1JF bu7gvxAAlUNvbdlX0Z7iQRSUgHfU0vrvw0u/WGcyb9wtxE66gEO2Ty20Weyl6hsO RD3Ng8L4IsDxJb2htwSZw5vumOXM7AcHwdqSqfo7z1d6bCxnJGIScvEebrKpRRXg xVVWbG9D2Nd7Wz/mhiDaBM2FZnok/6asd9IDR8cMy6hKnweQZDtTeZKhSkxhczAH dVMmgczwQz+NVn61RuRpbZN5X7u3IbeQmDFHaji4KLKVkGqjOv6iz720v22BWQRW LEUnIPA761T4/yaIKEGGRhNtueJQ7t8O3XVH9CwxiGNBzp38/bE55yeZAk04LfK8 P7x2TbpWNI2tqPssZ14Y5HEBZvYeIZpxey9NhOGjuXhUFdYJV5w7qc1DY1ASCQoX VIxYDXVP7h+87PN+Eiae0FFmXMTUZg52Fm1A3AB70pz4FVPTOVFr4ax8xLydniXq xOI8t+ZsE1HYSoASbW8ZW7Xq42u+cneI/vZE/TQRR4lTsrGSaIKO0D1N247B0xtZ yvOIP4/stskX9xcaPw16SvEiGwZx/hNYn2c1t7t32Zn5BXdjC8sU/a2BYvigTugv JdDZSYvyqVIcfgl9/H0vW8k6T5r2d99ZAOx+QhwHY7w09fLjE722GcTJZXMxcBHb Y9CX5CKKyaRiKb8ucLCpQgT+WvoWi44wXlozAUiawFNMt8Ke3Dk= =avPj -----END PGP SIGNATURE----- --6pkb3iuc6mfvhrdi--