diff mbox

[047/119] xfs: disable XFS_IOC_SWAPEXT when rmap btree is enabled

Message ID 146612657322.12839.9067889093004523073.stgit@birch.djwong.org (mailing list archive)
State New, archived
Headers show

Commit Message

Darrick J. Wong June 17, 2016, 1:22 a.m. UTC
Swapping extents between two inodes requires the owner to be updated
in the rmap tree for all the extents that are swapped. This code
does not yet exist, so switch off the XFS_IOC_SWAPEXT ioctl until
support has been implemented. This will need to be done before the
rmap btree code can have the experimental tag removed.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
[darrick.wong@oracle.com: fix extent swapping when rmap enabled]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_bmap_util.c |    4 ++++
 1 file changed, 4 insertions(+)



--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Brian Foster July 18, 2016, 1:34 p.m. UTC | #1
On Thu, Jun 16, 2016 at 06:22:53PM -0700, Darrick J. Wong wrote:
> Swapping extents between two inodes requires the owner to be updated
> in the rmap tree for all the extents that are swapped. This code
> does not yet exist, so switch off the XFS_IOC_SWAPEXT ioctl until
> support has been implemented. This will need to be done before the
> rmap btree code can have the experimental tag removed.
> 
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> [darrick.wong@oracle.com: fix extent swapping when rmap enabled]
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_bmap_util.c |    4 ++++
>  1 file changed, 4 insertions(+)
> 
> 
> diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
> index 450fd49..8666873 100644
> --- a/fs/xfs/xfs_bmap_util.c
> +++ b/fs/xfs/xfs_bmap_util.c
> @@ -1618,6 +1618,10 @@ xfs_swap_extents(
>  	__uint64_t	tmp;
>  	int		lock_flags;
>  
> +	/* XXX: we can't do this with rmap, will fix later */
> +	if (xfs_sb_version_hasrmapbt(&mp->m_sb))
> +		return -EOPNOTSUPP;
> +
>  	tempifp = kmem_alloc(sizeof(xfs_ifork_t), KM_MAYFAIL);
>  	if (!tempifp) {
>  		error = -ENOMEM;
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Darrick J. Wong July 18, 2016, 4:18 p.m. UTC | #2
On Mon, Jul 18, 2016 at 09:34:28AM -0400, Brian Foster wrote:
> On Thu, Jun 16, 2016 at 06:22:53PM -0700, Darrick J. Wong wrote:
> > Swapping extents between two inodes requires the owner to be updated
> > in the rmap tree for all the extents that are swapped. This code
> > does not yet exist, so switch off the XFS_IOC_SWAPEXT ioctl until
> > support has been implemented. This will need to be done before the
> > rmap btree code can have the experimental tag removed.

"This functionality will be provided in a (much) later patch, as the rmap
implementation uses a few parts of the reflink functionality to accomplish its
means."

> > Signed-off-by: Dave Chinner <dchinner@redhat.com>
> > [darrick.wong@oracle.com: fix extent swapping when rmap enabled]

"[darrick: update commit log]"

--D

> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> 
> Reviewed-by: Brian Foster <bfoster@redhat.com>
> 
> >  fs/xfs/xfs_bmap_util.c |    4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > 
> > diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
> > index 450fd49..8666873 100644
> > --- a/fs/xfs/xfs_bmap_util.c
> > +++ b/fs/xfs/xfs_bmap_util.c
> > @@ -1618,6 +1618,10 @@ xfs_swap_extents(
> >  	__uint64_t	tmp;
> >  	int		lock_flags;
> >  
> > +	/* XXX: we can't do this with rmap, will fix later */
> > +	if (xfs_sb_version_hasrmapbt(&mp->m_sb))
> > +		return -EOPNOTSUPP;
> > +
> >  	tempifp = kmem_alloc(sizeof(xfs_ifork_t), KM_MAYFAIL);
> >  	if (!tempifp) {
> >  		error = -ENOMEM;
> > 
> > _______________________________________________
> > xfs mailing list
> > xfs@oss.sgi.com
> > http://oss.sgi.com/mailman/listinfo/xfs
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 450fd49..8666873 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1618,6 +1618,10 @@  xfs_swap_extents(
 	__uint64_t	tmp;
 	int		lock_flags;
 
+	/* XXX: we can't do this with rmap, will fix later */
+	if (xfs_sb_version_hasrmapbt(&mp->m_sb))
+		return -EOPNOTSUPP;
+
 	tempifp = kmem_alloc(sizeof(xfs_ifork_t), KM_MAYFAIL);
 	if (!tempifp) {
 		error = -ENOMEM;