From: Bob Peterson <rpeterso@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] gfs2 hang in xfstests generic/361
Date: Mon, 26 Jul 2021 12:11:57 -0500 [thread overview]
Message-ID: <bc4786a3-625f-e663-622b-f0fe4899ad03@redhat.com> (raw)
In-Reply-To: <20210726140058.GA9206@lst.de>
On 7/26/21 9:00 AM, Christoph Hellwig wrote:
> I noticed this hang while testing the iomap_iter series on gfs2,
> but it also reproduces on 5.14-rc3. This is running locally with
> "-O -p lock_nolock":
>
> generic/361 files ... [ 1479.222703] run fstests generic/361 at 2021-07-26 13:57:10
(snip)
> [ 1491.752587] =============================
> [ 1491.753403] [ BUG: Invalid wait context ]
> [ 1491.754122] 5.14.0-rc2+ #47 Not tainted
> [ 1491.754860] -----------------------------
> [ 1491.755563] kworker/2:1H/1975 is trying to lock:
> [ 1491.756370] ffff8881048d0888 (&wq->mutex){+.+.}-{3:3}, at: flush_workqueue+0xc9/0x5f0
Hi Christoph,
Okay, I can recreate the failure you hit. The problem is that a withdraw
is happening from the glock workqueue, which is not right, since the
withdraw sequence itself waits for that workqueue to be flushed out.
(The withdraw itself is expected in this case, due to the IO errors.)
A patch like the following should hopefully fix the deadlock and/or BUG
by deferring the withdraw until the gfs2_logd daemon or something else
catches the error the next time it runs its loop. This is what is
supposed to happen in other similar situations we've had in the past.
Basically, we ignore the withdraw until it can be handled from a more
appropriate context.
diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c
index 42c15cfc0821..c138850b1f27 100644
--- a/fs/gfs2/log.c
+++ b/fs/gfs2/log.c
@@ -364,10 +364,8 @@ static int gfs2_ail1_empty(struct gfs2_sbd *sdp,
int max_revokes)
ret = list_empty(&sdp->sd_ail1_list);
spin_unlock(&sdp->sd_ail_lock);
- if (test_bit(SDF_WITHDRAWING, &sdp->sd_flags)) {
+ if (test_bit(SDF_WITHDRAWING, &sdp->sd_flags))
gfs2_lm(sdp, "fatal: I/O error(s)\n");
- gfs2_withdraw(sdp);
- }
return ret;
}
Can you try something like that and see if it handles the withdraw more
sanely? Thanks.
Regards,
Bob Peterson
next prev parent reply other threads:[~2021-07-26 17:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-26 14:00 [Cluster-devel] gfs2 hang in xfstests generic/361 Christoph Hellwig
2021-07-26 14:49 ` Bob Peterson
2021-07-26 17:11 ` Bob Peterson [this message]
2021-07-26 17:35 ` Bob Peterson
2021-07-26 18:50 ` [Cluster-devel] gfs2 hang in xfstests generic/361 (v3) Bob Peterson
2021-07-27 7:05 ` Christoph Hellwig
2021-07-27 14:05 ` Bob Peterson
2021-07-27 14:27 ` Andreas Gruenbacher
2021-07-27 16:41 ` Bob Peterson
2021-07-28 5:39 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bc4786a3-625f-e663-622b-f0fe4899ad03@redhat.com \
--to=rpeterso@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).