]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: xfs_quota_unreserve_blkres can't fail
authorChristoph Hellwig <hch@lst.de>
Mon, 29 Jul 2024 23:22:57 +0000 (16:22 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:01:05 +0000 (17:01 -0700)
Source kernel commit: cc3c92e7e79eb5f7f3ec4d5790ade384b7d294f7

Unreserving quotas can't fail due to quota limits, and we'll notice a
shut down file system a bit later in all the callers anyway.  Return
void and remove the error checking and propagation in the callers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
libxfs/xfs_bmap.c
libxfs/xfs_bmap.h

index e6d70013895b7bb9910e6a58fb0cc5be91a716d5..4a365f1a186f60fc83b2c66674c78eb7ba2c7182 100644 (file)
@@ -4922,7 +4922,7 @@ xfs_bmap_split_indlen(
        *indlen2 = len2;
 }
 
-int
+void
 xfs_bmap_del_extent_delay(
        struct xfs_inode        *ip,
        int                     whichfork,
@@ -4938,7 +4938,6 @@ xfs_bmap_del_extent_delay(
        xfs_filblks_t           got_indlen, new_indlen, stolen = 0;
        uint32_t                state = xfs_bmap_fork_to_state(whichfork);
        uint64_t                fdblocks;
-       int                     error = 0;
        bool                    isrt;
 
        XFS_STATS_INC(mp, xs_del_exlist);
@@ -4958,9 +4957,7 @@ xfs_bmap_del_extent_delay(
         * sb counters as we might have to borrow some blocks for the
         * indirect block accounting.
         */
-       error = xfs_quota_unreserve_blkres(ip, del->br_blockcount);
-       if (error)
-               return error;
+       xfs_quota_unreserve_blkres(ip, del->br_blockcount);
        ip->i_delayed_blks -= del->br_blockcount;
 
        if (got->br_startoff == del->br_startoff)
@@ -5058,7 +5055,6 @@ xfs_bmap_del_extent_delay(
 
        xfs_add_fdblocks(mp, fdblocks);
        xfs_mod_delalloc(ip, -(int64_t)del->br_blockcount, -da_diff);
-       return error;
 }
 
 void
@@ -5616,18 +5612,16 @@ __xfs_bunmapi(
 
 delete:
                if (wasdel) {
-                       error = xfs_bmap_del_extent_delay(ip, whichfork, &icur,
-                                       &got, &del);
+                       xfs_bmap_del_extent_delay(ip, whichfork, &icur, &got, &del);
                } else {
                        error = xfs_bmap_del_extent_real(ip, tp, &icur, cur,
                                        &del, &tmp_logflags, whichfork,
                                        flags);
                        logflags |= tmp_logflags;
+                       if (error)
+                               goto error0;
                }
 
-               if (error)
-                       goto error0;
-
                end = del.br_startoff - 1;
 nodelete:
                /*
index e98849eb9bbae3d487e0b64ec293d6d4393f066b..667b0c2b33d1d566dec92cf9913b4451818a4034 100644 (file)
@@ -202,7 +202,7 @@ int xfs_bmapi_write(struct xfs_trans *tp, struct xfs_inode *ip,
 int    xfs_bunmapi(struct xfs_trans *tp, struct xfs_inode *ip,
                xfs_fileoff_t bno, xfs_filblks_t len, uint32_t flags,
                xfs_extnum_t nexts, int *done);
-int    xfs_bmap_del_extent_delay(struct xfs_inode *ip, int whichfork,
+void   xfs_bmap_del_extent_delay(struct xfs_inode *ip, int whichfork,
                struct xfs_iext_cursor *cur, struct xfs_bmbt_irec *got,
                struct xfs_bmbt_irec *del);
 void   xfs_bmap_del_extent_cow(struct xfs_inode *ip,