Andreas Gruenbacher 9ffa18884c gfs2: gl_object races fix
Function glock_clear_object() checks if the specified glock is still
pointing at the right object and clears the gl_object pointer.  To
handle the case of incompletely constructed inodes, glock_clear_object()
also allows gl_object to be NULL.

However, in the teardown case, when iget_failed() is called and the
inode is removed from the inode hash, by the time we get to the
glock_clear_object() calls in gfs2_put_super() and its helpers, we don't
have exclusion against concurrent gfs2_inode_lookup() and
gfs2_create_inode() calls, and the inode and iopen glocks may already be
pointing at another inode, so the checks in glock_clear_object() are
incorrect.

To better handle this case, always completely disassociate an inode from
its glocks before tearing it down.  In addition, get rid of a duplicate
glock_clear_object() call in gfs2_evict_inode().  That way,
glock_clear_object() will only ever be called when the glock points at
the current inode, and the NULL check in glock_clear_object() can be
removed.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
2023-01-27 15:55:48 +01:00
..
2022-10-19 12:55:42 +02:00
2022-10-19 12:55:42 +02:00
2019-07-03 14:45:18 +02:00
2023-01-18 10:44:05 -08:00
2021-06-29 10:56:51 +02:00
2022-08-06 14:44:49 -07:00
2023-01-27 15:55:48 +01:00
2023-01-27 15:55:48 +01:00
2022-05-09 23:12:33 -04:00
2022-08-03 10:35:43 -07:00
2022-09-11 20:26:06 -07:00
2023-01-27 15:55:48 +01:00
2022-02-02 07:49:59 -07:00