]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
fsr: package function should check for negative errors
authorCarlos Maiolino <cem@kernel.org>
Tue, 7 Apr 2026 11:14:59 +0000 (13:14 +0200)
committerAndrey Albershteyn <aalbersh@kernel.org>
Wed, 8 Apr 2026 19:39:57 +0000 (21:39 +0200)
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 <cmaiolino@redhat.com>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
fsr/xfs_fsr.c

index 8845ff172fcb2eb4eaecae4d301fcae559eded7e..390f7c5276df55bcce89ac7293efb1c6618c6ddc 100644 (file)
@@ -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;