aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2021-06-25 11:21:00 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-06-25 11:21:00 -0700
commit6be001021f0b307c8c1544e8b3ac87de20d711de (patch)
treee00ff94811efb130eb78d40d10ab6be8b15065ce /fs/xfs
parentxfs: Initialize error in xfs_attr_remove_iter (diff)
downloadlinux-dev-6be001021f0b307c8c1544e8b3ac87de20d711de.tar.xz
linux-dev-6be001021f0b307c8c1544e8b3ac87de20d711de.zip
xfs: don't nest icloglock inside ic_callback_lock
It's completely unnecessary because callbacks are added to iclogs without holding the icloglock, hence no amount of ordering between the icloglock and ic_callback_lock will order the removal of callbacks from the iclog. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_log.c18
1 files changed, 4 insertions, 14 deletions
diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index e93cac6b5378..bb4390942275 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -2773,11 +2773,8 @@ static void
xlog_state_do_iclog_callbacks(
struct xlog *log,
struct xlog_in_core *iclog)
- __releases(&log->l_icloglock)
- __acquires(&log->l_icloglock)
{
trace_xlog_iclog_callbacks_start(iclog, _RET_IP_);
- spin_unlock(&log->l_icloglock);
spin_lock(&iclog->ic_callback_lock);
while (!list_empty(&iclog->ic_callbacks)) {
LIST_HEAD(tmp);
@@ -2789,12 +2786,6 @@ xlog_state_do_iclog_callbacks(
spin_lock(&iclog->ic_callback_lock);
}
- /*
- * Pick up the icloglock while still holding the callback lock so we
- * serialise against anyone trying to add more callbacks to this iclog
- * now we've finished processing.
- */
- spin_lock(&log->l_icloglock);
spin_unlock(&iclog->ic_callback_lock);
trace_xlog_iclog_callbacks_done(iclog, _RET_IP_);
}
@@ -2836,13 +2827,12 @@ xlog_state_do_callback(
iclog = iclog->ic_next;
continue;
}
+ spin_unlock(&log->l_icloglock);
- /*
- * Running callbacks will drop the icloglock which means
- * we'll have to run at least one more complete loop.
- */
- cycled_icloglock = true;
xlog_state_do_iclog_callbacks(log, iclog);
+ cycled_icloglock = true;
+
+ spin_lock(&log->l_icloglock);
if (XLOG_FORCED_SHUTDOWN(log))
wake_up_all(&iclog->ic_force_wait);
else