diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2019-04-29 22:50:30 +0300 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2019-05-08 00:39:15 +0300 |
commit | d0a22a4b03b8475b7aa3fa41243c26c291407844 (patch) | |
tree | af68f7f35e0a354aa370d130e9e79b757783b36d /fs/gfs2/recovery.h | |
parent | 8f91821990fd6f170a5dca79697a441181a41b16 (diff) | |
download | linux-d0a22a4b03b8475b7aa3fa41243c26c291407844.tar.xz |
gfs2: Fix iomap write page reclaim deadlock
Since commit 64bc06bb32ee ("gfs2: iomap buffered write support"), gfs2 is doing
buffered writes by starting a transaction in iomap_begin, writing a range of
pages, and ending that transaction in iomap_end. This approach suffers from
two problems:
(1) Any allocations necessary for the write are done in iomap_begin, so when
the data aren't journaled, there is no need for keeping the transaction open
until iomap_end.
(2) Transactions keep the gfs2 log flush lock held. When
iomap_file_buffered_write calls balance_dirty_pages, this can end up calling
gfs2_write_inode, which will try to flush the log. This requires taking the
log flush lock which is already held, resulting in a deadlock.
Fix both of these issues by not keeping transactions open from iomap_begin to
iomap_end. Instead, start a small transaction in page_prepare and end it in
page_done when necessary.
Reported-by: Edwin Török <edvin.torok@citrix.com>
Fixes: 64bc06bb32ee ("gfs2: iomap buffered write support")
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Diffstat (limited to 'fs/gfs2/recovery.h')
0 files changed, 0 insertions, 0 deletions