4 # Regression test for kernel commit:
5 # 76bc8e2 ovl: disallow overlayfs as upperdir
7 # This reproducer was originally written by
8 # Miklos Szeredi <mszeredi@redhat.com>
10 #-----------------------------------------------------------------------
11 # Copyright (c) 2017 Red Hat Inc. All Rights Reserved.
13 # This program is free software; you can redistribute it and/or
14 # modify it under the terms of the GNU General Public License as
15 # published by the Free Software Foundation.
17 # This program is distributed in the hope that it would be useful,
18 # but WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 # GNU General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with this program; if not, write the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #-----------------------------------------------------------------------
29 seqres=$RESULT_DIR/$seq
30 echo "QA output created by $seq"
34 status=1 # failure is the default!
35 trap "_cleanup; exit \$status" 0 1 2 3 15
40 $UMOUNT_PROG $tmp/mnt > /dev/null 2>&1
45 # get standard environment, filters and checks
49 # remove previous $seqres.full before test
52 # real QA test starts here
54 # Modify as appropriate.
59 # Remove all files from previous tests
62 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
63 mkdir -p $upperdir/upper
64 mkdir -p $upperdir/work
65 # mount overlay with dirs in upper
68 mkdir -p $tmp/{lower,mnt}
69 # mount overlay using upper from another overlay upper
71 _overlay_mount_dirs $tmp/lower $SCRATCH_MNT/upper \
72 $SCRATCH_MNT/work overlay $tmp/mnt > /dev/null 2>&1
73 if [ $? -ne 0 ] ; then
74 echo "Silence is golden"
77 echo "Overlay upperdir can't be another overlay upperdir"