]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
xfs: xfs_qm_dqattach_one is never called with a non-NULL *IO_idqpp
authorChristoph Hellwig <hch@lst.de>
Mon, 10 Nov 2025 13:23:00 +0000 (14:23 +0100)
committerCarlos Maiolino <cem@kernel.org>
Tue, 11 Nov 2025 10:45:58 +0000 (11:45 +0100)
The caller already checks that, so replace the handling of this case with
an assert that it does not happen.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_qm.c
fs/xfs/xfs_trace.h

index 5e6aefb17f19a81bcbc7e85a4b0e2e9b79780240..b571eff51694a0957f7568cfe599f055cb328bc6 100644 (file)
@@ -297,19 +297,8 @@ xfs_qm_dqattach_one(
        struct xfs_dquot        *dqp;
        int                     error;
 
+       ASSERT(!*IO_idqpp);
        xfs_assert_ilocked(ip, XFS_ILOCK_EXCL);
-       error = 0;
-
-       /*
-        * See if we already have it in the inode itself. IO_idqpp is &i_udquot
-        * or &i_gdquot. This made the code look weird, but made the logic a lot
-        * simpler.
-        */
-       dqp = *IO_idqpp;
-       if (dqp) {
-               trace_xfs_dqattach_found(dqp);
-               return 0;
-       }
 
        /*
         * Find the dquot from somewhere. This bumps the reference count of
index fccc032b3c6ce9e4827e5efbc41bb2d94ee00ea5..90582ff7c2cf22d9d76d5f95fef1cc1b80f07927 100644 (file)
@@ -1399,7 +1399,6 @@ DEFINE_DQUOT_EVENT(xfs_dqadjust);
 DEFINE_DQUOT_EVENT(xfs_dqreclaim_want);
 DEFINE_DQUOT_EVENT(xfs_dqreclaim_busy);
 DEFINE_DQUOT_EVENT(xfs_dqreclaim_done);
-DEFINE_DQUOT_EVENT(xfs_dqattach_found);
 DEFINE_DQUOT_EVENT(xfs_dqattach_get);
 DEFINE_DQUOT_EVENT(xfs_dqalloc);
 DEFINE_DQUOT_EVENT(xfs_dqtobp_read);