From 50031179a109b0cb118d8a90e8f4a5acdb80bdd6 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Fri, 18 Aug 2006 06:13:04 +0000 Subject: [PATCH] Fix the file_as_id routine so it works for test 050. Merge of master-melb:xfs-cmds:26811a by kenmcd. --- 050.out | 4 ++-- common.config | 4 ++-- common.quota | 16 ++++++++++------ 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/050.out b/050.out index 8acde7b2..67951cb0 100644 --- a/050.out +++ b/050.out @@ -152,11 +152,11 @@ realtime =RDEV extsz=XXX blocks=XXX, rtextents=XXX *** push past the hard inode limit (expect EDQUOT) [ROOT] 0 0 0 00 [--------] 3 0 0 00 [--------] 0 0 0 00 [--------] -[NAME] 140 100 500 00 [7 days] 10 4 10 00 [7 days] 0 0 0 00 [--------] +[NAME] 140 100 500 00 [7 days] 9 4 10 00 [7 days] 0 0 0 00 [--------] *** push past the hard block limit (expect EDQUOT) [ROOT] 0 0 0 00 [--------] 3 0 0 00 [--------] 0 0 0 00 [--------] -[NAME] =OK= 100 500 00 [7 days] 10 4 10 00 [7 days] 0 0 0 00 [--------] +[NAME] =OK= 100 500 00 [7 days] 9 4 10 00 [7 days] 0 0 0 00 [--------] *** unmount *** pqnoenforce diff --git a/common.config b/common.config index 718e07f6..b3e82eb0 100644 --- a/common.config +++ b/common.config @@ -174,11 +174,11 @@ known_hosts() SCRATCH_MNT=/mnt/scratch SCRATCH_DEV=/dev/sdb5 SCRATCH_RTDEV=/dev/sdc1 - SCRATCH_LOGDEV=/dev/sda11 + SCRATCH_LOGDEV=/dev/ram0 TEST_DIR=/mnt/test TEST_DEV=/dev/sdc3 TEST_RTDEV=/dev/sdb6 - TEST_LOGDEV=/dev/sda9 + TEST_LOGDEV=/dev/ram1 #TAPE_DEV=/dev/st0 #RMT_TAPE_DEV=bruce:/dev/st0 #RMT_IRIXTAPE_DEV=snort:/dev/tape diff --git a/common.quota b/common.quota index 5ed7b809..77368a55 100644 --- a/common.quota +++ b/common.quota @@ -39,18 +39,17 @@ _require_nobody() } # create a file as a specific user (uid) -# takes filename, id, type (u/g), blocksize, blockcount +# takes filename, id, type (u/g/p), blocksize, blockcount # _file_as_id() { [ $# != 5 ] && _notrun "broken call to _file_as_id in test $seq" + parent=`dirname $1` if [ $3 = p ]; then - size=`expr $4 \* $5`; - echo xfs_io -f -c "chproj $2" -c "pwrite -b $4 0 $size" $1 >>$seq.full - $XFS_IO_PROG -f -c "chproj $2" -c "pwrite -b $4 0 $size" $1 \ - >>$seq.full 2>&1 - return + echo PARENT: xfs_io -r -c "chproj $2" -c "chattr +P" $parent >>$seq.full + $XFS_IO_PROG -r -c "chproj $2" -c "chattr +P" $parent >>$seq.full 2>&1 + magik='$>' # (irrelevent, above set projid-inherit-on-parent) elif [ $3 = u ]; then magik='$>' # perlspeak for effective uid elif [ $3 = g ]; then @@ -72,6 +71,11 @@ _file_as_id() EOF # for debugging the above euid change, try... [need write in cwd] # exec "dd if=/dev/zero of=$1 bs=$4 count=$5 >>$seq.full 2>&1"; + + if [ $3 = p ]; then + echo PARENT: xfs_io -r -c "chproj 0" -c "chattr -P" $parent >>$seq.full + $XFS_IO_PROG -r -c "chproj 0" -c "chattr -P" $parent >>$seq.full 2>&1 + fi } _choose_uid() -- 2.47.3