4 # There are dirs/files in lower dir and upper dir before
5 # mounting overlayfs. After mounting, use dir in overlayfs
6 # mountpoint as lowerdir to mount another overlayfs, then
7 # access old files through the second overlayfs. It was
8 # not working, kernel commit below fixed it.
10 # c4fcfc1619ea ovl: fix d_real() for stacked fs
12 # This reproducer was originally written by
13 # Miklos Szeredi <mszeredi@redhat.com>
15 #-----------------------------------------------------------------------
16 # Copyright (c) 2017 Red Hat Inc. All Rights Reserved.
18 # This program is free software; you can redistribute it and/or
19 # modify it under the terms of the GNU General Public License as
20 # published by the Free Software Foundation.
22 # This program is distributed in the hope that it would be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 # GNU General Public License for more details.
27 # You should have received a copy of the GNU General Public License
28 # along with this program; if not, write the Free Software Foundation,
29 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 #-----------------------------------------------------------------------
34 seqres=$RESULT_DIR/$seq
35 echo "QA output created by $seq"
39 status=1 # failure is the default!
40 trap "_cleanup; exit \$status" 0 1 2 3 15
50 # get standard environment, filters and checks
54 # remove previous $seqres.full before test
57 # real QA test starts here
59 # Modify as appropriate.
64 # Remove all files from previous tests
68 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
69 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
71 echo foo > $upperdir/up/foo
72 mkdir -p $lowerdir/low
73 echo bar > $lowerdir/low/bar
75 # mount overlay in SCRATCH_MNT
78 mkdir -p $tmp/{upper,mnt,work}
79 # mount overlay again using upper dir from SCRATCH_MNT dir
80 _overlay_mount_dirs $SCRATCH_MNT/up $tmp/{upper,work} \
82 # accessing file in the second mount
86 # mount overlay again using lower dir from SCRATCH_MNT dir
87 _overlay_mount_dirs $SCRATCH_MNT/low $tmp/{upper,work} \
92 # mount overlay again using SCRATCH_MNT dir
93 _overlay_mount_dirs $SCRATCH_MNT/ $tmp/{upper,work} \