gfs2: Add proper lockspace locking
authorAndreas Gruenbacher <agruenba@redhat.com>
Mon, 7 Jul 2025 12:31:41 +0000 (14:31 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Fri, 12 Sep 2025 10:02:57 +0000 (12:02 +0200)
commit6ab26555c9ffef96c56ca16356e55ac5ab61ec93
tree38d3f524d9b59adae10c000d3d1d05640a659e4c
parent47faf937da43df9a84e65e5a880cf813e764971e
gfs2: Add proper lockspace locking

GFS2 has been calling functions like dlm_lock() even after the lockspace
that these functions operate on has been released with
dlm_release_lockspace().  It has always assumed that those functions
would return -EINVAL in that case, but that was never guaranteed, and it
certainly is no longer the case since commit 4db41bf4f04f ("dlm: remove
ls_local_handle from struct dlm_ls").

To fix that, add proper lockspace locking.

Fixes: 3e11e5304150 ("GFS2: ignore unlock failures after withdraw")
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Andrew Price <anprice@redhat.com>
fs/gfs2/file.c
fs/gfs2/glock.c
fs/gfs2/incore.h
fs/gfs2/lock_dlm.c