From: Carlos Maiolino Date: Tue, 7 Apr 2026 11:14:59 +0000 (+0200) Subject: fsr: package function should check for negative errors X-Git-Tag: v7.0.0~59 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf1007391a32518f15283a032e68ca25402ca652;p=xfsprogs-dev.git fsr: package function should check for negative errors xfrog_defragrange as most other functions from libfrog return a negative error value, while xfs_fsr's packfile(), expects a positive error value. Whenever xfrog_defragrange fails, the switch case always falls into the default clausule, making the error message pointless. Fix this by inverting xfrog_defragrange() return value call. Signed-off-by: Carlos Maiolino Reviewed-by: "Darrick J. Wong" --- diff --git a/fsr/xfs_fsr.c b/fsr/xfs_fsr.c index 8845ff17..390f7c52 100644 --- a/fsr/xfs_fsr.c +++ b/fsr/xfs_fsr.c @@ -1459,7 +1459,7 @@ packfile( } /* Swap the extents */ - error = xfrog_defragrange(file_fd->fd, &xdf); + error = -xfrog_defragrange(file_fd->fd, &xdf); switch (error) { case 0: break;