Commit 0587aa3d authored by yangsheng's avatar yangsheng Committed by Theodore Ts'o

jbd2: fix /proc/fs/jbd2/<dev> when using an external journal

In jbd2_journal_init_dev(), we need make sure the journal structure is
fully initialzied before calling jbd2_stats_proc_init().
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@oracle.com>
Signed-off-by: default avataryangsheng <sheng.yang@oracle.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent f4c8cc65
...@@ -899,6 +899,14 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev, ...@@ -899,6 +899,14 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
/* journal descriptor can store up to n blocks -bzzz */ /* journal descriptor can store up to n blocks -bzzz */
journal->j_blocksize = blocksize; journal->j_blocksize = blocksize;
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); jbd2_stats_proc_init(journal);
n = journal->j_blocksize / sizeof(journal_block_tag_t); n = journal->j_blocksize / sizeof(journal_block_tag_t);
journal->j_wbufsize = n; journal->j_wbufsize = n;
...@@ -908,14 +916,6 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev, ...@@ -908,14 +916,6 @@ journal_t * jbd2_journal_init_dev(struct block_device *bdev,
__func__); __func__);
goto out_err; 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); bh = __getblk(journal->j_dev, start, journal->j_blocksize);
if (!bh) { if (!bh) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment