public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH] iomap: don't override sis->bdev in xfs_iomap_swapfile_activate
Date: Tue, 3 Mar 2020 08:51:57 -0800	[thread overview]
Message-ID: <20200303165157.GC8045@magnolia> (raw)
In-Reply-To: <20200301144925.48343-1-hch@lst.de>

On Sun, Mar 01, 2020 at 07:49:25AM -0700, Christoph Hellwig wrote:
> The swapon code itself sets sis->bdev up early, and performs various check
> on the block devices.  Changing it later in the fact thus will cause a
> mismatch of capabilities and must be avoided.

What kind of mismatch?  Are you talking about the bdi_cap_* and
blk_queue_nonrot() logic in swapon()?  I wonder how much of that could
be moved to after the ->swapfile_activate call.

> The practical implication
> of this change is that it forbids swapping to the RT subvolume, which might
> have had all kinds of issues anyway.

<shrug> I didn't find any the one time I tried it on a pair of
homogeneous devices. :)

> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/xfs/xfs_aops.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index 58e937be24ce..f9929a952ef1 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -637,7 +637,6 @@ xfs_iomap_swapfile_activate(
>  	struct file			*swap_file,
>  	sector_t			*span)
>  {
> -	sis->bdev = xfs_inode_buftarg(XFS_I(file_inode(swap_file)))->bt_bdev;

That said, btrfs copypasta'd this when they ported to iomap swapfile, so
that needs fixing too.

--D

>  	return iomap_swapfile_activate(sis, swap_file, span,
>  			&xfs_read_iomap_ops);
>  }
> -- 
> 2.24.1
> 

  reply	other threads:[~2020-03-03 16:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-01 14:49 [PATCH] iomap: don't override sis->bdev in xfs_iomap_swapfile_activate Christoph Hellwig
2020-03-03 16:51 ` Darrick J. Wong [this message]
2020-03-04 15:30   ` Christoph Hellwig

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=20200303165157.GC8045@magnolia \
    --to=darrick.wong@oracle.com \
    --cc=hch@lst.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox