| .. | .. |
|---|
| 371 | 371 | } |
|---|
| 372 | 372 | #endif |
|---|
| 373 | 373 | |
|---|
| 374 | + if (WARN_ON_ONCE(handle->h_revoke_credits <= 0)) { |
|---|
| 375 | + if (!bh_in) |
|---|
| 376 | + brelse(bh); |
|---|
| 377 | + return -EIO; |
|---|
| 378 | + } |
|---|
| 374 | 379 | /* We really ought not ever to revoke twice in a row without |
|---|
| 375 | 380 | first having the revoke cancelled: it's illegal to free a |
|---|
| 376 | 381 | block twice without allocating it in between! */ |
|---|
| .. | .. |
|---|
| 391 | 396 | __brelse(bh); |
|---|
| 392 | 397 | } |
|---|
| 393 | 398 | } |
|---|
| 399 | + handle->h_revoke_credits--; |
|---|
| 394 | 400 | |
|---|
| 395 | 401 | jbd_debug(2, "insert revoke for block %llu, bh_in=%p\n",blocknr, bh_in); |
|---|
| 396 | 402 | err = insert_revoke_hash(journal, blocknr, |
|---|
| .. | .. |
|---|
| 638 | 644 | { |
|---|
| 639 | 645 | jbd2_journal_revoke_header_t *header; |
|---|
| 640 | 646 | |
|---|
| 641 | | - if (is_journal_aborted(journal)) { |
|---|
| 642 | | - put_bh(descriptor); |
|---|
| 647 | + if (is_journal_aborted(journal)) |
|---|
| 643 | 648 | return; |
|---|
| 644 | | - } |
|---|
| 645 | 649 | |
|---|
| 646 | 650 | header = (jbd2_journal_revoke_header_t *)descriptor->b_data; |
|---|
| 647 | 651 | header->r_count = cpu_to_be32(offset); |
|---|