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
39 # Remove all files from previous tests
42 # Create test file on lower dir, and chown to fsgqa user
43 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
45 touch $lowerdir/testfile
46 chown fsgqa:fsgqa $lowerdir/testfile
48 # chown upperdir to fsgqa user, so new file/dir can be created by the user
49 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
51 chown fsgqa:fsgqa $upperdir
55 # Remove testfile, whiteout created in lowerdir
56 rm -f $SCRATCH_MNT/testfile
58 # Create new file over whiteout and check the file ownership
59 _user_do "touch $SCRATCH_MNT/testfile"
60 stat -c %U:%G-%F $SCRATCH_MNT/testfile
62 # Create new dir over whiteout and check ownership again
63 rm -f $SCRATCH_MNT/testfile
64 _user_do "mkdir $SCRATCH_MNT/testfile"
65 stat -c %U:%G-%F $SCRATCH_MNT/testfile