]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
gfs2: use i_lock spin_lock for inode qadata
authorBob Peterson <rpeterso@redhat.com>
Fri, 11 Feb 2022 15:50:08 +0000 (10:50 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 10 Aug 2022 07:23:53 +0000 (09:23 +0200)
commit3da65c41f6b87f5d013170801e05c77d9daf9be5
treec28cdf5274d3ee5320118140f94bd56361a7ad18
parent0006ab068350d1477f2905bc1e5522138786ed20
gfs2: use i_lock spin_lock for inode qadata

BugLink: https://bugs.launchpad.net/bugs/1981864
[ Upstream commit 5fcff61eea9efd1f4b60e89d2d686b5feaea100f ]

Before this patch, functions gfs2_qa_get and _put used the i_rw_mutex to
prevent simultaneous access to its i_qadata. But i_rw_mutex is now used
for many other things, including iomap_begin and end, which causes a
conflict according to lockdep. We cannot just remove the lock since
simultaneous opens (gfs2_open -> gfs2_open_common -> gfs2_qa_get) can
then stomp on each others values for i_qadata.

This patch solves the conflict by using the i_lock spin_lock in the inode
to prevent simultaneous access.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/gfs2/quota.c