提交 8f64b32e 编写于 作者: E Eric Sandeen 提交者: Theodore Ts'o

ext4: don't call jbd2_journal_force_commit_nested without journal

Running without a journal, I oopsed when I ran out of space,
because we called jbd2_journal_force_commit_nested() from
ext4_should_retry_alloc() without a journal.

This should take care of it, I think.
Signed-off-by: NEric Sandeen <sandeen@redhat.com>
Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
上级 d8ae4601
......@@ -609,7 +609,9 @@ int ext4_claim_free_blocks(struct ext4_sb_info *sbi,
*/
int ext4_should_retry_alloc(struct super_block *sb, int *retries)
{
if (!ext4_has_free_blocks(EXT4_SB(sb), 1) || (*retries)++ > 3)
if (!ext4_has_free_blocks(EXT4_SB(sb), 1) ||
(*retries)++ > 3 ||
!EXT4_SB(sb)->s_journal)
return 0;
jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);
......
......@@ -2544,7 +2544,7 @@ static int ext4_da_writepages(struct address_space *mapping,
ext4_journal_stop(handle);
if (mpd.retval == -ENOSPC) {
if ((mpd.retval == -ENOSPC) && sbi->s_journal) {
/* commit the transaction which would
* free blocks released in the transaction
* and try again
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册