2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2016 Red Hat Inc. All Rights Reserved.
7 # Create file/dir over whiteout by another user, uid/gid of the file/dir should
8 # be current fsuid/fsgid, not the mounter's.
10 # This upstream kernel patch fixed the issue
11 # d0e13f5 ovl: fix uid/gid when creating over whiteout
14 seqres=$RESULT_DIR/$seq
15 echo "QA output created by $seq"
19 status=1 # failure is the default!
20 trap "_cleanup; exit \$status" 0 1 2 3 15
28 # get standard environment, filters and checks
34 # real QA test starts here
40 # Remove all files from previous tests
43 # Create test file on lower dir, and chown to fsgqa user
44 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
46 touch $lowerdir/testfile
47 chown fsgqa:fsgqa $lowerdir/testfile
49 # chown upperdir to fsgqa user, so new file/dir can be created by the user
50 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
52 chown fsgqa:fsgqa $upperdir
56 # Remove testfile, whiteout created in lowerdir
57 rm -f $SCRATCH_MNT/testfile
59 # Create new file over whiteout and check the file ownership
60 _user_do "touch $SCRATCH_MNT/testfile"
61 stat -c %U:%G-%F $SCRATCH_MNT/testfile
63 # Create new dir over whiteout and check ownership again
64 rm -f $SCRATCH_MNT/testfile
65 _user_do "mkdir $SCRATCH_MNT/testfile"
66 stat -c %U:%G-%F $SCRATCH_MNT/testfile