All of lore.kernel.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs <linux-xfs@vger.kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-mm@kvack.org, hch@infradead.org, cyberax@amazon.com,
	jack@suse.cz, Eryu Guan <guaneryu@gmail.com>
Subject: Re: [PATCH v3 1/2] iomap: add a swapfile activation function
Date: Thu, 3 May 2018 14:26:20 -0700	[thread overview]
Message-ID: <20180503212620.GB26037@vader> (raw)
In-Reply-To: <20180503212447.GG4141@magnolia>

On Thu, May 03, 2018 at 02:24:47PM -0700, Darrick J. Wong wrote:
> On Thu, May 03, 2018 at 01:58:03PM -0700, Omar Sandoval wrote:
> > On Thu, May 03, 2018 at 10:46:59AM -0700, Darrick J. Wong wrote:
> > > From: Darrick J. Wong <darrick.wong@oracle.com>
> > > 
> > > 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. 
> 
> xfs already does this in its reflink handler: it takes the inode lock &
> bails out if IS_SWAPFILE().  swapon calls claim_swapfile to take the
> inode lock and sets S_SWAPFILE (if successful) so the two are
> effectively locked out from each other...
> 
> > One thing to note is that then this will need a matching
> > ->swap_deactivate(), which currently isn't called if ->swap_activate()
> > returned > 0.
> 
> ...so there shouldn't be any state to undo if the
> iomap_swapfile_activate fails.

Makes sense, thanks.

  reply	other threads:[~2018-05-03 21:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-03 17:46 [PATCH v3 1/2] iomap: add a swapfile activation function Darrick J. Wong
2018-05-03 17:49 ` [PATCH v3 2/2] generic: test swapfile creation, activation, and deactivation Darrick J. Wong
2018-05-03 20:58 ` [PATCH v3 1/2] iomap: add a swapfile activation function Omar Sandoval
2018-05-03 21:24   ` Darrick J. Wong
2018-05-03 21:26     ` Omar Sandoval [this message]
2018-05-09 15:20 ` Jan Kara
2018-05-09 17:11   ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180503212620.GB26037@vader \
    --to=osandov@osandov.com \
    --cc=cyberax@amazon.com \
    --cc=darrick.wong@oracle.com \
    --cc=guaneryu@gmail.com \
    --cc=hch@infradead.org \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.