mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Merge of xfs-cmds-2.4.18:slinx:112540a by nathans.
merge in AndreasG latest set of changes.
This commit is contained in:
@@ -66,7 +66,7 @@ _filter_scratch()
|
|||||||
|
|
||||||
getfattr()
|
getfattr()
|
||||||
{
|
{
|
||||||
/usr/bin/getfattr -adl $@ 2>&1 | _filter_scratch
|
/usr/bin/getfattr -adh $@ 2>&1 | _filter_scratch
|
||||||
}
|
}
|
||||||
|
|
||||||
setfattr()
|
setfattr()
|
||||||
@@ -102,42 +102,42 @@ for nsp in user xfsroot; do
|
|||||||
echo; echo "=== TYPE $inode; NAMESPACE $nsp"; echo
|
echo; echo "=== TYPE $inode; NAMESPACE $nsp"; echo
|
||||||
|
|
||||||
echo "*** set/get one initially empty attribute"
|
echo "*** set/get one initially empty attribute"
|
||||||
setfattr -l -n $nsp.name $SCRATCH_MNT/$inode
|
setfattr -h -n $nsp.name $SCRATCH_MNT/$inode
|
||||||
getfattr -r $nsp $SCRATCH_MNT/$inode
|
getfattr -m $nsp $SCRATCH_MNT/$inode
|
||||||
|
|
||||||
echo "*** overwrite empty, set several new attributes"
|
echo "*** overwrite empty, set several new attributes"
|
||||||
setfattr -l -n $nsp.name -v 0xbabe $SCRATCH_MNT/$inode
|
setfattr -h -n $nsp.name -v 0xbabe $SCRATCH_MNT/$inode
|
||||||
setfattr -l -n $nsp.name2 -v 0xdeadbeef $SCRATCH_MNT/$inode
|
setfattr -h -n $nsp.name2 -v 0xdeadbeef $SCRATCH_MNT/$inode
|
||||||
setfattr -l -n $nsp.name3 -v 0xdeface $SCRATCH_MNT/$inode
|
setfattr -h -n $nsp.name3 -v 0xdeface $SCRATCH_MNT/$inode
|
||||||
|
|
||||||
echo "*** fetch several attribute names and values (hex)"
|
echo "*** fetch several attribute names and values (hex)"
|
||||||
getfattr -r $nsp -e hex $SCRATCH_MNT/$inode
|
getfattr -m $nsp -e hex $SCRATCH_MNT/$inode
|
||||||
|
|
||||||
echo "*** fetch several attribute names and values (base64)"
|
echo "*** fetch several attribute names and values (base64)"
|
||||||
getfattr -r $nsp -e base64 $SCRATCH_MNT/$inode
|
getfattr -m $nsp -e base64 $SCRATCH_MNT/$inode
|
||||||
|
|
||||||
echo "*** shrink value of an existing attribute"
|
echo "*** shrink value of an existing attribute"
|
||||||
setfattr -l -n $nsp.name2 -v 0xdeaf $SCRATCH_MNT/$inode
|
setfattr -h -n $nsp.name2 -v 0xdeaf $SCRATCH_MNT/$inode
|
||||||
getfattr -r $nsp -e hex $SCRATCH_MNT/$inode
|
getfattr -m $nsp -e hex $SCRATCH_MNT/$inode
|
||||||
|
|
||||||
echo "*** grow value of existing attribute"
|
echo "*** grow value of existing attribute"
|
||||||
setfattr -l -n $nsp.name2 -v 0xdecade $SCRATCH_MNT/$inode
|
setfattr -h -n $nsp.name2 -v 0xdecade $SCRATCH_MNT/$inode
|
||||||
getfattr -r $nsp -e hex $SCRATCH_MNT/$inode
|
getfattr -m $nsp -e hex $SCRATCH_MNT/$inode
|
||||||
|
|
||||||
echo "*** set an empty value for second attribute"
|
echo "*** set an empty value for second attribute"
|
||||||
setfattr -l -n $nsp.name2 $SCRATCH_MNT/$inode
|
setfattr -h -n $nsp.name2 $SCRATCH_MNT/$inode
|
||||||
getfattr -r $nsp -n $nsp.name2 $SCRATCH_MNT/$inode
|
getfattr -m $nsp -n $nsp.name2 $SCRATCH_MNT/$inode
|
||||||
|
|
||||||
echo "*** overwrite empty value"
|
echo "*** overwrite empty value"
|
||||||
setfattr -l -n $nsp.name2 -v 0xcafe $SCRATCH_MNT/$inode
|
setfattr -h -n $nsp.name2 -v 0xcafe $SCRATCH_MNT/$inode
|
||||||
getfattr -r $nsp -e hex -n $nsp.name2 $SCRATCH_MNT/$inode
|
getfattr -m $nsp -e hex -n $nsp.name2 $SCRATCH_MNT/$inode
|
||||||
|
|
||||||
echo "*** remove attribute"
|
echo "*** remove attribute"
|
||||||
setfattr -l -x $nsp.name2 $SCRATCH_MNT/$inode
|
setfattr -h -x $nsp.name2 $SCRATCH_MNT/$inode
|
||||||
getfattr -r $nsp -e hex -n $nsp.name2 $SCRATCH_MNT/$inode
|
getfattr -m $nsp -e hex -n $nsp.name2 $SCRATCH_MNT/$inode
|
||||||
|
|
||||||
echo "*** final list (strings, type=$inode, nsp=$nsp)"
|
echo "*** final list (strings, type=$inode, nsp=$nsp)"
|
||||||
getfattr -r '^user|^xfsroot' -e hex $SCRATCH_MNT/$inode
|
getfattr -m '^user|^xfsroot' -e hex $SCRATCH_MNT/$inode
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -166,20 +166,12 @@ _extend_test_bed()
|
|||||||
_extend_test_bed
|
_extend_test_bed
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "*** forward directory descent with us following symlinks"
|
echo "*** directory descent with us following symlinks"
|
||||||
getfattr -L -R -r '^user|^xfsroot' -e hex $SCRATCH_MNT
|
getfattr -h -L -R -m '^user|^xfsroot' -e hex $SCRATCH_MNT
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "*** reverse directory descent with us following symlinks"
|
echo "*** directory descent without following symlinks"
|
||||||
getfattr -L -R -5 -r '^user|^xfsroot' -e hex $SCRATCH_MNT
|
getfattr -h -P -R -m '^user|^xfsroot' -e hex $SCRATCH_MNT
|
||||||
|
|
||||||
echo
|
|
||||||
echo "*** forward directory descent without following symlinks"
|
|
||||||
getfattr -P -R -r '^user|^xfsroot' -e hex $SCRATCH_MNT
|
|
||||||
|
|
||||||
echo
|
|
||||||
echo "*** reverse directory descent without following symlinks"
|
|
||||||
getfattr -P -R -5 -r '^user|^xfsroot' -e hex $SCRATCH_MNT
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
@@ -190,7 +182,7 @@ echo; echo
|
|||||||
_backup()
|
_backup()
|
||||||
{
|
{
|
||||||
# NB: no filtering of scratch here... (need to restore too)
|
# NB: no filtering of scratch here... (need to restore too)
|
||||||
/usr/bin/getfattr -adl -R -r '^user|^system' $SCRATCH_MNT >$1
|
/usr/bin/getfattr -adh -R -m '^user|^system' $SCRATCH_MNT >$1
|
||||||
echo BACKUP $1 >>$seq.full
|
echo BACKUP $1 >>$seq.full
|
||||||
cat $1 >> $seq.full
|
cat $1 >> $seq.full
|
||||||
[ ! -s $1 ] && echo "warning: $1 (backup file) is empty"
|
[ ! -s $1 ] && echo "warning: $1 (backup file) is empty"
|
||||||
@@ -202,18 +194,18 @@ _backup $tmp.backup1
|
|||||||
echo "*** clear out the scratch device"
|
echo "*** clear out the scratch device"
|
||||||
rm -fr $SCRATCH_MNT/*
|
rm -fr $SCRATCH_MNT/*
|
||||||
echo "AFTER REMOVE" >>$seq.full
|
echo "AFTER REMOVE" >>$seq.full
|
||||||
getfattr -L -R -r '^user|^xfsroot' $SCRATCH_MNT >>$seq.full
|
getfattr -L -R -m '^user|^xfsroot' $SCRATCH_MNT >>$seq.full
|
||||||
|
|
||||||
echo "*** reset test bed with no extended attributes"
|
echo "*** reset test bed with no extended attributes"
|
||||||
_create_test_bed
|
_create_test_bed
|
||||||
_extend_test_bed
|
_extend_test_bed
|
||||||
|
|
||||||
echo "*** restore everything"
|
echo "*** restore everything"
|
||||||
setfattr -lB $tmp.backup1
|
setfattr -hB $tmp.backup1
|
||||||
_backup $tmp.backup2
|
_backup $tmp.backup2
|
||||||
|
|
||||||
echo "AFTER RESTORE" >>$seq.full
|
echo "AFTER RESTORE" >>$seq.full
|
||||||
getfattr -L -R -r '^user|^xfsroot' $SCRATCH_MNT >>$seq.full
|
getfattr -L -R -m '^user|^xfsroot' $SCRATCH_MNT >>$seq.full
|
||||||
|
|
||||||
echo "*** compare before and after backups"
|
echo "*** compare before and after backups"
|
||||||
diff $tmp.backup1 $tmp.backup2
|
diff $tmp.backup1 $tmp.backup2
|
||||||
|
|||||||
@@ -609,7 +609,7 @@ SCRATCH_MNT/here/up/ascend
|
|||||||
SCRATCH_MNT/lnk
|
SCRATCH_MNT/lnk
|
||||||
SCRATCH_MNT/reg
|
SCRATCH_MNT/reg
|
||||||
|
|
||||||
*** forward directory descent with us following symlinks
|
*** directory descent with us following symlinks
|
||||||
# file: SCRATCH_MNT/reg
|
# file: SCRATCH_MNT/reg
|
||||||
user.name=0xbabe
|
user.name=0xbabe
|
||||||
user.name3=0xdeface
|
user.name3=0xdeface
|
||||||
@@ -675,73 +675,7 @@ xfsroot.9=0x3837
|
|||||||
xfsroot.a=0x6263
|
xfsroot.a=0x6263
|
||||||
|
|
||||||
|
|
||||||
*** reverse directory descent with us following symlinks
|
*** directory descent without following symlinks
|
||||||
# file: SCRATCH_MNT/reg
|
|
||||||
user.name=0xbabe
|
|
||||||
user.name3=0xdeface
|
|
||||||
xfsroot.name=0xbabe
|
|
||||||
xfsroot.name3=0xdeface
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/dir
|
|
||||||
user.name=0xbabe
|
|
||||||
user.name3=0xdeface
|
|
||||||
xfsroot.name=0xbabe
|
|
||||||
xfsroot.name3=0xdeface
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/lnk
|
|
||||||
user.name=0xbabe
|
|
||||||
user.name3=0xdeface
|
|
||||||
xfsroot.name=0xbabe
|
|
||||||
xfsroot.name3=0xdeface
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/dev/b
|
|
||||||
user.name=0xbabe
|
|
||||||
user.name3=0xdeface
|
|
||||||
xfsroot.name=0xbabe
|
|
||||||
xfsroot.name3=0xdeface
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/dev/c
|
|
||||||
user.name=0xbabe
|
|
||||||
user.name3=0xdeface
|
|
||||||
xfsroot.name=0xbabe
|
|
||||||
xfsroot.name3=0xdeface
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/dev/p
|
|
||||||
user.name=0xbabe
|
|
||||||
user.name3=0xdeface
|
|
||||||
xfsroot.name=0xbabe
|
|
||||||
xfsroot.name3=0xdeface
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/here/up/ascend
|
|
||||||
xfsroot.9=0x3837
|
|
||||||
xfsroot.a=0x6263
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/here/up
|
|
||||||
xfsroot.9=0x3837
|
|
||||||
xfsroot.a=0x6263
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/here
|
|
||||||
xfsroot.9=0x3837
|
|
||||||
xfsroot.a=0x6263
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/descend/down/here
|
|
||||||
user.1=0x3233
|
|
||||||
user.x=0x797a
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/descend/down
|
|
||||||
user.1=0x3233
|
|
||||||
user.x=0x797a
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/descend/and/ascend
|
|
||||||
xfsroot.9=0x3837
|
|
||||||
xfsroot.a=0x6263
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/descend
|
|
||||||
user.1=0x3233
|
|
||||||
user.x=0x797a
|
|
||||||
|
|
||||||
|
|
||||||
*** forward directory descent without following symlinks
|
|
||||||
# file: SCRATCH_MNT/reg
|
# file: SCRATCH_MNT/reg
|
||||||
user.name=0xbabe
|
user.name=0xbabe
|
||||||
user.name3=0xdeface
|
user.name3=0xdeface
|
||||||
@@ -797,62 +731,6 @@ user.1=0x3233
|
|||||||
user.x=0x797a
|
user.x=0x797a
|
||||||
|
|
||||||
|
|
||||||
*** reverse directory descent without following symlinks
|
|
||||||
# file: SCRATCH_MNT/reg
|
|
||||||
user.name=0xbabe
|
|
||||||
user.name3=0xdeface
|
|
||||||
xfsroot.name=0xbabe
|
|
||||||
xfsroot.name3=0xdeface
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/dir
|
|
||||||
user.name=0xbabe
|
|
||||||
user.name3=0xdeface
|
|
||||||
xfsroot.name=0xbabe
|
|
||||||
xfsroot.name3=0xdeface
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/dev/b
|
|
||||||
user.name=0xbabe
|
|
||||||
user.name3=0xdeface
|
|
||||||
xfsroot.name=0xbabe
|
|
||||||
xfsroot.name3=0xdeface
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/dev/c
|
|
||||||
user.name=0xbabe
|
|
||||||
user.name3=0xdeface
|
|
||||||
xfsroot.name=0xbabe
|
|
||||||
xfsroot.name3=0xdeface
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/dev/p
|
|
||||||
user.name=0xbabe
|
|
||||||
user.name3=0xdeface
|
|
||||||
xfsroot.name=0xbabe
|
|
||||||
xfsroot.name3=0xdeface
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/here/up/ascend
|
|
||||||
xfsroot.9=0x3837
|
|
||||||
xfsroot.a=0x6263
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/here/up
|
|
||||||
xfsroot.9=0x3837
|
|
||||||
xfsroot.a=0x6263
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/here
|
|
||||||
xfsroot.9=0x3837
|
|
||||||
xfsroot.a=0x6263
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/descend/down/here
|
|
||||||
user.1=0x3233
|
|
||||||
user.x=0x797a
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/descend/down
|
|
||||||
user.1=0x3233
|
|
||||||
user.x=0x797a
|
|
||||||
|
|
||||||
# file: SCRATCH_MNT/descend
|
|
||||||
user.1=0x3233
|
|
||||||
user.x=0x797a
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*** backup everything
|
*** backup everything
|
||||||
*** clear out the scratch device
|
*** clear out the scratch device
|
||||||
|
|||||||
+1
-1
@@ -1152,7 +1152,7 @@ _get_eas_on_path()
|
|||||||
# sed 's/["]//g' |\
|
# sed 's/["]//g' |\
|
||||||
# sort |\
|
# sort |\
|
||||||
# and this is now the Linux way...
|
# and this is now the Linux way...
|
||||||
getfattr -Rla $_path |\
|
getfattr -Rha $_path |\
|
||||||
perl -wn -e '
|
perl -wn -e '
|
||||||
if (m/^# file: (\S+)/) { $file = $1 }
|
if (m/^# file: (\S+)/) { $file = $1 }
|
||||||
elsif (m/^user\.(\w+)/) { print $file, " ",$1,"\n" }' |\
|
elsif (m/^user\.(\w+)/) { print $file, " ",$1,"\n" }' |\
|
||||||
|
|||||||
Reference in New Issue
Block a user