From owner-svn-src-stable@freebsd.org Tue Jun 7 14:21:59 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A42E8B6D2BC for ; Tue, 7 Jun 2016 14:21:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm19-vm0.bullet.mail.bf1.yahoo.com (nm19-vm0.bullet.mail.bf1.yahoo.com [98.139.213.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 554261B83 for ; Tue, 7 Jun 2016 14:21:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1465309316; bh=CgzcogzWNJzI7Gh46+6Ju5A4UlB9IUsB2KpK3GVlfac=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=b+L0Aep6MKz6QLHbszmiC6iqAp8T4ja0teQhVb9z91pqy33cUr/hkSQPttqZJ3SErBZk6bYNfBlMiIqfPbjfPRlG4Kj4amKVqSWjlzIiHZipFN5/vyNBLQi+hFcUGemzRfdD1v7ggabrWo0mQN/lAW8AEHLd9nGDRUTSLNfeqpgLs17+86817R9QFq/vCjdeIGL/YIQY2eUY/7iT1SbLfq13lFrSuqQftzZiiJmrITm8RARyNUJ/wCDrBC9LCy0JB0xFHoBTj6+cDhQf4/0tmtA9vJcubCsFQ/8jJPdXIyNXiBWXg5UZ5BRbghTa6j8Wa58doHw/VamZNiFgR8kF/g== Received: from [66.196.81.170] by nm19.bullet.mail.bf1.yahoo.com with NNFMP; 07 Jun 2016 14:21:56 -0000 Received: from [98.139.211.205] by tm16.bullet.mail.bf1.yahoo.com with NNFMP; 07 Jun 2016 14:21:56 -0000 Received: from [127.0.0.1] by smtp214.mail.bf1.yahoo.com with NNFMP; 07 Jun 2016 14:21:56 -0000 X-Yahoo-Newman-Id: 163321.90188.bm@smtp214.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: rQDRkKoVM1l_KvnSZYd3cswUwcLDq8x1_Z1zCWBEAdciUha OhxSX7aJf9J_ELQnbWQzFt_p7AqVxRG5wB_3DxFk3o5qcuuH5Sy3eiRF0KDD 9NheBkpVY3vNpcOKPVlzObeTQK64dF_l1etfFgHOZpXoHM2Q5xpyBAatvCPS QvFVG6Rd2OvG9uEmAsWqE7BcHwtmawdKOrWEKYBA_GlIOtw6JBlv2rcHhcVi Cqz4qYul3PgM_8002wKQErR80cETAVCuNgJXBhn_OTw__ZtYBpPWkyeiz3Kn nDaNKUTwx_nydjl.DJq34.TRYZ4yZeHRcR93T9GmqDni6vG3Lzdce4unu3Mj GBtGJ_Fm1GHbeFzsjen1u1OcgV_m0YkeFsBNdX5m7pIpX9eMHdVcpqZysEHP 4JvdQKBzLy2ouWSX2K4o.AkjVV4eKvukE3xCuWpCB4aX2eBUxBX1191A6GjD ZmHgkn48QKS7Tb7N0rvkShEYiYAxavGytRw.ufXwbF8KNWWMG_2R4nyyrcVC qDppsAHQ0VxTq.XnpuPYVE17uyxdbvnKI X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r299954 - stable/10/sbin/restore To: David Malone References: <201605161629.u4GGTumH048298@repo.freebsd.org> <20160607055240.GA53732@walton.maths.tcd.ie> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org From: Pedro Giffuni Message-ID: <1601b9c2-41a8-03e4-fa8f-3ccf4785ecd4@FreeBSD.org> Date: Tue, 7 Jun 2016 09:21:16 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <20160607055240.GA53732@walton.maths.tcd.ie> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.22 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: Tue, 07 Jun 2016 14:21:59 -0000 H David; On 06/07/16 00:52, David Malone wrote: > Hi Pedro, > > The OpenBSD commit message said off_t, but you commit and commit > message says size_t, which won't be bigger than a long on some of > our platforms. Should it have been off_t, or did I misunderstand > something? > You didn't misunderstand anything. The OpenBSD commit logs says off_t but their commit also has size_t's. I didn't feel like changing their commit log but still wanted to keep the "spirit" of the change and give them credit. size_t is bigger on the platforms that matter, plus it is unsigned. Pedro. > David. >> Author: pfg >> Date: Mon May 16 16:29:56 2016 >> New Revision: 299954 >> URL: https://svnweb.freebsd.org/changeset/base/299954 >> >> Log: >> MFC r298901: >> restore: promote some getfiles() parameters to size_t. >> >> This is based on a change from OpenBSD: >> >> "Fix restore so that it can actually restore files larger than 4GB by >> changing the type of "size" to off_t in getfiles() plus little dependent >> type cleanup, from Daniel Lucq." >> >> It is an important for machines with 32 bit longs. >> While here unsign the flags, also from OpenBSD. >> >> Obtained from: OpenBSD (with changes) >> >> Modified: >> stable/10/sbin/restore/dirs.c >> stable/10/sbin/restore/extern.h >> stable/10/sbin/restore/tape.c >> Directory Properties: >> stable/10/ (props changed) >> >> Modified: stable/10/sbin/restore/dirs.c >> ============================================================================== >> --- stable/10/sbin/restore/dirs.c Mon May 16 16:16:46 2016 (r299953) >> +++ stable/10/sbin/restore/dirs.c Mon May 16 16:29:56 2016 (r299954) >> @@ -85,7 +85,7 @@ struct modeinfo { >> mode_t mode; >> uid_t uid; >> gid_t gid; >> - int flags; >> + u_int flags; >> int extsize; >> }; >> >> @@ -115,8 +115,8 @@ static struct inotab *allocinotab(struct >> static void flushent(void); >> static struct inotab *inotablookup(ino_t); >> static RST_DIR *opendirfile(const char *); >> -static void putdir(char *, long); >> -static void putdirattrs(char *, long); >> +static void putdir(char *, size_t); >> +static void putdirattrs(char *, size_t); >> static void putent(struct direct *); >> static void rst_seekdir(RST_DIR *, long, long); >> static long rst_telldir(RST_DIR *); >> @@ -323,10 +323,10 @@ searchdir(ino_t inum, char *name) >> * Put the directory entries in the directory file >> */ >> static void >> -putdir(char *buf, long size) >> +putdir(char *buf, size_t size) >> { >> struct direct *dp; >> - long loc, i; >> + size_t loc, i; >> >> for (loc = 0; loc < size; ) { >> dp = (struct direct *)(buf + loc); >> @@ -356,12 +356,12 @@ putdir(char *buf, long size) >> "reclen not multiple of 4 "); >> if (dp->d_reclen < DIRSIZ(0, dp)) >> vprintf(stdout, >> - "reclen less than DIRSIZ (%d < %zu) ", >> + "reclen less than DIRSIZ (%u < %zu) ", >> dp->d_reclen, DIRSIZ(0, dp)); >> #if NAME_MAX < 255 >> if (dp->d_namlen > NAME_MAX) >> vprintf(stdout, >> - "reclen name too big (%d > %d) ", >> + "reclen name too big (%u > %u) ", >> dp->d_namlen, NAME_MAX); >> #endif >> vprintf(stdout, "\n"); >> @@ -418,7 +418,7 @@ flushent(void) >> * Save extended attributes for a directory entry to a file. >> */ >> static void >> -putdirattrs(char *buf, long size) >> +putdirattrs(char *buf, size_t size) >> { >> >> if (mf != NULL && fwrite(buf, size, 1, mf) != 1) >> >> Modified: stable/10/sbin/restore/extern.h >> ============================================================================== >> --- stable/10/sbin/restore/extern.h Mon May 16 16:16:46 2016 (r299953) >> +++ stable/10/sbin/restore/extern.h Mon May 16 16:29:56 2016 (r299954) >> @@ -54,8 +54,8 @@ void freeentry(struct entry *); >> void freename(char *); >> int genliteraldir(char *, ino_t); >> char *gentempname(struct entry *); >> -void getfile(void (*)(char *, long), void (*)(char *, long), >> - void (*)(char *, long)); >> +void getfile(void (*)(char *, size_t), void (*)(char *, size_t), >> + void (*)(char *, size_t)); >> void getvol(long); >> void initsymtable(char *); >> int inodetype(ino_t); >> @@ -98,7 +98,7 @@ void swabst(u_char *, u_char *); >> void treescan(char *, ino_t, long (*)(char *, ino_t, int)); >> ino_t upperbnd(ino_t); >> long verifyfile(char *, ino_t, int); >> -void xtrnull(char *, long); >> +void xtrnull(char *, size_t); >> >> /* From ../dump/dumprmt.c */ >> void rmtclose(void); >> >> Modified: stable/10/sbin/restore/tape.c >> ============================================================================== >> --- stable/10/sbin/restore/tape.c Mon May 16 16:16:46 2016 (r299953) >> +++ stable/10/sbin/restore/tape.c Mon May 16 16:29:56 2016 (r299954) >> @@ -104,7 +104,7 @@ static int checksum(int *); >> static void findinode(struct s_spcl *); >> static void findtapeblksize(void); >> static char *setupextattr(int); >> -static void xtrattr(char *, long); >> +static void xtrattr(char *, size_t); >> static void set_extattr_link(char *, void *, int); >> static void set_extattr_fd(int, char *, void *, int); >> static int gethead(struct s_spcl *); >> @@ -114,12 +114,12 @@ static u_long swabl(u_long); >> static u_char *swablong(u_char *, int); >> static u_char *swabshort(u_char *, int); >> static void terminateinput(void); >> -static void xtrfile(char *, long); >> -static void xtrlnkfile(char *, long); >> -static void xtrlnkskip(char *, long); >> -static void xtrmap(char *, long); >> -static void xtrmapskip(char *, long); >> -static void xtrskip(char *, long); >> +static void xtrfile(char *, size_t); >> +static void xtrlnkfile(char *, size_t); >> +static void xtrlnkskip(char *, size_t); >> +static void xtrmap(char *, size_t); >> +static void xtrmapskip(char *, size_t); >> +static void xtrskip(char *, size_t); >> >> /* >> * Set up an input source >> @@ -564,7 +564,7 @@ printdumpinfo(void) >> int >> extractfile(char *name) >> { >> - int flags; >> + u_int flags; >> uid_t uid; >> gid_t gid; >> mode_t mode; >> @@ -931,13 +931,13 @@ skipfile(void) >> * to the skip function. >> */ >> void >> -getfile(void (*datafill)(char *, long), void (*attrfill)(char *, long), >> - void (*skip)(char *, long)) >> +getfile(void (*datafill)(char *, size_t), void (*attrfill)(char *, size_t), >> + void (*skip)(char *, size_t)) >> { >> int i; >> - off_t size; >> + volatile off_t size; >> int curblk, attrsize; >> - void (*fillit)(char *, long); >> + void (*fillit)(char *, size_t); >> static char clearedbuf[MAXBSIZE]; >> char buf[MAXBSIZE / TP_BSIZE][TP_BSIZE]; >> char junk[TP_BSIZE]; >> @@ -1066,7 +1066,7 @@ setupextattr(int extsize) >> * Extract the next block of extended attributes. >> */ >> static void >> -xtrattr(char *buf, long size) >> +xtrattr(char *buf, size_t size) >> { >> >> if (extloc + size > extbufsize) >> @@ -1079,7 +1079,7 @@ xtrattr(char *buf, long size) >> * Write out the next block of a file. >> */ >> static void >> -xtrfile(char *buf, long size) >> +xtrfile(char *buf, size_t size) >> { >> >> if (Nflag) >> @@ -1096,7 +1096,7 @@ xtrfile(char *buf, long size) >> */ >> /* ARGSUSED */ >> static void >> -xtrskip(char *buf, long size) >> +xtrskip(char *buf, size_t size) >> { >> >> if (lseek(ofile, size, SEEK_CUR) == -1) { >> @@ -1111,7 +1111,7 @@ xtrskip(char *buf, long size) >> * Collect the next block of a symbolic link. >> */ >> static void >> -xtrlnkfile(char *buf, long size) >> +xtrlnkfile(char *buf, size_t size) >> { >> >> pathlen += size; >> @@ -1128,7 +1128,7 @@ xtrlnkfile(char *buf, long size) >> */ >> /* ARGSUSED */ >> static void >> -xtrlnkskip(char *buf, long size) >> +xtrlnkskip(char *buf, size_t size) >> { >> >> fprintf(stderr, "unallocated block in symbolic link %s\n", >> @@ -1140,7 +1140,7 @@ xtrlnkskip(char *buf, long size) >> * Collect the next block of a bit map. >> */ >> static void >> -xtrmap(char *buf, long size) >> +xtrmap(char *buf, size_t size) >> { >> >> memmove(map, buf, size); >> @@ -1152,7 +1152,7 @@ xtrmap(char *buf, long size) >> */ >> /* ARGSUSED */ >> static void >> -xtrmapskip(char *buf, long size) >> +xtrmapskip(char *buf, size_t size) >> { >> >> panic("hole in map\n"); >> @@ -1164,7 +1164,7 @@ xtrmapskip(char *buf, long size) >> */ >> /* ARGSUSED */ >> void >> -xtrnull(char *buf, long size) >> +xtrnull(char *buf, size_t size) >> { >> >> return; >>