linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] xfsprogs: xfs_fsr: Interpret arguments of qsort's compare function correctly
@ 2021-01-25  9:58 Chandan Babu R
  2021-01-25  9:58 ` [PATCH 2/2] xfsprogs: xfs_fsr: Limit the scope of cmp() Chandan Babu R
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Chandan Babu R @ 2021-01-25  9:58 UTC (permalink / raw)
  To: linux-xfs; +Cc: Chandan Babu R, sandeen

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>
---
 fsr/xfs_fsr.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c
index 77a10a1d..635e4c70 100644
--- a/fsr/xfs_fsr.c
+++ b/fsr/xfs_fsr.c
@@ -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);
 }
 
 /*
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-02-02 20:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-25  9:58 [PATCH 1/2] xfsprogs: xfs_fsr: Interpret arguments of qsort's compare function correctly Chandan Babu R
2021-01-25  9:58 ` [PATCH 2/2] xfsprogs: xfs_fsr: Limit the scope of cmp() Chandan Babu R
2021-01-25 14:19   ` Eric Sandeen
2021-01-26  4:42     ` [PATCH V1.1] " Chandan Babu R
2021-02-02 20:21       ` Eric Sandeen
2021-01-25 14:17 ` [PATCH 1/2] xfsprogs: xfs_fsr: Interpret arguments of qsort's compare function correctly Eric Sandeen
2021-01-26  5:14   ` Chandan Babu R
2021-01-26 17:58 ` Darrick J. Wong
2021-01-26 18:12   ` Chandan Babu R

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).