diff options
author | Theodore Ts'o <tytso@mit.edu> | 2019-11-05 16:02:20 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2019-11-05 16:02:20 -0500 |
commit | a6d4040846bff49c7e870cee5693245f87f2cfce (patch) | |
tree | 215862ebc82e00599e7cb2fa8ae7b88356768c1b /fs/jbd2/revoke.c | |
parent | 0d0a60c92fedbd4bf484c4c9b5cd49c16d05fb3f (diff) | |
parent | 19014d697147c6aea3a34eea00a2844e698d070f (diff) | |
download | linux-a6d4040846bff49c7e870cee5693245f87f2cfce.tar.gz linux-a6d4040846bff49c7e870cee5693245f87f2cfce.tar.bz2 linux-a6d4040846bff49c7e870cee5693245f87f2cfce.zip |
Merge branch 'jk/jbd2-revoke-overflow'
Diffstat (limited to 'fs/jbd2/revoke.c')
-rw-r--r-- | fs/jbd2/revoke.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/jbd2/revoke.c b/fs/jbd2/revoke.c index f08073d7bbf5..fa608788b93d 100644 --- a/fs/jbd2/revoke.c +++ b/fs/jbd2/revoke.c @@ -371,6 +371,11 @@ int jbd2_journal_revoke(handle_t *handle, unsigned long long blocknr, } #endif + if (WARN_ON_ONCE(handle->h_revoke_credits <= 0)) { + if (!bh_in) + brelse(bh); + return -EIO; + } /* We really ought not ever to revoke twice in a row without first having the revoke cancelled: it's illegal to free a block twice without allocating it in between! */ @@ -391,6 +396,7 @@ int jbd2_journal_revoke(handle_t *handle, unsigned long long blocknr, __brelse(bh); } } + handle->h_revoke_credits--; jbd_debug(2, "insert revoke for block %llu, bh_in=%p\n",blocknr, bh_in); err = insert_revoke_hash(journal, blocknr, |