Commit d090707e authored by Jan Kara's avatar Jan Kara Committed by Theodore Ts'o
Browse files

jbd2: Make credit checking more strict



Make checking of available credits in jbd2_journal_dirty_metadata() more
strict. There should be always enough credits in the handle to write all
potential revoke descriptors. Also we warn in case there are not enough
credits since this is a bug in the filesystem.

Reviewed-by: default avatarTheodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20191105164437.32602-22-jack@suse.cz


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent 933f1c1e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1477,7 +1477,7 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
		 * of the transaction. This needs to be done
		 * once a transaction -bzzz
		 */
		if (handle->h_total_credits <= 0) {
		if (WARN_ON_ONCE(jbd2_handle_buffer_credits(handle) <= 0)) {
			ret = -ENOSPC;
			goto out_unlock_bh;
		}