]> git.baikalelectronics.ru Git - kernel.git/commit
gfs2: add some much needed cleanup for log flushes that fail
authorBob Peterson <rpeterso@redhat.com>
Fri, 21 Aug 2020 13:50:34 +0000 (08:50 -0500)
committerAndreas Gruenbacher <agruenba@redhat.com>
Mon, 24 Aug 2020 11:54:07 +0000 (13:54 +0200)
commitf41e2fd928e0f9ec215ebd2ccb92c0cb56ca503a
treedf298e45bccc0685ff715865b4ad6e8fc4771201
parent066a8aace0c5f86a6f60488ff677bb53935358db
gfs2: add some much needed cleanup for log flushes that fail

When a log flush fails due to io errors, it signals the failure but does
not clean up after itself very well. This is because buffers are added to
the transaction tr_buf and tr_databuf queue, but the io error causes
gfs2_log_flush to bypass the "after_commit" functions responsible for
dequeueing the bd elements. If the bd elements are added to the ail list
before the error, function ail_drain takes care of dequeueing them.
But if they haven't gotten that far, the elements are forgotten and
make the transactions unable to be freed.

This patch introduces new function trans_drain which drains the bd
elements from the transaction so they can be freed properly.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/log.c
fs/gfs2/trans.c