From 174843cb1a077e3f0fa4658b170add56195d5c37 Mon Sep 17 00:00:00 2001 From: Erez_Zadok Date: Wed, 11 Jul 2007 21:58:50 -0400 Subject: [PATCH] fix truncate test so it checks for chattr ability after mounting the union Also recheck chattr ability after each union mount. This is because the mount_union routine may have changed the underlying mounts to cramfs/squashfs. --- t-truncate-all.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/t-truncate-all.sh b/t-truncate-all.sh index e09399c..411faa2 100755 --- a/t-truncate-all.sh +++ b/t-truncate-all.sh @@ -51,14 +51,17 @@ dd if=/dev/zero of=$LOWER_DIR2/d1/d2/d3/d4/e bs=4000 count=2 2>/dev/null dd if=/dev/zero of=$LOWER_DIR2/d1/d2/d3/d4/f bs=4000 count=2 2>/dev/null +# mount unionfs +mount_union "" $LOWER_DIR0 $LOWER_DIR1 $LOWER_DIR2 + +# check for chattr support after mount_union, because it may have changed +# the underlying mounts to cramfs/squashfs. +CHATTR="" if havechattr $LOWER_DIR2 ; then CHATTR=1 chattr +i $LOWER_DIR2/d1/d2/d3/d4/f fi -# mount unionfs -mount_union "" $LOWER_DIR0 $LOWER_DIR1 $LOWER_DIR2 - ./progs/truncate -f $MOUNTPOINT/a 0 ./progs/truncate -f $MOUNTPOINT/b 5000 @@ -92,13 +95,18 @@ dd if=/dev/zero of=$LOWER_DIR2/d bs=4000 count=2 2>/dev/null dd if=/dev/zero of=$LOWER_DIR2/d1/d2/d3/d4/e bs=4000 count=2 2>/dev/null dd if=/dev/zero of=$LOWER_DIR2/d1/d2/d3/d4/f bs=4000 count=2 2>/dev/null -if [ ! -z "$CHATTR" ] ; then - chattr +i $LOWER_DIR2/d1/d2/d3/d4/f -fi mount_union "" $LOWER_DIR0 $LOWER_DIR1=ro $LOWER_DIR2=ro +# recheck for chattr support after mount_union, because it may have changed +# the underlying mounts to cramfs/squashfs. +CHATTR="" +if havechattr $LOWER_DIR2 ; then + CHATTR=1 + chattr +i $LOWER_DIR2/d1/d2/d3/d4/f +fi + ./progs/truncate -f $MOUNTPOINT/a 0 ./progs/truncate -f $MOUNTPOINT/b 5000 -- 2.43.0