2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat Inc. All Rights Reserved.
7 # The upper dentry may become stale before we remove it from
8 # overlay, e.g. file was removed from upperdir directly, which
9 # triggered warning/oops in ovl_remove_and_whiteout().
11 # Commit cfc9fde0b07c ("ovl: verify upper dentry in
12 # ovl_remove_and_whiteout()") fixed this issue.
15 seqres=$RESULT_DIR/$seq
16 echo "QA output created by $seq"
20 status=1 # failure is the default!
21 trap "_cleanup; exit \$status" 0 1 2 3 15
29 # get standard environment, filters and checks
35 # real QA test starts here
39 # remove all files from previous runs
42 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
43 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
44 mkdir -p $lowerdir/test
48 # remove test file to create a whiteout
49 rmdir $SCRATCH_MNT/test
51 # create the test file again and remove it from upperdir directly, make the
52 # upper dentry become stale
53 touch $SCRATCH_MNT/test
55 # try to remove test file from overlay dir, trigger ovl_remove_and_whiteout, it
56 # should see stale file handle error, and no warnings/oops are expected.
57 rm $SCRATCH_MNT/test 2>&1 | _filter_scratch