]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: xfs_fsr: Interpret arguments of qsort's compare function correctly
authorChandan Babu R <chandanrlinux@gmail.com>
Fri, 12 Feb 2021 22:23:05 +0000 (17:23 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 12 Feb 2021 22:23:05 +0000 (17:23 -0500)
The first argument passed to qsort() in fsrfs() is an array of "struct
xfs_bulkstat". Hence the two arguments to the cmp() function must be
interpreted as being of type "struct xfs_bulkstat *" as against "struct
xfs_bstat *" that is being used to currently typecast them.

Signed-off-by: Chandan Babu R <chandanrlinux@gmail.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
fsr/xfs_fsr.c

index 77a10a1d256a214919ff14009ba84ec50c5c184e..635e4c707611747cc9463c15795e84ec9231fffd 100644 (file)
@@ -702,9 +702,8 @@ out0:
 int
 cmp(const void *s1, const void *s2)
 {
-       return( ((struct xfs_bstat *)s2)->bs_extents -
-               ((struct xfs_bstat *)s1)->bs_extents);
-
+       return( ((struct xfs_bulkstat *)s2)->bs_extents -
+               ((struct xfs_bulkstat *)s1)->bs_extents);
 }
 
 /*