From owner-svn-src-user@freebsd.org Mon Mar 20 14:17:02 2017 Return-Path: Delivered-To: svn-src-user@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 718A4D13886 for ; Mon, 20 Mar 2017 14:17:02 +0000 (UTC) (envelope-from pho@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 mx1.freebsd.org (Postfix) with ESMTPS id 4958111DC; Mon, 20 Mar 2017 14:17:02 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2KEH1hw052762; Mon, 20 Mar 2017 14:17:01 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2KEH17x052758; Mon, 20 Mar 2017 14:17:01 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201703201417.v2KEH17x052758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 20 Mar 2017 14:17:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r315638 - user/pho/stress2/misc X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Mar 2017 14:17:02 -0000 Author: pho Date: Mon Mar 20 14:17:00 2017 New Revision: 315638 URL: https://svnweb.freebsd.org/changeset/base/315638 Log: Cast st_ino and st_nlink to uintmax_t for 64 bit inode changes. Modified: user/pho/stress2/misc/rename6.sh user/pho/stress2/misc/rename8.sh user/pho/stress2/misc/rename9.sh user/pho/stress2/misc/tmpfs8.sh Modified: user/pho/stress2/misc/rename6.sh ============================================================================== --- user/pho/stress2/misc/rename6.sh Mon Mar 20 13:11:30 2017 (r315637) +++ user/pho/stress2/misc/rename6.sh Mon Mar 20 14:17:00 2017 (r315638) @@ -133,10 +133,12 @@ main(void) if (stat(logfile, &sb1) == 0 && stat(new, &sb2) == 0 && bcmp(&sb1, &sb2, sizeof(sb1)) == 0) { fprintf(stderr, "At loop #%d\n", i); - fprintf(stderr, "%-15s: ino = %d, nlink = %d, size = %jd\n", - logfile, sb1.st_ino, sb1.st_nlink, sb1.st_blocks); - fprintf(stderr, "%-15s: ino = %d, nlink = %d, size = %jd\n", - new , sb2.st_ino, sb2.st_nlink, sb2.st_blocks); + fprintf(stderr, "%-15s: ino = %ju, nlink = %ju," + " size = %jd\n", logfile, (uintmax_t)sb1.st_ino, + (uintmax_t)sb1.st_nlink, sb1.st_blocks); + fprintf(stderr, "%-15s: ino = %ju, nlink = %ju, " + "size = %jd\n", new , (uintmax_t)sb2.st_ino, + (uintmax_t)sb2.st_nlink, sb2.st_blocks); } unlink(new); } Modified: user/pho/stress2/misc/rename8.sh ============================================================================== --- user/pho/stress2/misc/rename8.sh Mon Mar 20 13:11:30 2017 (r315637) +++ user/pho/stress2/misc/rename8.sh Mon Mar 20 14:17:00 2017 (r315638) @@ -157,8 +157,9 @@ main(int ac, char **av) err(1, "stat(%s)", file1); if (sb.st_ino != sb2.st_ino || sb.st_ino == always_ino) { - printf("FAIL. Bad stat: always: %d file1: %d (should be %d)\n", - always_ino, sb.st_ino, sb2.st_ino); + printf("FAIL. Bad stat: always: %ju file1: %ju (should be %ju)\n", + (uintmax_t)always_ino, (uintmax_t)sb.st_ino, + (uintmax_t)sb2.st_ino); r = EXIT_FAILURE; break; } Modified: user/pho/stress2/misc/rename9.sh ============================================================================== --- user/pho/stress2/misc/rename9.sh Mon Mar 20 13:11:30 2017 (r315637) +++ user/pho/stress2/misc/rename9.sh Mon Mar 20 14:17:00 2017 (r315638) @@ -116,12 +116,14 @@ main(void) bzero(&fa, sizeof(fa)); bzero(&ta, sizeof(ta)); - if ((fd = open(fromFile, O_RDWR | O_CREAT | O_TRUNC, 0644)) == -1) + if ((fd = open(fromFile, O_RDWR | O_CREAT | O_TRUNC, 0644)) + == -1) err(1, "creat(%s)", fromFile); close(fd); sprintf(toFile, "toFile.log.%05d", i); - if ((fd = open(toFile, O_RDWR | O_CREAT | O_TRUNC, 0644)) == -1) + if ((fd = open(toFile, O_RDWR | O_CREAT | O_TRUNC, 0644)) + == -1) err(1, "creat(%s)", toFile); write(fd, "xxx", 3); close(fd); @@ -135,22 +137,27 @@ main(void) err(1, "stat(%s)", toFile); if (tb.st_ino == ta.st_ino) { - fprintf(stderr, "FAIL: old and new \"To\" inode number is identical\n"); + fprintf(stderr, "FAIL: old and new \"To\" inode " + "number is identical\n"); fprintf(stderr, "stat() before the rename():\n"); fprintf(stderr, - "%-16s: ino = %4d, nlink = %d, size = %jd\n", - fromFile, fb.st_ino, fb.st_nlink, fb.st_blocks); + "%-16s: ino = %4ju, nlink = %ju, size = %jd\n", + fromFile, (uintmax_t)fb.st_ino, (uintmax_t)fb.st_nlink, + fb.st_blocks); fprintf(stderr, - "%-16s: ino = %4d, nlink = %d, size = %jd\n", - toFile, tb.st_ino, tb.st_nlink, tb.st_blocks); + "%-16s: ino = %4ju, nlink = %ju, size = %jd\n", + toFile, (uintmax_t)tb.st_ino, (uintmax_t)tb.st_nlink, + tb.st_blocks); fprintf(stderr, "\nstat() after the rename():\n"); if (fa.st_ino != 0) fprintf(stderr, - "%-16s: ino = %4d, nlink = %d, size = %jd\n", - fromFile, fa.st_ino, fa.st_nlink, fa.st_blocks); + "%-16s: ino = %4ju, nlink = %ju, size = " + "%jd\n", fromFile, (uintmax_t)fa.st_ino, + (uintmax_t)fa.st_nlink, fa.st_blocks); fprintf(stderr, - "%-16s: ino = %4d, nlink = %d, size = %jd\n", - toFile, ta.st_ino, ta.st_nlink, ta.st_blocks); + "%-16s: ino = %4ju, nlink = %ju, size = %jd\n", + toFile, (uintmax_t)ta.st_ino, (uintmax_t)ta.st_nlink, + ta.st_blocks); kill(spid, SIGINT); exit(1); } Modified: user/pho/stress2/misc/tmpfs8.sh ============================================================================== --- user/pho/stress2/misc/tmpfs8.sh Mon Mar 20 13:11:30 2017 (r315637) +++ user/pho/stress2/misc/tmpfs8.sh Mon Mar 20 14:17:00 2017 (r315638) @@ -140,10 +140,12 @@ main(void) if (r1 == 0 && r2 == 0 && bcmp(&sb1, &sb2, sizeof(sb1)) == 0) { fprintf(stderr, "FAIL 1\n"); - fprintf(stderr, "%-15s: ino = %4d, nlink = %d, size = %jd\n", - logfile, sb1.st_ino, sb1.st_nlink, sb1.st_blocks); - fprintf(stderr, "%-15s: ino = %4d, nlink = %d, size = %jd\n", - new , sb2.st_ino, sb2.st_nlink, sb2.st_blocks); + fprintf(stderr, "%-15s: ino = %4ju, nlink = %ju, " + "size = %jd\n", logfile, (uintmax_t)sb1.st_ino, + (uintmax_t)sb1.st_nlink, sb1.st_blocks); + fprintf(stderr, "%-15s: ino = %4ju, nlink = %ju, " + "size = %jd\n", new , (uintmax_t)sb2.st_ino, + (uintmax_t)sb2.st_nlink, sb2.st_blocks); } if (bcmp(&sb2, &sb3, sizeof(sb2)) == 0) { fprintf(stderr, "Old to file is lingering\n"); @@ -152,16 +154,20 @@ main(void) fprintf(stderr, "FAIL 2\n"); if (r1 == 0) fprintf(stderr, - "sb1: %-15s: ino = %4d, nlink = %d, size = %jd\n", - logfile, sb1.st_ino, sb1.st_nlink, sb1.st_blocks); + "sb1: %-15s: ino = %4ju, nlink = %ju, " + "size = %jd\n", logfile, + (uintmax_t)sb1.st_ino, + (uintmax_t)sb1.st_nlink, sb1.st_blocks); if (r2 == 0) fprintf(stderr, - "sb2: %-15s: ino = %4d, nlink = %d, size = %jd\n", - new, sb2.st_ino, sb2.st_nlink, sb2.st_blocks); + "sb2: %-15s: ino = %4ju, nlink = %ju, " + "size = %jd\n", new, (uintmax_t)sb2.st_ino, + (uintmax_t)sb2.st_nlink, sb2.st_blocks); if (r3 == 0) fprintf(stderr, - "sb3: %-15s: ino = %4d, nlink = %d, size = %jd\n", - new , sb3.st_ino, sb3.st_nlink, sb3.st_blocks); + "sb3: %-15s: ino = %4ju, nlink = %ju, " + "size = %jd\n", new, (uintmax_t)sb3.st_ino, + (uintmax_t)sb3.st_nlink, sb3.st_blocks); exit(1); } unlink(new);