fstests: move test group info to test files
[xfstests-dev.git] / tests / overlay / 063
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2018 Red Hat Inc.  All Rights Reserved.
4 #
5 # FS QA Test 063
6 #
7 # Create dir over cached negative dentry, but whiteout removed from upper
8 #
9 # The following kernel commit fixed the kernel crash: 5e1275808630 ("ovl: check
10 # whiteout in ovl_create_over_whiteout()")
11 #
12 . ./common/preamble
13 _begin_fstest auto quick whiteout
14
15 # Import common functions.
16 . ./common/filter
17
18 # real QA test starts here
19 _supported_fs overlay
20 _require_scratch
21
22 # Remove all files from previous tests
23 _scratch_mkfs
24
25 # Create test file
26 lowerdir=${OVL_BASE_SCRATCH_MNT}/${OVL_LOWER}
27 upperdir=${OVL_BASE_SCRATCH_MNT}/${OVL_UPPER}
28 mkdir -p $lowerdir
29 touch ${lowerdir}/file
30
31 _scratch_mount
32
33 # Create whiteout and populate dcache with negative dentry
34 rm ${SCRATCH_MNT}/file
35 ls -l ${SCRATCH_MNT}/file > /dev/null 2>&1
36
37 # Remove whiteout and try to create dir over negative dentry
38 rm ${upperdir}/file
39 mkdir ${SCRATCH_MNT}/file > /dev/null 2>&1
40
41 # unmount overlayfs
42 $UMOUNT_PROG $SCRATCH_MNT
43
44 echo "Silence is golden"
45 # success, all done
46 status=0
47 exit