@@ -132,6 +132,16 @@ for dt in $dtypes; do
cat $tmp.stat.err
else
echo "stat: '$testdir/$file' is a $ftype"
+ # Verify that readlink of a file posing as a symlink
+ # and ls of a file posing as a directory does not blow up
+ safety="-d"
+ # NOTE that ls DOES blow up with kernel 4.9 on malformed
+ # directory - remove the safety pin to explode
+ if [ -d $testdir/$file ]; then
+ ls "$safety" $testdir/$file &> /dev/null
+ elif [ -h $testdir/$file ]; then
+ readlink $testdir/$file &> /dev/null
+ fi
fi | _filter_scratch
done
_scratch_unmount
In addition to testing xfs_repair on inodes with malformed mode, and fstat of those inodes on a mounted fs, try to also list content of mock directory and readlink of mock symlink. Readdir of mock directory triggers XFS assertion on umount: XFS: Assertion failed: !rwsem_is_locked(&inode->i_rwsem), file: /home/amir/build/src/linux/fs/xfs/xfs_super.c, line: 951 To reproduce, need to comment out the variable 'safety'. Signed-off-by: Amir Goldstein <amir73il@gmail.com> --- tests/xfs/348 | 10 ++++++++++ 1 file changed, 10 insertions(+)