I've attached a test program 'fsmount.c'. This can be used along with the test script below to show a kernel bug when calling fsconfig(2) with security options on a btrfs filesystem. This problem only occurs using fsconfig(2) when attempting to add security options. Setting a native btrfs option (e.g. flushoncommit) works. Copy the statements below into test.sh and run with the fs name. Other fs will work such as ext4, xfs. Only btrfs will fail. #!/bin/sh fs_name=$1 mkdir -p /mnt/selinux-testsuite dd if=/dev/zero of=./fstest bs=4096 count=27904 dev=`losetup -f` losetup $dev ./fstest mkfs.$fs_name $dev /usr/bin/systemctl stop udisks2 # Stops crap appearing in journal log # mount(2) works: #mount -t $fs_name -o "rootcontext=system_u:object_r:unconfined_t:s0" $dev /mnt/selinux-testsuite # This native btrfs "flushoncommit" option will work with fsconfig(2): #./fsmount $fs_name $dev /mnt/selinux-testsuite "flushoncommit" # This will not: ./fsmount $fs_name $dev /mnt/selinux-testsuite "rootcontext=system_u:object_r:unconfined_t:s0" # rootcontext fails with journal entry: SELinux: mount invalid. # Same superblock, different security settings for (dev loop0, type btrfs) umount /mnt/selinux-testsuite losetup -d $dev /usr/bin/systemctl start udisks2 rm -f ./fstest