From d0f93c0d7c9dc8f7fdbd1ce3f5d3bfd8e109da65 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 10 Nov 2025 14:23:00 +0100 Subject: [PATCH] xfs: xfs_qm_dqattach_one is never called with a non-NULL *IO_idqpp 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 Reviewed-by: Darrick J. Wong Signed-off-by: Carlos Maiolino --- fs/xfs/xfs_qm.c | 13 +------------ fs/xfs/xfs_trace.h | 1 - 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index 5e6aefb17f19a..b571eff51694a 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c @@ -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 diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h index fccc032b3c6ce..90582ff7c2cf2 100644 --- a/fs/xfs/xfs_trace.h +++ b/fs/xfs/xfs_trace.h @@ -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); -- 2.47.3