Skip to contentSkip to conversation

don't call jbd2_journal_force_commit_nested w/o journal

PATCH Applied Eric Sandeen 2 participants 2 messages Feb 25, 2009 – Feb 26, 2009 ext4 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 don't call jbd2_journal_force_commit_nested w/o 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.

---

fs/ext4/balloc.c +3 -1
Index: linux-2.6/fs/ext4/balloc.c
===================================================================
@@ -609,7 +609,9 @@ int ext4_claim_free_blocks(struct ext4_s
  */
 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);
fs/ext4/inode.c +1 -1
Index: linux-2.6/fs/ext4/inode.c
===================================================================
@@ -2540,7 +2540,7 @@ retry:
 
 		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
maintainer Applied
#1 lore raw
Quoted 5 lines · Eric Sandeen

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.

Thanks applied in the ext4 patch queue.

- Ted