OSDN Git Service

gfs2: check context in gfs2_glock_put
authorAlexander Aring <aahringo@redhat.com>
Wed, 13 Oct 2021 14:02:00 +0000 (10:02 -0400)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 25 Oct 2021 06:42:20 +0000 (08:42 +0200)
Add a might_sleep call into gfs2_glock_put which can sleep in DLM when
the last reference is released.  This will show problems earlier, and
not only when the last reference is put.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/glock.c

index 6e3bd5a..19f38ae 100644 (file)
@@ -301,6 +301,9 @@ void gfs2_glock_queue_put(struct gfs2_glock *gl)
 
 void gfs2_glock_put(struct gfs2_glock *gl)
 {
+       /* last put could call sleepable dlm api */
+       might_sleep();
+
        if (lockref_put_or_lock(&gl->gl_lockref))
                return;