diff options
author | Alexander Aring <aahringo@redhat.com> | 2021-10-13 10:02:00 -0400 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2021-10-25 08:42:20 +0200 |
commit | 660a6126f8c3208f6df8d552039cda078a8426d1 (patch) | |
tree | 5f0564f84181680ad3a87f60fc54a5076b8d116d /fs/gfs2/glock.c | |
parent | 7427f3bb49d81525b7dd1d0f7c5f6bbc752e6f0e (diff) |
gfs2: check context in gfs2_glock_put
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>
Diffstat (limited to 'fs/gfs2/glock.c')
-rw-r--r-- | fs/gfs2/glock.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 6e3bd5ab9108..19f38aee1b61 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -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; |