From owner-svn-src-user@freebsd.org Mon Apr 1 07:46:42 2019 Return-Path: Delivered-To: svn-src-user@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 55E8B1591DD2 for ; Mon, 1 Apr 2019 07:46:42 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F069B8A129; Mon, 1 Apr 2019 07:46:41 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E37A7B4B6; Mon, 1 Apr 2019 07:46:41 +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 x317kfRX036255; Mon, 1 Apr 2019 07:46:41 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x317kf3d036254; Mon, 1 Apr 2019 07:46:41 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201904010746.x317kf3d036254@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Mon, 1 Apr 2019 07:46:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r345760 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 345760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F069B8A129 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 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, 01 Apr 2019 07:46:42 -0000 Author: pho Date: Mon Apr 1 07:46:41 2019 New Revision: 345760 URL: https://svnweb.freebsd.org/changeset/base/345760 Log: Fix the broken "mount -u". Style. Sponsored by: Dell EMC Isilon Modified: user/pho/stress2/misc/mountro.sh Modified: user/pho/stress2/misc/mountro.sh ============================================================================== --- user/pho/stress2/misc/mountro.sh Sun Mar 31 23:18:12 2019 (r345759) +++ user/pho/stress2/misc/mountro.sh Mon Apr 1 07:46:41 2019 (r345760) @@ -28,16 +28,15 @@ # $FreeBSD$ # - . ../default.cfg [ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 D=$diskimage -dede $D 1m 128 || exit +dd if=/dev/zero of=$D bs=1m count=128 status=none || exit 1 -mount | grep "$mntpoint" | grep -q /md && umount -f $mntpoint -mdconfig -l | grep -q $mdstart && mdconfig -d -u $mdstart +mount | grep "$mntpoint " | grep -q /md && umount -f $mntpoint +mdconfig -l | grep -q $mdstart && mdconfig -d -u $mdstart mdconfig -a -t vnode -f $D -u $mdstart || { rm -f $D; exit 1; } @@ -51,18 +50,17 @@ chmod 777 $mntpoint/stressX export RUNDIR=$mntpoint/stressX export runRUNTIME=4m (cd ..; ./run.sh disk.cfg > /dev/null 2>&1) & -sleep 30 +sleep 10 for i in `jot 10`; do - mount $mntpoint -u -o ro > /dev/null 2>&1 + mount -u -o ro $mntpoint sleep 3 - mount $mntpoint -u -o rw > /dev/null 2>&1 + mount -u -o rw $mntpoint sleep 3 -done -df -i $mntpoint +done > /dev/null 2>&1 -umount -f $mntpoint > /dev/null 2>&1 +umount -f $mntpoint mdconfig -d -u $mdstart rm -f $D -kill `ps -x | grep run.sh | grep -v grep | awk '{print $1}'` +pkill run.sh wait From owner-svn-src-user@freebsd.org Wed Apr 3 06:18:25 2019 Return-Path: Delivered-To: svn-src-user@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 B3EF9155ECF0 for ; Wed, 3 Apr 2019 06:18:25 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5360594177; Wed, 3 Apr 2019 06:18:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 294119CA0; Wed, 3 Apr 2019 06:18:25 +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 x336IPuR011147; Wed, 3 Apr 2019 06:18:25 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x336IPQi011146; Wed, 3 Apr 2019 06:18:25 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201904030618.x336IPQi011146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Wed, 3 Apr 2019 06:18:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r345835 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 345835 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5360594177 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 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: Wed, 03 Apr 2019 06:18:26 -0000 Author: pho Date: Wed Apr 3 06:18:24 2019 New Revision: 345835 URL: https://svnweb.freebsd.org/changeset/base/345835 Log: Added a test scenario for verifying that timestamps are not update on RO mounts. A regression test for r345800 Sponsored by: Dell EMC Isilon Added: user/pho/stress2/misc/mountro4.sh (contents, props changed) Added: user/pho/stress2/misc/mountro4.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/pho/stress2/misc/mountro4.sh Wed Apr 3 06:18:24 2019 (r345835) @@ -0,0 +1,102 @@ +#!/bin/sh + +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2019 Dell EMC Isilon +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +# Check that the time stamps are not updated for a RO mount. + +. ../default.cfg + +f1=$mntpoint/f1 +f2=$mntpoint/f2 +s=0 + +# ufs +mount | grep -q "on $mntpoint " && umount $mntpoint +[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 1g -u $mdstart +newfs $newfs_flags /dev/md$mdstart > /dev/null +mount /dev/md$mdstart $mntpoint || exit 1 +touch $f1 +mount -u -o ro $mntpoint +touch $f2 2>/dev/null && { echo "ufs: ro failed"; s=1; } +d1=`stat -f '%a %m %c' $f1` +sleep 1 +cat $f1 > /dev/null +d2=`stat -f '%a %m %c' $f1` +if [ "$d1" != "$d2" ]; then + echo "ufs: Access time was updated. $d1 != $d2" + s=1 +fi +mount -u -o rw $mntpoint +touch $f2 2>/dev/null || { echo "ufs: rw failed"; s=1; } +umount $mntpoint +mdconfig -d -u $mdstart + +# tmpfs +mount -o size=100m -t tmpfs null $mntpoint || exit 1 +touch $f1 +mount -u -o ro $mntpoint +touch $f2 2>/dev/null && { echo "tmpfs: ro failed"; s=1; } +d1=`stat -f '%a %m %c' $f1` +sleep 1 +cat $f1 > /dev/null +d2=`stat -f '%a %m %c' $f1` +if [ "$d1" != "$d2" ]; then + echo "tmpfs: Access time was updated. $d1 != $d2" + s=1 +fi +mount -u -o rw $mntpoint +touch $f2 2>/dev/null || { echo "tmpfs: rw failed"; s=1; } +umount $mntpoint + +# msdosfs +[ -c /dev/md$mdstart ] && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 1g -u $mdstart +bsdlabel -w md$mdstart auto +newfs_msdos /dev/md${mdstart}$part > /dev/null +mount -t msdosfs /dev/md${mdstart}$part $mntpoint || exit 1 + +touch $f1 +mount -u -o ro $mntpoint +touch $f2 2>/dev/null && { echo "msdosfs: ro failed"; s=1; } +d1=`stat -f '%a %m %c' $f1` +sleep 1 +cat $f1 > /dev/null +d2=`stat -f '%a %m %c' $f1` +if [ "$d1" != "$d2" ]; then + echo "msdosfs: Access time was updated. $d1 != $d2" + s=1 +fi +mount -u -o rw $mntpoint +touch $f2 2>/dev/null || { echo "msdosfs: rw failed"; s=1; } +umount $mntpoint +mdconfig -d -u $mdstart + +exit $s From owner-svn-src-user@freebsd.org Wed Apr 3 07:22:47 2019 Return-Path: Delivered-To: svn-src-user@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 404E21561B94 for ; Wed, 3 Apr 2019 07:22:47 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEBE497831; Wed, 3 Apr 2019 07:22:46 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC162A897; Wed, 3 Apr 2019 07:22:46 +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 x337MkUn049519; Wed, 3 Apr 2019 07:22:46 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x337Mkt6049518; Wed, 3 Apr 2019 07:22:46 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201904030722.x337Mkt6049518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Wed, 3 Apr 2019 07:22:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r345840 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 345840 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CEBE497831 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 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: Wed, 03 Apr 2019 07:22:47 -0000 Author: pho Date: Wed Apr 3 07:22:46 2019 New Revision: 345840 URL: https://svnweb.freebsd.org/changeset/base/345840 Log: Added tmpfs to the tested file systems. Added showing file mapping for RW and RO mounts. Sponsored by: Dell EMC Isilon Modified: user/pho/stress2/misc/mountu.sh Modified: user/pho/stress2/misc/mountu.sh ============================================================================== --- user/pho/stress2/misc/mountu.sh Wed Apr 3 07:09:28 2019 (r345839) +++ user/pho/stress2/misc/mountu.sh Wed Apr 3 07:22:46 2019 (r345840) @@ -1,9 +1,10 @@ #!/bin/sh # -# Copyright (c) 2012 Peter Holm -# All rights reserved. +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD # +# Copyright (c) 2019 Dell EMC Isilon +# # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: @@ -42,95 +43,198 @@ here=`pwd` cd /tmp sed '1,/^EOF/d' < $here/$0 > mountu.c -mycc -o mountu -Wall -Wextra -O2 mountu.c +mycc -o mountu -Wall -Wextra -O2 mountu.c || exit 1 rm -f mountu.c pstat() { - pid=`ps a | grep -v grep | grep /tmp/mountu | awk '{print $1}'` + local pid + pid=`ps ax | grep -v grep | grep /tmp/mountu | awk '{print $1}'` [ -n "$pid" ] && procstat -v $pid } +ck() { + if mount | grep $mntpoint | grep -q "read-only"; then + if pstat $!| awk "\$2 == \"$map\"" | grep -q " rw-"; then + echo + echo "$1 difference" + mount | grep $mntpoint + printf "RW mount mapping and RO mount mapping:\n%s\n" "$r" + pstat $! | awk "\$2 == \"$map\"" + status=$((status + 1)) + fi + else + echo "$1 mount point RO did not succeed" + mount | grep $mntpoint + status=$((status + 1)) + fi +} + +status=0 +file=$mntpoint/mountu.sh.file +mapfile=/tmp/mountu.sh.map mount | grep -q "$mntpoint " && umount $mntpoint -mdconfig -l | grep -q $mdstart && mdconfig -d -u $mdstart +mdconfig -l | grep -q $mdstart && mdconfig -d -u $mdstart mdconfig -a -t swap -s 100m -u $mdstart -bsdlabel -w md${mdstart} auto -newfs $newfs_flags md${mdstart}${part} > /dev/null -mount /dev/md${mdstart}${part} $mntpoint +bsdlabel -w md$mdstart auto +newfs $newfs_flags md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint chmod 777 $mntpoint -/tmp/mountu $mntpoint/file & - +# ufs +exec 5>$mapfile +/tmp/mountu UFS $file & +pid=$! sleep 1 -if ! mount -u -o ro $mntpoint 2>&1 | grep -q "Device busy"; then - echo "UFS FAILED" - pstat -fi -wait +map=`cat $mapfile`; rm $mapfile; exec 5>&- + +r=`pstat $! | awk "\\$2 == \"$map\""` +mount -u -o ro $mntpoint 2>/dev/null || mount -fu -o ro $mntpoint +ck UFS +mount -u -o rw $mntpoint +rm -f $file +wait $pid +s=$? +[ $s -ne 139 ] && { echo "UFS exit status is $s"; status=1; } while mount | grep -q "$mntpoint "; do umount $mntpoint || sleep 1 done - mdconfig -d -u $mdstart +# nfs if ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1; then - mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw $nfs_export \ + mount -t nfs -o tcp -o retrycnt=3 -o intr,soft -o rw $nfs_export \ $mntpoint - rm -f /tmp/file - /tmp/mountu $mntpoint/file & + sleep .2 + rm -f $file + /tmp/mountu NFS $file & + pid=$! sleep 1 - if ! mount -u -o ro $mntpoint 2>&1 | grep -q "Device busy"; then - echo "NFS FAILED" - fi - wait - umount $mntpoint + r=`pstat $! | awk "\\$2 == \"$map\""` + mount -u -o ro $mntpoint 2>/dev/null || + mount -fu -o ro $mntpoint 2>/dev/null + ck NFS + wait $pid + s=$? + [ $s -ne 139 ] && { echo "NFS exit status is $s"; status=1; } + + mount -u -o rw $mntpoint 2>/dev/null + sleep .2 + [ -f $file ] && rm -f $file + umount $mntpoint || umount $mntpoint fi +# msdos if [ -x /sbin/mount_msdosfs ]; then mdconfig -a -t swap -s 100m -u $mdstart - bsdlabel -w md${mdstart} auto + bsdlabel -w md$mdstart auto newfs_msdos -F 16 -b 8192 /dev/md${mdstart}$part > /dev/null 2>&1 mount_msdosfs -m 777 /dev/md${mdstart}$part $mntpoint - /tmp/mountu $mntpoint/file & + /tmp/mountu MSDOS $file & + pid=$! sleep 1 - if ! mount -u -o ro $mntpoint 2>&1 | grep -q "Device busy"; then - echo "MSDOS FAILED" - fi - wait + r=`pstat $! | awk "\\$2 == \"$map\""` + mount -u -o ro $mntpoint 2>/dev/null || mount -fu -o ro $mntpoint + ck MSDOS + wait $pid + s=$? + [ $s -ne 139 ] && { echo "MSDOS exit status is $s"; status=1; } + mount -u -o rw $mntpoint + rm -f $file while mount | grep -q "$mntpoint "; do umount $mntpoint || sleep 1 done + mdconfig -d -u $mdstart fi -rm -f /tmp/mountu /tmp/file + +# tmpfs +mount -t tmpfs null $mntpoint +chmod 777 $mntpoint + +/tmp/mountu TMPFS $file & +pid=$! + +sleep 1 +r=`pstat $! | awk "\\$2 == \"$map\""` +mount -u -o ro $mntpoint 2>/dev/null || mount -fu -o ro $mntpoint +ck TMPFS +sleep 1 +mount -u -o rw $mntpoint +rm -f $file +wait $pid +s=$? +[ $s -ne 139 ] && { echo "TMPFS exit status is $s"; status=1; } +while mount | grep -q "$mntpoint "; do + umount $mntpoint || sleep 1 +done + +rm -f /tmp/mountu exit 0 EOF -#include +/* kib@ noted: + UFS/NFS/msdosfs reclaim vnode on rw->ro forced remount, and + change the type of the underying object to OBJT_DEAD, but leave + the pages on the object queue and installed in the page tables. + Applications can read/write already mapped pages, but cannot + page in new pages, cannot observe possible further modifications + to already mapped pages (if ro->rw remount happen later), and + their updates to pages are not flushed to file. + + It is impossible to mimic this behaviour for tmpfs. + */ +#include +#include +#include + #include -#include -#include -#include +#include #include #include -#include -#include +#include +#include +#include #include #include -#include #define STARTADDR 0x0U -#define ADRSPACE 0x0640000U +#define ADRSPACE 0x0640000U +static void +sighandler(int signo, siginfo_t *si, void *uc1) +{ + ucontext_t *uc; + + uc = uc1; + printf("SIG%s at %p, addr %p\n", sys_signame[signo], si->si_addr, +#if defined(__i386__) + (void *)uc->uc_mcontext.mc_eip); +#else + (void *)uc->uc_mcontext.mc_rip); +#endif + exit(1); +} + int main(int argc __unused, char **argv) { - int fd, ps; + struct passwd *pw; + struct sigaction sa; void *p; size_t len; - struct passwd *pw; - char *c, *path; + int fd; + char *name, *path; + volatile char *c; + memset(&sa, 0, sizeof(sa)); + sa.sa_sigaction = sighandler; + sa.sa_flags = SA_SIGINFO; + if (sigaction(SIGSEGV, &sa, NULL) == -1) + err(1, "sigaction(SIGSEGV)"); + if (sigaction(SIGBUS, &sa, NULL) == -1) + err(1, "sigaction(SIGBUS)"); + if ((pw = getpwnam("nobody")) == NULL) err(1, "no such user: nobody"); @@ -143,7 +247,8 @@ main(int argc __unused, char **argv) p = (void *)STARTADDR; len = ADRSPACE; - path = argv[1]; + name = argv[1]; + path = argv[2]; if ((fd = open(path, O_CREAT | O_TRUNC | O_RDWR, 0622)) == -1) err(1,"open(%s)", path); if (ftruncate(fd, len) == -1) @@ -156,15 +261,25 @@ main(int argc __unused, char **argv) } err(1, "mmap(1)"); } + dprintf(5, "%p\n", p); - c = p; - ps = getpagesize(); - for (c = p; (void *)c < p + len; c += ps) { + for (c = p; (void *)c < p + len; c += PAGE_SIZE) { *c = 1; } close(fd); sleep(5); + fprintf(stderr, "%s: Late read start.\n", name); + for (c = p; (void *)c < p + len; c += PAGE_SIZE) { + *c = 1; + } + fprintf(stderr, "%s: Late read complete.\n", name); + + fprintf(stderr, "%s: Late write start.\n", name); + for (c = p; (void *)c < p + len; c += PAGE_SIZE) { + *c = 1; + } + fprintf(stderr, "%s: Late write complete.\n", name); return (0); } From owner-svn-src-user@freebsd.org Wed Apr 3 07:28:51 2019 Return-Path: Delivered-To: svn-src-user@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 32B851561C9D for ; Wed, 3 Apr 2019 07:28:51 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 499CF979AE; Wed, 3 Apr 2019 07:28:47 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x337SjHu025423; Wed, 3 Apr 2019 00:28:45 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x337Sjut025422; Wed, 3 Apr 2019 00:28:45 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904030728.x337Sjut025422@gndrsh.dnsmgr.net> Subject: Re: svn commit: r345840 - user/pho/stress2/misc In-Reply-To: <201904030722.x337Mkt6049518@repo.freebsd.org> To: Peter Holm Date: Wed, 3 Apr 2019 00:28:45 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-user@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 499CF979AE X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 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: Wed, 03 Apr 2019 07:28:51 -0000 > Author: pho > Date: Wed Apr 3 07:22:46 2019 > New Revision: 345840 > URL: https://svnweb.freebsd.org/changeset/base/345840 > > Log: > Added tmpfs to the tested file systems. > Added showing file mapping for RW and RO mounts. > > Sponsored by: Dell EMC Isilon > > Modified: > user/pho/stress2/misc/mountu.sh > > Modified: user/pho/stress2/misc/mountu.sh > ============================================================================== > --- user/pho/stress2/misc/mountu.sh Wed Apr 3 07:09:28 2019 (r345839) > +++ user/pho/stress2/misc/mountu.sh Wed Apr 3 07:22:46 2019 (r345840) > @@ -1,9 +1,10 @@ > #!/bin/sh > > # > -# Copyright (c) 2012 Peter Holm > -# All rights reserved. > +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD > # > +# Copyright (c) 2019 Dell EMC Isilon > +# Being on the record, it appears as if the date of original publication has been obliterated and replaced with a newer date. This is moving the date of expiration of the copyright forward and has case law that shows this to be the wrong thing to do. You can make it 2012, 2019 but you can not remove the original publication date. I am uncertain how the "you should never remove a copyright" rule apply here, so there is also that issue. > # Redistribution and use in source and binary forms, with or without > # modification, are permitted provided that the following conditions > # are met: > @@ -42,95 +43,198 @@ > here=`pwd` > cd /tmp > sed '1,/^EOF/d' < $here/$0 > mountu.c > -mycc -o mountu -Wall -Wextra -O2 mountu.c > +mycc -o mountu -Wall -Wextra -O2 mountu.c || exit 1 > rm -f mountu.c > > pstat() { > - pid=`ps a | grep -v grep | grep /tmp/mountu | awk '{print $1}'` > + local pid > + pid=`ps ax | grep -v grep | grep /tmp/mountu | awk '{print $1}'` > [ -n "$pid" ] && procstat -v $pid > } > > +ck() { > + if mount | grep $mntpoint | grep -q "read-only"; then > + if pstat $!| awk "\$2 == \"$map\"" | grep -q " rw-"; then > + echo > + echo "$1 difference" > + mount | grep $mntpoint > + printf "RW mount mapping and RO mount mapping:\n%s\n" "$r" > + pstat $! | awk "\$2 == \"$map\"" > + status=$((status + 1)) > + fi > + else > + echo "$1 mount point RO did not succeed" > + mount | grep $mntpoint > + status=$((status + 1)) > + fi > +} > + > +status=0 > +file=$mntpoint/mountu.sh.file > +mapfile=/tmp/mountu.sh.map > mount | grep -q "$mntpoint " && umount $mntpoint > -mdconfig -l | grep -q $mdstart && mdconfig -d -u $mdstart > +mdconfig -l | grep -q $mdstart && mdconfig -d -u $mdstart > mdconfig -a -t swap -s 100m -u $mdstart > -bsdlabel -w md${mdstart} auto > -newfs $newfs_flags md${mdstart}${part} > /dev/null > -mount /dev/md${mdstart}${part} $mntpoint > +bsdlabel -w md$mdstart auto > +newfs $newfs_flags md${mdstart}$part > /dev/null > +mount /dev/md${mdstart}$part $mntpoint > chmod 777 $mntpoint > > -/tmp/mountu $mntpoint/file & > - > +# ufs > +exec 5>$mapfile > +/tmp/mountu UFS $file & > +pid=$! > sleep 1 > -if ! mount -u -o ro $mntpoint 2>&1 | grep -q "Device busy"; then > - echo "UFS FAILED" > - pstat > -fi > -wait > +map=`cat $mapfile`; rm $mapfile; exec 5>&- > + > +r=`pstat $! | awk "\\$2 == \"$map\""` > +mount -u -o ro $mntpoint 2>/dev/null || mount -fu -o ro $mntpoint > +ck UFS > +mount -u -o rw $mntpoint > +rm -f $file > +wait $pid > +s=$? > +[ $s -ne 139 ] && { echo "UFS exit status is $s"; status=1; } > while mount | grep -q "$mntpoint "; do > umount $mntpoint || sleep 1 > done > - > mdconfig -d -u $mdstart > > +# nfs > if ping -c 2 `echo $nfs_export | sed 's/:.*//'` > /dev/null 2>&1; then > - mount -t nfs -o tcp -o retrycnt=3 -o intr -o soft -o rw $nfs_export \ > + mount -t nfs -o tcp -o retrycnt=3 -o intr,soft -o rw $nfs_export \ > $mntpoint > - rm -f /tmp/file > - /tmp/mountu $mntpoint/file & > + sleep .2 > + rm -f $file > + /tmp/mountu NFS $file & > + pid=$! > sleep 1 > > - if ! mount -u -o ro $mntpoint 2>&1 | grep -q "Device busy"; then > - echo "NFS FAILED" > - fi > - wait > - umount $mntpoint > + r=`pstat $! | awk "\\$2 == \"$map\""` > + mount -u -o ro $mntpoint 2>/dev/null || > + mount -fu -o ro $mntpoint 2>/dev/null > + ck NFS > + wait $pid > + s=$? > + [ $s -ne 139 ] && { echo "NFS exit status is $s"; status=1; } > + > + mount -u -o rw $mntpoint 2>/dev/null > + sleep .2 > + [ -f $file ] && rm -f $file > + umount $mntpoint || umount $mntpoint > fi > > +# msdos > if [ -x /sbin/mount_msdosfs ]; then > mdconfig -a -t swap -s 100m -u $mdstart > - bsdlabel -w md${mdstart} auto > + bsdlabel -w md$mdstart auto > newfs_msdos -F 16 -b 8192 /dev/md${mdstart}$part > /dev/null 2>&1 > mount_msdosfs -m 777 /dev/md${mdstart}$part $mntpoint > - /tmp/mountu $mntpoint/file & > + /tmp/mountu MSDOS $file & > + pid=$! > > sleep 1 > - if ! mount -u -o ro $mntpoint 2>&1 | grep -q "Device busy"; then > - echo "MSDOS FAILED" > - fi > - wait > + r=`pstat $! | awk "\\$2 == \"$map\""` > + mount -u -o ro $mntpoint 2>/dev/null || mount -fu -o ro $mntpoint > + ck MSDOS > + wait $pid > + s=$? > + [ $s -ne 139 ] && { echo "MSDOS exit status is $s"; status=1; } > + mount -u -o rw $mntpoint > + rm -f $file > > while mount | grep -q "$mntpoint "; do > umount $mntpoint || sleep 1 > done > + mdconfig -d -u $mdstart > fi > -rm -f /tmp/mountu /tmp/file > + > +# tmpfs > +mount -t tmpfs null $mntpoint > +chmod 777 $mntpoint > + > +/tmp/mountu TMPFS $file & > +pid=$! > + > +sleep 1 > +r=`pstat $! | awk "\\$2 == \"$map\""` > +mount -u -o ro $mntpoint 2>/dev/null || mount -fu -o ro $mntpoint > +ck TMPFS > +sleep 1 > +mount -u -o rw $mntpoint > +rm -f $file > +wait $pid > +s=$? > +[ $s -ne 139 ] && { echo "TMPFS exit status is $s"; status=1; } > +while mount | grep -q "$mntpoint "; do > + umount $mntpoint || sleep 1 > +done > + > +rm -f /tmp/mountu > exit 0 > EOF > -#include > +/* kib@ noted: > + UFS/NFS/msdosfs reclaim vnode on rw->ro forced remount, and > + change the type of the underying object to OBJT_DEAD, but leave > + the pages on the object queue and installed in the page tables. > + Applications can read/write already mapped pages, but cannot > + page in new pages, cannot observe possible further modifications > + to already mapped pages (if ro->rw remount happen later), and > + their updates to pages are not flushed to file. > + > + It is impossible to mimic this behaviour for tmpfs. > + */ > +#include > +#include > +#include > + > #include > -#include > -#include > -#include > +#include > #include > #include > -#include > -#include > +#include > +#include > +#include > #include > #include > -#include > > #define STARTADDR 0x0U > -#define ADRSPACE 0x0640000U > +#define ADRSPACE 0x0640000U > > +static void > +sighandler(int signo, siginfo_t *si, void *uc1) > +{ > + ucontext_t *uc; > + > + uc = uc1; > + printf("SIG%s at %p, addr %p\n", sys_signame[signo], si->si_addr, > +#if defined(__i386__) > + (void *)uc->uc_mcontext.mc_eip); > +#else > + (void *)uc->uc_mcontext.mc_rip); > +#endif > + exit(1); > +} > + > int > main(int argc __unused, char **argv) > { > - int fd, ps; > + struct passwd *pw; > + struct sigaction sa; > void *p; > size_t len; > - struct passwd *pw; > - char *c, *path; > + int fd; > + char *name, *path; > + volatile char *c; > > + memset(&sa, 0, sizeof(sa)); > + sa.sa_sigaction = sighandler; > + sa.sa_flags = SA_SIGINFO; > + if (sigaction(SIGSEGV, &sa, NULL) == -1) > + err(1, "sigaction(SIGSEGV)"); > + if (sigaction(SIGBUS, &sa, NULL) == -1) > + err(1, "sigaction(SIGBUS)"); > + > if ((pw = getpwnam("nobody")) == NULL) > err(1, "no such user: nobody"); > > @@ -143,7 +247,8 @@ main(int argc __unused, char **argv) > p = (void *)STARTADDR; > len = ADRSPACE; > > - path = argv[1]; > + name = argv[1]; > + path = argv[2]; > if ((fd = open(path, O_CREAT | O_TRUNC | O_RDWR, 0622)) == -1) > err(1,"open(%s)", path); > if (ftruncate(fd, len) == -1) > @@ -156,15 +261,25 @@ main(int argc __unused, char **argv) > } > err(1, "mmap(1)"); > } > + dprintf(5, "%p\n", p); > > - c = p; > - ps = getpagesize(); > - for (c = p; (void *)c < p + len; c += ps) { > + for (c = p; (void *)c < p + len; c += PAGE_SIZE) { > *c = 1; > } > > close(fd); > sleep(5); > + fprintf(stderr, "%s: Late read start.\n", name); > + for (c = p; (void *)c < p + len; c += PAGE_SIZE) { > + *c = 1; > + } > + fprintf(stderr, "%s: Late read complete.\n", name); > + > + fprintf(stderr, "%s: Late write start.\n", name); > + for (c = p; (void *)c < p + len; c += PAGE_SIZE) { > + *c = 1; > + } > + fprintf(stderr, "%s: Late write complete.\n", name); > > return (0); > } > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-user@freebsd.org Wed Apr 3 07:44:41 2019 Return-Path: Delivered-To: svn-src-user@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 BEE411562576 for ; Wed, 3 Apr 2019 07:44:41 +0000 (UTC) (envelope-from pho@holm.cc) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) (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 5E4E6685AF; Wed, 3 Apr 2019 07:44:41 +0000 (UTC) (envelope-from pho@holm.cc) Received: from x2.osted.lan (87-58-223-204-dynamic.dk.customer.tdc.net [87.58.223.204]) by relay01.pair.com (Postfix) with ESMTP id C8392D0307B; Wed, 3 Apr 2019 03:44:39 -0400 (EDT) Received: from x2.osted.lan (localhost [127.0.0.1]) by x2.osted.lan (8.15.2/8.15.2) with ESMTPS id x337iWg0066407 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Wed, 3 Apr 2019 09:44:33 +0200 (CEST) (envelope-from pho@x2.osted.lan) Received: (from pho@localhost) by x2.osted.lan (8.15.2/8.15.2/Submit) id x337iWun066406; Wed, 3 Apr 2019 09:44:32 +0200 (CEST) (envelope-from pho) Date: Wed, 3 Apr 2019 09:44:32 +0200 From: Peter Holm To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: Re: svn commit: r345840 - user/pho/stress2/misc Message-ID: <20190403074432.GA66279@x2.osted.lan> References: <201904030722.x337Mkt6049518@repo.freebsd.org> <201904030728.x337Sjut025422@gndrsh.dnsmgr.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201904030728.x337Sjut025422@gndrsh.dnsmgr.net> User-Agent: Mutt/1.11.1 (2018-12-01) X-Rspamd-Queue-Id: 5E4E6685AF X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 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: Wed, 03 Apr 2019 07:44:41 -0000 On Wed, Apr 03, 2019 at 12:28:45AM -0700, Rodney W. Grimes wrote: > > Author: pho > > Date: Wed Apr 3 07:22:46 2019 > > New Revision: 345840 > > URL: https://svnweb.freebsd.org/changeset/base/345840 > > > > Log: > > Added tmpfs to the tested file systems. > > Added showing file mapping for RW and RO mounts. > > > > Sponsored by: Dell EMC Isilon > > > > Modified: > > user/pho/stress2/misc/mountu.sh > > > > Modified: user/pho/stress2/misc/mountu.sh > > ============================================================================== > > --- user/pho/stress2/misc/mountu.sh Wed Apr 3 07:09:28 2019 (r345839) > > +++ user/pho/stress2/misc/mountu.sh Wed Apr 3 07:22:46 2019 (r345840) > > @@ -1,9 +1,10 @@ > > #!/bin/sh > > > > # > > -# Copyright (c) 2012 Peter Holm > > -# All rights reserved. > > +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > # > > +# Copyright (c) 2019 Dell EMC Isilon > > +# > > Being on the record, it appears as if the date of original > publication has been obliterated and replaced with a newer > date. This is moving the date of expiration of the copyright > forward and has case law that shows this to be the wrong > thing to do. > > You can make it 2012, 2019 but you can not remove the original > publication date. > > I am uncertain how the "you should never remove a copyright" > rule apply here, so there is also that issue. > So, would this be the right thing to do: Copyright (c) 2012 Peter Holm Copyright (c) 2019 Dell EMC Isilon I guess it's to late to just restore the original? - Peter From owner-svn-src-user@freebsd.org Wed Apr 3 07:50:19 2019 Return-Path: Delivered-To: svn-src-user@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 691D915627AF for ; Wed, 3 Apr 2019 07:50:19 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA6DC69D8C; Wed, 3 Apr 2019 07:50:18 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id x337oG9X025531; Wed, 3 Apr 2019 00:50:16 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id x337oGQO025530; Wed, 3 Apr 2019 00:50:16 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201904030750.x337oGQO025530@gndrsh.dnsmgr.net> Subject: Re: svn commit: r345840 - user/pho/stress2/misc In-Reply-To: <20190403074432.GA66279@x2.osted.lan> To: Peter Holm Date: Wed, 3 Apr 2019 00:50:16 -0700 (PDT) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-user@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: CA6DC69D8C X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 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: Wed, 03 Apr 2019 07:50:19 -0000 > On Wed, Apr 03, 2019 at 12:28:45AM -0700, Rodney W. Grimes wrote: > > > Author: pho > > > Date: Wed Apr 3 07:22:46 2019 > > > New Revision: 345840 > > > URL: https://svnweb.freebsd.org/changeset/base/345840 > > > > > > Log: > > > Added tmpfs to the tested file systems. > > > Added showing file mapping for RW and RO mounts. > > > > > > Sponsored by: Dell EMC Isilon > > > > > > Modified: > > > user/pho/stress2/misc/mountu.sh > > > > > > Modified: user/pho/stress2/misc/mountu.sh > > > ============================================================================== > > > --- user/pho/stress2/misc/mountu.sh Wed Apr 3 07:09:28 2019 (r345839) > > > +++ user/pho/stress2/misc/mountu.sh Wed Apr 3 07:22:46 2019 (r345840) > > > @@ -1,9 +1,10 @@ > > > #!/bin/sh > > > > > > # > > > -# Copyright (c) 2012 Peter Holm > > > -# All rights reserved. > > > +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > > # > > > +# Copyright (c) 2019 Dell EMC Isilon > > > +# > > > > Being on the record, it appears as if the date of original > > publication has been obliterated and replaced with a newer > > date. This is moving the date of expiration of the copyright > > forward and has case law that shows this to be the wrong > > thing to do. > > > > You can make it 2012, 2019 but you can not remove the original > > publication date. > > > > I am uncertain how the "you should never remove a copyright" > > rule apply here, so there is also that issue. > > > > So, would this be the right thing to do: > > Copyright (c) 2012 Peter Holm > Copyright (c) 2019 Dell EMC Isilon That would be one way to solve this, did you assign in anyway your original copyright to Dell/Emc/Isilon? If so then the norm for that would be: Copyright (c) 2012 Dell EMC Isilon Written by Peter Holm as a work for hire which I do not think is the case here, your simply doing work as there employee now, and that would take the form you used above: Copyright (c) 2012 Peter Holm Copyright (c) 2019 Dell EMC Isilon > > I guess it's to late to just restore the original? I do not see a need to restore it, so long as it ends up in a correct state. > - Peter Thanks for the quick response, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-user@freebsd.org Wed Apr 3 08:18:20 2019 Return-Path: Delivered-To: svn-src-user@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 018151563886 for ; Wed, 3 Apr 2019 08:18:20 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 996776B262; Wed, 3 Apr 2019 08:18:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 70917B127; Wed, 3 Apr 2019 08:18:19 +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 x338IJmN075869; Wed, 3 Apr 2019 08:18:19 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x338IJfD075868; Wed, 3 Apr 2019 08:18:19 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201904030818.x338IJfD075868@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Wed, 3 Apr 2019 08:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r345841 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 345841 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 996776B262 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.99 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 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: Wed, 03 Apr 2019 08:18:20 -0000 Author: pho Date: Wed Apr 3 08:18:18 2019 New Revision: 345841 URL: https://svnweb.freebsd.org/changeset/base/345841 Log: Restore original copyright notice. Reported by: "Rodney W. Grimes" Modified: user/pho/stress2/misc/mountu.sh Modified: user/pho/stress2/misc/mountu.sh ============================================================================== --- user/pho/stress2/misc/mountu.sh Wed Apr 3 07:22:46 2019 (r345840) +++ user/pho/stress2/misc/mountu.sh Wed Apr 3 08:18:18 2019 (r345841) @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: BSD-2-Clause-FreeBSD # +# Copyright (c) 2012 Peter Holm # Copyright (c) 2019 Dell EMC Isilon # # Redistribution and use in source and binary forms, with or without From owner-svn-src-user@freebsd.org Fri Apr 5 07:45:14 2019 Return-Path: Delivered-To: svn-src-user@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 3B302156DA78 for ; Fri, 5 Apr 2019 07:45:14 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D486283BFE; Fri, 5 Apr 2019 07:45:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A92C1A08D; Fri, 5 Apr 2019 07:45:13 +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 x357jDM7091690; Fri, 5 Apr 2019 07:45:13 GMT (envelope-from pho@FreeBSD.org) Received: (from pho@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x357jDdC091689; Fri, 5 Apr 2019 07:45:13 GMT (envelope-from pho@FreeBSD.org) Message-Id: <201904050745.x357jDdC091689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pho set sender to pho@FreeBSD.org using -f From: Peter Holm Date: Fri, 5 Apr 2019 07:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r345905 - user/pho/stress2/misc X-SVN-Group: user X-SVN-Commit-Author: pho X-SVN-Commit-Paths: user/pho/stress2/misc X-SVN-Commit-Revision: 345905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D486283BFE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.29 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: Fri, 05 Apr 2019 07:45:14 -0000 Author: pho Date: Fri Apr 5 07:45:13 2019 New Revision: 345905 URL: https://svnweb.freebsd.org/changeset/base/345905 Log: Added a timeout to this test. Do not call pthread_kill(3) with a undefined thread argument. Style fixes. Sponsored by: Dell EMC Isilon Modified: user/pho/stress2/misc/signal0.sh Modified: user/pho/stress2/misc/signal0.sh ============================================================================== --- user/pho/stress2/misc/signal0.sh Fri Apr 5 03:37:16 2019 (r345904) +++ user/pho/stress2/misc/signal0.sh Fri Apr 5 07:45:13 2019 (r345905) @@ -47,16 +47,20 @@ rm -f signal0.c cd $odir (cd ../testcases/swap; ./swap -t 5m -i 20 -h -v) > /dev/null 2>&1 & +s=0 +# The timeout was added after r345702, due to a longer runtime for +# an INVARIANTS kernel +start=`date +%s` for i in `jot 500`; do /tmp/signal0 + [ $((`date +%s` - start)) -gt 900 ] && + { echo "Timeout @ loop $i/500"; s=1; break; } done -while pkill -9 swap; do - : -done +while pkill -9 swap; do :; done wait rm -f /tmp/signal0 -exit +exit $s EOF #include @@ -64,32 +68,35 @@ EOF #include #include -void signal_handler(int signum, siginfo_t *si, void *context) { - if (signum != SIGUSR1) { - printf("FAIL bad signal, signum=%d\n", signum); - exit(1); - } +static void +signal_handler(int signum, siginfo_t *si, void *context) { + if (signum != SIGUSR1) { + printf("FAIL bad signal, signum=%d\n", signum); + exit(1); + } } -void *thread_func(void *arg) { - return arg; +static void +*thread_func(void *arg) { + return arg; } -int main(void) { - struct sigaction sa = { 0 }; - sa.sa_flags = SA_SIGINFO; - sa.sa_sigaction = signal_handler; - if (sigfillset(&sa.sa_mask) != 0) abort(); - if (sigaction(SIGUSR1, &sa, NULL) != 0) abort(); - for (int i = 0; i < 10000; i++) { - pthread_t t; - pthread_create(&t, NULL, thread_func, NULL); - pthread_kill(t, SIGUSR1); - /* - Side note. pthread_kill(3) call behaviour is undefined if pthread_create(3) - in the line before failed. - */ +int +main(void) +{ + struct sigaction sa = { 0 }; - } - return 0; + sa.sa_flags = SA_SIGINFO; + sa.sa_sigaction = signal_handler; + if (sigfillset(&sa.sa_mask) != 0) abort(); + if (sigaction(SIGUSR1, &sa, NULL) != 0) abort(); + for (int i = 0; i < 10000; i++) { + pthread_t t; + + if (pthread_create(&t, NULL, thread_func, NULL) == 0) + pthread_kill(t, SIGUSR1); + + } + + return (0); }