xfs: disallow mounting of realtime + rmap filesystems
diff mbox

Message ID 20160819203207.GE8268@birch.djwong.org
State Accepted
Headers show

Commit Message

Darrick J. Wong Aug. 19, 2016, 8:32 p.m. UTC
Since the kernel doesn't currently support the realtime rmapbt,
don't allow such filesystems to be mounted.  Support will appear
in a future release.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_super.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Carlos Maiolino Aug. 22, 2016, 8:35 a.m. UTC | #1
On Fri, Aug 19, 2016 at 01:32:07PM -0700, Darrick J. Wong wrote:
> Since the kernel doesn't currently support the realtime rmapbt,
> don't allow such filesystems to be mounted.  Support will appear
> in a future release.
> 

Makes sense to me, you can add:

Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>

> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  fs/xfs/xfs_super.c |    9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
> index 24ef83e..fd6be45 100644
> --- a/fs/xfs/xfs_super.c
> +++ b/fs/xfs/xfs_super.c
> @@ -1574,9 +1574,16 @@ xfs_fs_fill_super(
>  		}
>  	}
>  
> -	if (xfs_sb_version_hasrmapbt(&mp->m_sb))
> +	if (xfs_sb_version_hasrmapbt(&mp->m_sb)) {
> +		if (mp->m_sb.sb_rblocks) {
> +			xfs_alert(mp,
> +	"EXPERIMENTAL reverse mapping btree not compatible with realtime device!");
> +			error = -EINVAL;
> +			goto out_filestream_unmount;
> +		}
>  		xfs_alert(mp,
>  	"EXPERIMENTAL reverse mapping btree feature enabled. Use at your own risk!");
> +	}
>  
>  	error = xfs_mountfs(mp);
>  	if (error)
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
Christoph Hellwig Aug. 25, 2016, 8:05 a.m. UTC | #2
Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>

Patch
diff mbox

diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index 24ef83e..fd6be45 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -1574,9 +1574,16 @@  xfs_fs_fill_super(
 		}
 	}
 
-	if (xfs_sb_version_hasrmapbt(&mp->m_sb))
+	if (xfs_sb_version_hasrmapbt(&mp->m_sb)) {
+		if (mp->m_sb.sb_rblocks) {
+			xfs_alert(mp,
+	"EXPERIMENTAL reverse mapping btree not compatible with realtime device!");
+			error = -EINVAL;
+			goto out_filestream_unmount;
+		}
 		xfs_alert(mp,
 	"EXPERIMENTAL reverse mapping btree feature enabled. Use at your own risk!");
+	}
 
 	error = xfs_mountfs(mp);
 	if (error)