diff options
author | Bob Peterson <rpeterso@redhat.com> | 2019-02-12 13:43:55 -0700 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2020-02-10 07:39:47 -0600 |
commit | 69511080bd6efd34f4e020fcde6cf73bb4a61af6 (patch) | |
tree | 28db914524c033ac6ac0366cdb571f5765ab4c0a /fs/gfs2/util.c | |
parent | 8e28ef1f2fa176854f96fb0416f2aaf5516793d0 (diff) |
gfs2: Introduce concept of a pending withdraw
File system withdraws can be delayed when inconsistencies are
discovered when we cannot withdraw immediately, for example, when
critical spin_locks are held. But delaying the withdraw can cause
gfs2 to ignore the error and keep running for a short period of time.
For example, an rgrp glock may be dequeued and demoted while there
are still buffers that haven't been properly revoked, due to io
errors writing to the journal.
This patch introduces a new concept of a pending withdraw, which
means an inconsistency has been discovered and we need to withdraw
at the earliest possible opportunity. In these cases, we aren't
quite withdrawn yet, but we still need to not dequeue glocks and
other critical things. If we dequeue the glocks and the withdraw
results in our journal being replayed, the replay could overwrite
data that's been modified by a different node that acquired the
glock in the meantime.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/util.c')
-rw-r--r-- | fs/gfs2/util.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/gfs2/util.c b/fs/gfs2/util.c index ec8e8c5ce848..47cd40de08b1 100644 --- a/fs/gfs2/util.c +++ b/fs/gfs2/util.c @@ -249,13 +249,13 @@ void gfs2_io_error_bh_i(struct gfs2_sbd *sdp, struct buffer_head *bh, const char *function, char *file, unsigned int line, bool withdraw) { - if (!gfs2_withdrawn(sdp)) - fs_err(sdp, - "fatal: I/O error\n" - " block = %llu\n" - " function = %s, file = %s, line = %u\n", - (unsigned long long)bh->b_blocknr, - function, file, line); + if (gfs2_withdrawn(sdp)) + return; + + fs_err(sdp, "fatal: I/O error\n" + " block = %llu\n" + " function = %s, file = %s, line = %u\n", + (unsigned long long)bh->b_blocknr, function, file, line); if (withdraw) gfs2_withdraw(sdp); } |