Revision 95ecbd0f162fc06ef4c4045a66f653f47b62a2d3 authored by Andreas Gruenbacher on 19 January 2023, 19:14:42 UTC, committed by Andreas Gruenbacher on 22 January 2023, 08:46:14 UTC
Commit b2b0a5e97855 switched from generic_writepages() to
filemap_fdatawrite_wbc() in gfs2_ail1_start_one() on the path to
replacing ->writepage() with ->writepages() and eventually eliminating
the former.  Function gfs2_ail1_start_one() is called from
gfs2_log_flush(), our main function for flushing the filesystem log.

Unfortunately, at least as implemented today, ->writepage() and
->writepages() are entirely different operations for journaled data
inodes: while the former creates and submits transactions covering the
data to be written, the latter flushes dirty buffers out to disk.

With gfs2_ail1_start_one() now calling ->writepages(), we end up
creating filesystem transactions while we are in the course of a log
flush, which immediately deadlocks on the sdp->sd_log_flush_lock
semaphore.

Work around that by going back to how things used to work before commit
b2b0a5e97855 for now; figuring out a superior solution will take time we
don't have available right now.  However ...

Since the removal of generic_writepages() is imminent, open-code it
here.  We're already inside a blk_start_plug() ...  blk_finish_plug()
section here, so skip that part of the original generic_writepages().

This reverts commit b2b0a5e978552e348f85ad9c7568b630a5ede659.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Acked-by: Christoph Hellwig <hch@lst.de>
1 parent 5dc4c99
History
File Mode Size
Makefile -rw-r--r-- 361 bytes
compat.c -rw-r--r-- 2.2 KB
ipc_sysctl.c -rw-r--r-- 7.2 KB
mq_sysctl.c -rw-r--r-- 3.0 KB
mqueue.c -rw-r--r-- 43.8 KB
msg.c -rw-r--r-- 32.3 KB
msgutil.c -rw-r--r-- 3.6 KB
namespace.c -rw-r--r-- 5.3 KB
sem.c -rw-r--r-- 63.2 KB
shm.c -rw-r--r-- 45.1 KB
syscall.c -rw-r--r-- 5.1 KB
util.c -rw-r--r-- 24.2 KB
util.h -rw-r--r-- 8.9 KB

back to top