2 # SPDX-License-Identifier: GPL-2.0+
4 # Copyright (c) 2021 Christian Brauner <christian.brauner@ubuntu.com>
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.
16 # Kernel commit ee2e3f50629f ("mount: fix mounting of detached mounts onto
17 # targets that reside on shared mounts") fixed the bug.
20 seqres=$RESULT_DIR/$seq
21 echo "QA output created by $seq"
25 status=1 # failure is the default!
26 trap "_cleanup; exit \$status" 0 1 2 3 15
40 _require_test_program "detached_mounts_propagation"
42 $here/src/detached_mounts_propagation $TEST_DIR >> $seqres.full
45 echo silence is golden