* [PATCH gfs2/for-next] gfs2: use delay during spinlock area
@ 2025-03-31 19:36 Alexander Aring
2025-03-31 21:31 ` David Laight
0 siblings, 1 reply; 3+ messages in thread
From: Alexander Aring @ 2025-03-31 19:36 UTC (permalink / raw)
To: agruenba; +Cc: stable, gfs2, aahringo
In a rare case of gfs2 spectator mount the ls->ls_recover_spin is being
held. In this case we cannot call msleep_interruptible() as we a in a
non-sleepable context. Replace it with mdelay() to busy wait for 1
second.
Cc: stable@vger.kernel.org
Fixes: 4a7727725dc7 ("GFS2: Fix recovery issues for spectators")
Signed-off-by: Alexander Aring <aahringo@redhat.com>
---
fs/gfs2/lock_dlm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
index 58aeeae7ed8c..ac0afedff49b 100644
--- a/fs/gfs2/lock_dlm.c
+++ b/fs/gfs2/lock_dlm.c
@@ -996,7 +996,7 @@ static int control_mount(struct gfs2_sbd *sdp)
if (sdp->sd_args.ar_spectator) {
fs_info(sdp, "Recovery is required. Waiting for a "
"non-spectator to mount.\n");
- msleep_interruptible(1000);
+ mdelay(1000);
} else {
fs_info(sdp, "control_mount wait1 block %u start %u "
"mount %u lvb %u flags %lx\n", block_gen,
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH gfs2/for-next] gfs2: use delay during spinlock area
2025-03-31 19:36 [PATCH gfs2/for-next] gfs2: use delay during spinlock area Alexander Aring
@ 2025-03-31 21:31 ` David Laight
2025-03-31 22:47 ` Andreas Gruenbacher
0 siblings, 1 reply; 3+ messages in thread
From: David Laight @ 2025-03-31 21:31 UTC (permalink / raw)
To: Alexander Aring; +Cc: agruenba, stable, gfs2
On Mon, 31 Mar 2025 15:36:56 -0400
Alexander Aring <aahringo@redhat.com> wrote:
> In a rare case of gfs2 spectator mount the ls->ls_recover_spin is being
> held. In this case we cannot call msleep_interruptible() as we a in a
> non-sleepable context. Replace it with mdelay() to busy wait for 1
> second.
You can't busy wait like that.
You've just stopped any RT process that last ran on the cpu you are
on from running, as well as all any interrupts tied to the cpu.
Also consider a single cpu system.
David
>
> Cc: stable@vger.kernel.org
> Fixes: 4a7727725dc7 ("GFS2: Fix recovery issues for spectators")
> Signed-off-by: Alexander Aring <aahringo@redhat.com>
> ---
> fs/gfs2/lock_dlm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
> index 58aeeae7ed8c..ac0afedff49b 100644
> --- a/fs/gfs2/lock_dlm.c
> +++ b/fs/gfs2/lock_dlm.c
> @@ -996,7 +996,7 @@ static int control_mount(struct gfs2_sbd *sdp)
> if (sdp->sd_args.ar_spectator) {
> fs_info(sdp, "Recovery is required. Waiting for a "
> "non-spectator to mount.\n");
> - msleep_interruptible(1000);
> + mdelay(1000);
> } else {
> fs_info(sdp, "control_mount wait1 block %u start %u "
> "mount %u lvb %u flags %lx\n", block_gen,
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH gfs2/for-next] gfs2: use delay during spinlock area
2025-03-31 21:31 ` David Laight
@ 2025-03-31 22:47 ` Andreas Gruenbacher
0 siblings, 0 replies; 3+ messages in thread
From: Andreas Gruenbacher @ 2025-03-31 22:47 UTC (permalink / raw)
To: David Laight; +Cc: Alexander Aring, stable, gfs2
On Mon, Mar 31, 2025 at 11:32 PM David Laight
<david.laight.linux@gmail.com> wrote:
> On Mon, 31 Mar 2025 15:36:56 -0400 Alexander Aring <aahringo@redhat.com> wrote:
>
> > In a rare case of gfs2 spectator mount the ls->ls_recover_spin is being
> > held. In this case we cannot call msleep_interruptible() as we a in a
> > non-sleepable context. Replace it with mdelay() to busy wait for 1
> > second.
>
> You can't busy wait like that.
> You've just stopped any RT process that last ran on the cpu you are
> on from running, as well as all any interrupts tied to the cpu.
> Also consider a single cpu system.
I agree. This is easy to fix by waiting after releasing the spin lock.
Thanks,
Andreas
> David
>
> >
> > Cc: stable@vger.kernel.org
> > Fixes: 4a7727725dc7 ("GFS2: Fix recovery issues for spectators")
> > Signed-off-by: Alexander Aring <aahringo@redhat.com>
> > ---
> > fs/gfs2/lock_dlm.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
> > index 58aeeae7ed8c..ac0afedff49b 100644
> > --- a/fs/gfs2/lock_dlm.c
> > +++ b/fs/gfs2/lock_dlm.c
> > @@ -996,7 +996,7 @@ static int control_mount(struct gfs2_sbd *sdp)
> > if (sdp->sd_args.ar_spectator) {
> > fs_info(sdp, "Recovery is required. Waiting for a "
> > "non-spectator to mount.\n");
> > - msleep_interruptible(1000);
> > + mdelay(1000);
> > } else {
> > fs_info(sdp, "control_mount wait1 block %u start %u "
> > "mount %u lvb %u flags %lx\n", block_gen,
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-31 22:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-31 19:36 [PATCH gfs2/for-next] gfs2: use delay during spinlock area Alexander Aring
2025-03-31 21:31 ` David Laight
2025-03-31 22:47 ` Andreas Gruenbacher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox