Files
linux/fs
Bob Peterson 19709adfd7 gfs2: clean up iopen glock mess in gfs2_create_inode
[ Upstream commit 2c47c1be51 ]

Before this patch, gfs2_create_inode had a use-after-free for the
iopen glock in some error paths because it did this:

	gfs2_glock_put(io_gl);
fail_gunlock2:
	if (io_gl)
		clear_bit(GLF_INODE_CREATING, &io_gl->gl_flags);

In some cases, the io_gl was used for create and only had one
reference, so the glock might be freed before the clear_bit().
This patch tries to straighten it out by only jumping to the
error paths where iopen is properly set, and moving the
gfs2_glock_put after the clear_bit.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-10-01 13:14:28 +02:00
..
2020-08-19 08:15:06 +02:00
2020-09-09 19:04:23 +02:00
2019-08-06 19:06:51 +02:00
2020-08-19 08:15:02 +02:00
2020-07-29 10:16:46 +02:00
2018-08-17 16:20:28 -07:00
2020-08-26 10:31:01 +02:00
2019-12-13 08:51:59 +01:00
2018-08-17 16:20:27 -07:00
2018-05-22 14:27:52 -04:00
2020-06-22 09:05:01 +02:00
2018-07-03 16:44:45 -04:00
2020-09-03 11:24:24 +02:00
2018-06-05 19:23:26 +02:00
2020-03-05 16:42:12 +01:00
2020-10-01 13:14:27 +02:00
2020-03-25 08:06:14 +01:00
2018-06-11 08:22:34 -07:00