generic/223: make sure all files get created on the data device
[xfstests-dev.git] / tests / generic / 632
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0+
3 #
4 # Copyright (c) 2021 Christian Brauner <christian.brauner@ubuntu.com>
5 # All Rights Reserved.
6 #
7 # FS QA Test No. 632
8 #
9 # Regression test to verify that creating a series of detached mounts,
10 # attaching them to the filesystem, and unmounting them does not trigger an
11 # integer overflow in ns->mounts causing the kernel to block any new mounts in
12 # count_mounts() and returning ENOSPC because it falsely assumes that the
13 # maximum number of mounts in the mount namespace has been reached, i.e. it
14 # thinks it can't fit the new mounts into the mount namespace anymore.
15 #
16 # Kernel commit ee2e3f50629f ("mount: fix mounting of detached mounts onto
17 # targets that reside on shared mounts") fixed the bug.
18 #
19 seq=`basename $0`
20 seqres=$RESULT_DIR/$seq
21 echo "QA output created by $seq"
22
23 here=`pwd`
24 tmp=/tmp/$$
25 status=1        # failure is the default!
26 trap "_cleanup; exit \$status" 0 1 2 3 15
27
28 _cleanup()
29 {
30         cd /
31         rm -f $tmp.*
32 }
33
34 . ./common/rc
35
36 rm -f $seqres.full
37
38 _supported_fs generic
39 _require_test
40 _require_test_program "detached_mounts_propagation"
41
42 $here/src/detached_mounts_propagation $TEST_DIR >> $seqres.full
43 status=$?
44
45 echo silence is golden
46 exit