diff options
author | Bob Peterson <rpeterso@redhat.com> | 2020-01-08 11:37:30 -0600 |
---|---|---|
committer | Bob Peterson <rpeterso@redhat.com> | 2020-02-27 07:53:18 -0600 |
commit | ca399c96e96e3f372f901a698a6fd17796b8ed32 (patch) | |
tree | 9766df255f2ee4ce3ff4a649b99c0341b3155265 /fs/gfs2/util.h | |
parent | 1c634f94c3da39115270d35b3075af970810a927 (diff) | |
download | linux-ca399c96e96e3f372f901a698a6fd17796b8ed32.tar.bz2 |
gfs2: flesh out delayed withdraw for gfs2_log_flush
Function gfs2_log_flush() had a few places where it tried to withdraw
from the file system when errors were encountered. The problem is,
it should delay those withdraws until the log flush lock is no longer
held.
This patch creates a new function just for delayed withdraws for
situations like this. If errors=panic was specified on mount, we
still want to do it the old fashioned way because the panic it does
not help to delay in that situation.
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2/util.h')
-rw-r--r-- | fs/gfs2/util.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/gfs2/util.h b/fs/gfs2/util.h index 97117a766bde..a3542560da6f 100644 --- a/fs/gfs2/util.h +++ b/fs/gfs2/util.h @@ -37,14 +37,24 @@ do { \ void gfs2_assert_withdraw_i(struct gfs2_sbd *sdp, char *assertion, - const char *function, char *file, unsigned int line); + const char *function, char *file, unsigned int line, + bool delayed); #define gfs2_assert_withdraw(sdp, assertion) \ ({ \ bool _bool = (assertion); \ if (unlikely(!_bool)) \ gfs2_assert_withdraw_i((sdp), #assertion, \ - __func__, __FILE__, __LINE__); \ + __func__, __FILE__, __LINE__, false); \ + !_bool; \ + }) + +#define gfs2_assert_withdraw_delayed(sdp, assertion) \ + ({ \ + bool _bool = (assertion); \ + if (unlikely(!_bool)) \ + gfs2_assert_withdraw_i((sdp), #assertion, \ + __func__, __FILE__, __LINE__, true); \ !_bool; \ }) |