linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fallocate on XFS for swap
@ 2018-03-09 22:05 Besogonov, Aleksei
  2018-03-09 23:44 ` Darrick J. Wong
  0 siblings, 1 reply; 11+ messages in thread
From: Besogonov, Aleksei @ 2018-03-09 22:05 UTC (permalink / raw)
  To: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org; +Cc: Dave Chinner

Hi!

We’re working at Amazon on making XFS our default root filesystem for the upcoming Amazon Linux 2 (now in prod preview). One of the problems that we’ve encountered is inability to use fallocated files for swap on XFS. This is really important for us, since we’re shipping our current Amazon Linux with hibernation support .

I’ve traced the problem to bmap(), used in generic_swapfile_activate call, which returns 0 for blocks inside holes created by fallocate and Dave Chinner confirmed it in a private email. I’m thinking about ways to fix it, so far I see the following possibilities:

1. Change bmap() to not return zeroes for blocks inside holes. But this is an ABI change and it likely will break some obscure userspace utility somewhere.
2. Change generic_swap_activate to use a more modern interface, by adding fiemap-like operation to address_space_operations with fallback on bmap().
3. Add an XFS-specific implementation of swapfile_activate.

What do the people think about it? I kinda like option 2, since it'll make fallocate() work for any other FS that implements fiemap.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-03-13  7:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-09 22:05 fallocate on XFS for swap Besogonov, Aleksei
2018-03-09 23:44 ` Darrick J. Wong
2018-03-10  0:58   ` Dave Chinner
2018-03-10  1:17     ` Darrick J. Wong
2018-03-10  1:36       ` Dave Chinner
2018-03-12 22:01         ` Besogonov, Aleksei
2018-03-13  1:31           ` Dave Chinner
2018-03-10  9:38     ` Christoph Hellwig
2018-03-12 21:46       ` Dave Chinner
2018-03-13  7:14         ` Christoph Hellwig
2018-03-12 18:40     ` Besogonov, Aleksei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).