]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
gfs2: Upgrade shared glocks for atime updates
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 25 Nov 2020 22:37:18 +0000 (23:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Dec 2020 12:22:07 +0000 (13:22 +0100)
commit8a208228d2796abb1c38d7cecb7fd485107d751d
tree1ef7066e1c30803afe6cba2e17545624dd6f0e45
parent7ab2621b2ff6766ece20140aeb1da13175107e0a
gfs2: Upgrade shared glocks for atime updates

commit 82e938bd5382b322ce81e6cb8fd030987f2da022 upstream.

Commit 20f829999c38 ("gfs2: Rework read and page fault locking") lifted
the glock lock taking from the low-level ->readpage and ->readahead
address space operations to the higher-level ->read_iter file and
->fault vm operations.  The glocks are still taken in LM_ST_SHARED mode
only.  On filesystems mounted without the noatime option, ->read_iter
sometimes needs to update the atime as well, though.  Right now, this
leads to a failed locking mode assertion in gfs2_dirty_inode.

Fix that by introducing a new update_time inode operation.  There, if
the glock is held non-exclusively, upgrade it to an exclusive lock.

Reported-by: Alexander Aring <aahringo@redhat.com>
Fixes: 20f829999c38 ("gfs2: Rework read and page fault locking")
Cc: stable@vger.kernel.org # v5.8+
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/gfs2/inode.c