diff mbox series

[03/12] libfrog: try the v4 fs geometry ioctl after failing the v5 ioctl

Message ID 156633309007.1215978.12240756059931527276.stgit@magnolia (mailing list archive)
State New, archived
Headers show
Series xfsprogs-5.3: various fixes | expand

Commit Message

Darrick J. Wong Aug. 20, 2019, 8:31 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

If a v5 fs geometry query fails, try the v4 interface before falling
back to the v1 interface.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 libfrog/fsgeom.c |    4 ++++
 1 file changed, 4 insertions(+)

Comments

Dave Chinner Aug. 30, 2019, 5:43 a.m. UTC | #1
On Tue, Aug 20, 2019 at 01:31:30PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> If a v5 fs geometry query fails, try the v4 interface before falling
> back to the v1 interface.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  libfrog/fsgeom.c |    4 ++++
>  1 file changed, 4 insertions(+)

looks good to me.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
diff mbox series

Patch

diff --git a/libfrog/fsgeom.c b/libfrog/fsgeom.c
index a3b748f8..06e4e663 100644
--- a/libfrog/fsgeom.c
+++ b/libfrog/fsgeom.c
@@ -84,6 +84,10 @@  xfrog_geometry(
 	if (!ret)
 		return 0;
 
+	ret = ioctl(fd, XFS_IOC_FSGEOMETRY_V4, fsgeo);
+	if (!ret)
+		return 0;
+
 	return ioctl(fd, XFS_IOC_FSGEOMETRY_V1, fsgeo);
 }