Re: [PATCH v3 1/2] iomap: add a swapfile activation function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 03, 2018 at 10:46:59AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> 
> Add a new iomap_swapfile_activate function so that filesystems can
> activate swap files without having to use the obsolete and slow bmap
> function.  This enables XFS to support fallocate'd swap files and
> swap files on realtime devices.
> 

Shouldn't we also prevent the extents of an active swapfile from
becoming shared? If I swapon(a) and reflink(a, b), swapout to a now has
to break the reflink or corrupt b! In my old Btrfs swapfile series [1] I
just forbid all reflink operations on active swapfiles. 

One thing to note is that then this will need a matching
->swap_deactivate(), which currently isn't called if ->swap_activate()
returned > 0.

1: https://github.com/osandov/linux/tree/btrfs-swap

> Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
> ---
> v3: catch null iomap addr, fix too-short extent detection
> v2: document the swap file layout requirements, combine adjacent
>     real/unwritten extents, align reported swap extents to physical page
>     size boundaries, fix compiler errors when swap disabled



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux