On Mon, Aug 05, 2019 at 02:31:53PM -0400, Josef Bacik wrote: > In testing various things such as the btrfsck patch to detect over > allocation of chunks, empty block group deletion, and balance I've had > various ways to force chunk allocations for debug purposes. Add a sysfs > file to enable forcing of chunk allocation for the owning space info in > order to enable us to add testcases in the future to test these various > features easier. > > Signed-off-by: Josef Bacik <jo...@toxicpanda.com> > --- > v2->v3: > - as per Qu's suggestion, moved this to sysfs where it's easier to mess with > and > makes more sense. > - added side-effect is mixed bg forced allocation works with this scheme as > well. > - had to add get_btrfs_kobj() to get to fs_info, not sure this is better than > just adding the fs_info to the space_info, am open to other opinions here.
I believe v3 is the latest version, but I don't see the new file being added to the debug/ directory (ie. /sys/fs/btrfs/UUID/debug/) As it has been discussed, whether to make the file always visible or only with CONFIG_BTRFS_DEBUG, I'd rather keep it debugging-only. The testing coverage should be sufficient for fstests that are run with the config option and not giving users a knob to paper over allocator problems sounds desirable.