Comment # 13 on bug 1047152 from
> I tried running your reproducer on a fresh btrfs volume using latest
> upstream master and nothing happens. Also re-reading the comments in the
> issue it seems that one has to have the qgroup rescan running simultaneously
> as the quota disable ioctl request comes, am I correct?

This won't work on a fresh btrfs volume. Sorry for the fairly scatter-brain
comments as I was commenting while debugging it and writing the patch I
attached and sent to LKML.

You need to have a btrfs volume /dev/sdX which *had a rescan running* when it
was forcefully unmounted (which results in the BTRFS_QGROUP_STATUS_FLAG_RESCAN
flag being set in fs_info->qgroup_flags). You can then reproduce it like so:

  % mount -t btrfs -o ro /dev/sdX /mnt
  % mount -o remount,rw /mnt
  % # run the reproducer

You _must_ remount the volume as rw rather than just mount it as rw, because
the bug (and my fix) are in the remount path not in the mount path.

You can try forcing the flag to be set by patching the kernel, since I'm not
actually sure how you could make sure that the flag is set when you hard reset
the machine (unmounting will wait for the rescan to complete from my reading of
close_ctree).


You are receiving this mail because: