btrfs: test snapshot create with invalid parent qgroup
authorMark Fasheh <mfasheh@suse.de>
Mon, 9 May 2016 00:51:48 +0000 (10:51 +1000)
committerDave Chinner <david@fromorbit.com>
Mon, 9 May 2016 00:51:48 +0000 (10:51 +1000)
commitc9be5caa3c08ef41cdaae999911f15033077d5db
tree7203c68bd9943b6e716551718601650fa29048e5
parent40442d1cb7d014bc4db8ec00bc081777fd3d4967
btrfs: test snapshot create with invalid parent qgroup

Test that an invalid parent qgroup does not cause snapshot create to
force the FS readonly.

In btrfs, create_pending_snapshot() will go readonly on _any_ error return
from
btrfs_qgroup_inherit(). If qgroups are enabled, a user can crash their fs by
just making a snapshot and asking it to inherit from an invalid qgroup.

This patch does exactly that test. If the FS goes readonly that will be
reported and we will know that a regression was introduced.

The btrfs fix this patch relates to can be found at the following url:
http://thread.gmane.org/gmane.comp.file-systems.btrfs/54755

Thanks,
--Mark

Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
tests/btrfs/121 [new file with mode: 0755]
tests/btrfs/121.out [new file with mode: 0644]
tests/btrfs/group