On Fri, Aug 31, 2018 at 03:36:35PM -0700, Omar Sandoval wrote:
> This series implements swap file support for Btrfs.
> 
> Changes since v4 [1]:
> 
> - Added a kernel doc for btrfs_get_chunk_map()
> - Got rid of "Btrfs: push EXCL_OP set into btrfs_rm_device()"
> - Made activate error messages more clear and consistent
> - Changed clear vs unlock order in activate error case
> - Added "mm: export add_swap_extent()" as a separate patch
> - Added a btrfs_wait_ordered_range() at the beginning of
>   btrfs_swap_activate() to catch newly created files
> - Added some Reviewed-bys from Nikolay
> 
> I took a stab at adding support for balance when a swap file is active,
> but it's a major pain: we need to mark block groups which contain swap
> file extents, check the block group counter in relocate/scrub, then
> unmark the block groups when the swap file is deactivated, which gets
> really messy because the file can grow while it is an active swap file.
> If this is a deal breaker, I can work something out, but I don't think
> it's worth the trouble.

I'm afraid it is a deal breaker. Unlike dev-replace or resize, balance
is used more often so switching off the swap file for the duration of
the operation is administration pain.

If it's possible to constrain the swap file further, like no growing
that you mention, or mandatory preallocation or similar, then I hope it
would make it possible to implement in a sane way.

Reply via email to