Re: [PATCH] xfs: fail ->bmap for reflink inodes

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

 



On Thu, May 26, 2016 at 03:02:04PM +0200, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> ---
>  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
> +	 * bypasseѕ 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@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

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



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]