Skip to contentSkip to conversation

V2 jbd2_stats_proc_init wrong place.

PATCH In review yangsheng 2 participants 2 messages Nov 11, 2010 – Nov 15, 2010

Subsystems (2)
lore
Share & tools
lore

yangsheng

author
#0 lore raw

PATCH 1/1 V2 jbd2_stats_proc_init wrong place.

The jbd2_stats_proc_init() was placed on wrong location in jbd2_journal_init_dev(). This may cause /proc/fs/jdb2/<dev>/* cannot be created when using external journal device.

---
 fs/jbd2/journal.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
fs/jbd2/journal.c +10 -9
index 13b0a92..a435710 100644
@@ -897,9 +897,18 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
 	if (!journal)
 		return NULL;
 
+	journal->j_dev = bdev;
+	journal->j_fs_dev = fs_dev;
+	journal->j_blk_offset = start;
+	journal->j_maxlen = len;
+	bdevname(journal->j_dev, journal->j_devname);
+	p = journal->j_devname;
+	while ((p = strchr(p, '/')))
+		*p = '!';
+	jbd2_stats_proc_init(journal);
+
 	/* journal descriptor can store up to n blocks -bzzz */
 	journal->j_blocksize = blocksize;
-	jbd2_stats_proc_init(journal);
 	n = journal->j_blocksize / sizeof(journal_block_tag_t);
 	journal->j_wbufsize = n;
 	journal->j_wbuf = kmalloc(n * sizeof(struct buffer_head*), GFP_KERNEL);
@@ -908,14 +917,6 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
 			__func__);
 		goto out_err;
 	}
-	journal->j_dev = bdev;
-	journal->j_fs_dev = fs_dev;
-	journal->j_blk_offset = start;
-	journal->j_maxlen = len;
-	bdevname(journal->j_dev, journal->j_devname);
-	p = journal->j_devname;
-	while ((p = strchr(p, '/')))
-		*p = '!';
 
 	bh = __getblk(journal->j_dev, start, journal->j_blocksize);
 	if (!bh) {
Signature · 1 line
1.7.2.3
#1 lore raw
Quoted 6 lines · yangsheng

The jbd2_stats_proc_init() was placed on wrong location in jbd2_journal_init_dev(). This may cause /proc/fs/jdb2/<dev>/* cannot be created when using external journal device.

---
 fs/jbd2/journal.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

adding linux-ext4 to cc:

Quoted 39 lines
fs/jbd2/journal.c +10 -9
index 13b0a92..a435710 100644
@@ -897,9 +897,18 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
 	if (!journal)
 		return NULL;
 
+	journal->j_dev = bdev;
+	journal->j_fs_dev = fs_dev;
+	journal->j_blk_offset = start;
+	journal->j_maxlen = len;
+	bdevname(journal->j_dev, journal->j_devname);
+	p = journal->j_devname;
+	while ((p = strchr(p, '/')))
+		*p = '!';
+	jbd2_stats_proc_init(journal);
+
 	/* journal descriptor can store up to n blocks -bzzz */
 	journal->j_blocksize = blocksize;
-	jbd2_stats_proc_init(journal);
 	n = journal->j_blocksize / sizeof(journal_block_tag_t);
 	journal->j_wbufsize = n;
 	journal->j_wbuf = kmalloc(n * sizeof(struct buffer_head*), GFP_KERNEL);
@@ -908,14 +917,6 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
 			__func__);
 		goto out_err;
 	}
-	journal->j_dev = bdev;
-	journal->j_fs_dev = fs_dev;
-	journal->j_blk_offset = start;
-	journal->j_maxlen = len;
-	bdevname(journal->j_dev, journal->j_devname);
-	p = journal->j_devname;
-	while ((p = strchr(p, '/')))
-		*p = '!';
 
 	bh = __getblk(journal->j_dev, start, journal->j_blocksize);
 	if (!bh) {