]> git.ipfire.org Git - people/ms/linux.git/commit - fs/gfs2/file.c
gfs2: Move the inode glock locking to gfs2_file_buffered_write
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 11 Aug 2021 19:50:14 +0000 (21:50 +0200)
committerAndreas Gruenbacher <agruenba@redhat.com>
Wed, 20 Oct 2021 17:33:09 +0000 (19:33 +0200)
commitb924bdab7445946e2ed364a0e6e249d36f1f1158
treec71193a31fa362a74e239ba4c5e862c6847b5349
parentdc732906c2450939c319fec6e258aa89ecb5a632
gfs2: Move the inode glock locking to gfs2_file_buffered_write

So far, for buffered writes, we were taking the inode glock in
gfs2_iomap_begin and dropping it in gfs2_iomap_end with the intention of
not holding the inode glock while iomap_write_actor faults in user
pages.  It turns out that iomap_write_actor is called inside iomap_begin
... iomap_end, so the user pages were still faulted in while holding the
inode glock and the locking code in iomap_begin / iomap_end was
completely pointless.

Move the locking into gfs2_file_buffered_write instead.  We'll take care
of the potential deadlocks due to faulting in user pages while holding a
glock in a subsequent patch.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/bmap.c
fs/gfs2/file.c