提交 31b0cfea 编写于 作者: J Jan Kara 提交者: Yang Yingliang

jbd2: Make credit checking more strict

mainline inclusion
from mainline-5.5-rc1
commit d090707edab59cb07047d6d7e138ffcc3bdc42be
category: bugfix
bugzilla: 25031
CVE: NA
---------------------------

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: NTheodore Ts'o <tytso@mit.edu>
Signed-off-by: NJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20191105164437.32602-22-jack@suse.czSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
Signed-off-by: Nzhangyi (F) <yi.zhang@huawei.com>
Reviewed-by: NYang Erkun <yangerkun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 c38a5168
...@@ -1443,7 +1443,7 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh) ...@@ -1443,7 +1443,7 @@ int jbd2_journal_dirty_metadata(handle_t *handle, struct buffer_head *bh)
* of the transaction. This needs to be done * of the transaction. This needs to be done
* once a transaction -bzzz * once a transaction -bzzz
*/ */
if (handle->h_total_credits <= 0) { if (WARN_ON_ONCE(jbd2_handle_buffer_credits(handle) <= 0)) {
ret = -ENOSPC; ret = -ENOSPC;
goto out_unlock_bh; goto out_unlock_bh;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册