linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] don't call jbd2_journal_force_commit_nested w/o journal
@ 2009-02-25 20:15 Eric Sandeen
  2009-02-26  6:00 ` Theodore Tso
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2009-02-25 20:15 UTC (permalink / raw)
  To: ext4 development

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: Eric Sandeen <sandeen@redhat.com>
---

Index: linux-2.6/fs/ext4/balloc.c
===================================================================
--- linux-2.6.orig/fs/ext4/balloc.c
+++ 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);
Index: linux-2.6/fs/ext4/inode.c
===================================================================
--- linux-2.6.orig/fs/ext4/inode.c
+++ 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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] don't call jbd2_journal_force_commit_nested w/o journal
  2009-02-25 20:15 [PATCH] don't call jbd2_journal_force_commit_nested w/o journal Eric Sandeen
@ 2009-02-26  6:00 ` Theodore Tso
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Tso @ 2009-02-26  6:00 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: ext4 development

On Wed, Feb 25, 2009 at 02:15:21PM -0600, Eric Sandeen wrote:
> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-26  6:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-25 20:15 [PATCH] don't call jbd2_journal_force_commit_nested w/o journal Eric Sandeen
2009-02-26  6:00 ` Theodore Tso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).