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 _begin_fstest auto quick whiteout
16 # Import common functions.
19 # real QA test starts here
24 # Remove all files from previous tests
27 # Create test file on lower dir, and chown to fsgqa user
28 lowerdir=$OVL_BASE_SCRATCH_MNT/$OVL_LOWER
30 touch $lowerdir/testfile
31 chown fsgqa:fsgqa $lowerdir/testfile
33 # chown upperdir to fsgqa user, so new file/dir can be created by the user
34 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
36 chown fsgqa:fsgqa $upperdir
40 # Remove testfile, whiteout created in lowerdir
41 rm -f $SCRATCH_MNT/testfile
43 # Create new file over whiteout and check the file ownership
44 _user_do "touch $SCRATCH_MNT/testfile"
45 stat -c %U:%G-%F $SCRATCH_MNT/testfile
47 # Create new dir over whiteout and check ownership again
48 rm -f $SCRATCH_MNT/testfile
49 _user_do "mkdir $SCRATCH_MNT/testfile"
50 stat -c %U:%G-%F $SCRATCH_MNT/testfile