3.4.2 btrfs: Kernel warning after snapshot is created with incorrect qgroup

If qgroups are enabled, creating a snapshot that inherits from an invalid qgroup can cause the file system to crash and a warning to appear for the kernel in the system log. For example, the following operation causes the transaction to abort:

# btrfs subvolume snapshot -i 1/10 /mnt/scratch/ /mnt/scratch/snapshot

(Bug ID 24716895)