Skip to contentSkip to conversation

Fix oops with jbd-stats-through-procfs and external journal

PATCH In review Eric Sandeen 2 participants 2 messages Oct 25, 2007 Journalling layer for block devices (JBD2)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix oops with jbd-stats-through-procfs and external journal

When using an external device for the journal, jbd2_stats_proc_init() wants to use journal->j_dev in its call to bdevname() but it's not assigned yet, resulting in an oops.

fs/jbd2/journal.c +1 -1
@@ -1035,11 +1035,11 @@
 		journal = NULL;
 		goto out;
 	}
-	jbd2_stats_proc_init(journal);
 	journal->j_dev = bdev;
 	journal->j_fs_dev = fs_dev;
 	journal->j_blk_offset = start;
 	journal->j_maxlen = len;
+	jbd2_stats_proc_init(journal);
 
 	bh = __getblk(journal->j_dev, start, journal->j_blocksize);
 	J_ASSERT(bh != NULL);
#1 lore raw

Thanks, Added to ext4 patch queue at
http://repo.or.cz/w/ext4-patch-queue.git

Quoted 26 lines · Eric Sandeen

When using an external device for the journal, jbd2_stats_proc_init() wants to use journal->j_dev in its call to bdevname() but it's not assigned yet, resulting in an oops.

fs/jbd2/journal.c +1 -2
@@ -1035,11 +1035,11 @@
 		journal = NULL;
 		goto out;
 	}
-	jbd2_stats_proc_init(journal);
 	journal->j_dev = bdev;
 	journal->j_fs_dev = fs_dev;
 	journal->j_blk_offset = start;
 	journal->j_maxlen = len;
+	jbd2_stats_proc_init(journal);
 
 	bh = __getblk(journal->j_dev, start, journal->j_blocksize);
 	J_ASSERT(bh != NULL);
 
-

To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html