linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-mm@kvack.org, xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: fail ->bmap for reflink inodes
Date: Thu, 26 May 2016 21:11:28 -0700	[thread overview]
Message-ID: <20160527041127.GA5053@birch.djwong.org> (raw)
In-Reply-To: <1464267724-31423-2-git-send-email-hch@lst.de>

On Thu, May 26, 2016 at 03:02:04PM +0200, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  fs/xfs/xfs_aops.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index a955552..d053a9e 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -1829,6 +1829,17 @@ xfs_vm_bmap(
>  
>  	trace_xfs_vm_bmap(XFS_I(inode));
>  	xfs_ilock(ip, XFS_IOLOCK_SHARED);
> +
> +	/*
> +	 * The swap code (ab-)uses ->bmap to get a block mapping and then
> +	 * bypasseN? the file system for actual I/O.  We really can't allow
> +	 * that on reflinks inodes, so we have to skip out here.  And yes,
> +	 * 0 is the magic code for a bmap error..
> +	 */
> +	if (xfs_is_reflink_inode(ip)) {
> +		xfs_iunlock(ip, XFS_IOLOCK_SHARED);
> +		return 0;
> +	}

/me adds to the reflink patchpile, thanks.

Just poking at mm/swapfile.c it looks like iomap might work well
as a replacement for repeated bmap() calls, once the iomap vfs
bits get in.

--D

>  	filemap_write_and_wait(mapping);
>  	xfs_iunlock(ip, XFS_IOLOCK_SHARED);
>  	return generic_block_bmap(mapping, block, xfs_get_blocks);
> -- 
> 2.1.4
> 

> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2016-05-27  4:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-26 13:02 oh the joy of swap files Christoph Hellwig
2016-05-26 13:02 ` [PATCH] xfs: fail ->bmap for reflink inodes Christoph Hellwig
2016-05-27  4:11   ` Darrick J. Wong [this message]
2016-05-27 17:32   ` Avi Kivity
2016-05-27 17:40     ` 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=20160527041127.GA5053@birch.djwong.org \
    --to=darrick.wong@oracle.com \
    --cc=hch@lst.de \
    --cc=linux-mm@kvack.org \
    --cc=xfs@oss.sgi.com \
    /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