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: Andreas Dilger <andreas.dilger@oracle.com>
Signed-off-by: yangsheng <sheng.yang@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

authored by yangsheng and committed by Theodore Ts'o 0587aa3d f4c8cc65

+8 -8
+8 -8
fs/jbd2/journal.c
··· 899 899 900 900 /* journal descriptor can store up to n blocks -bzzz */ 901 901 journal->j_blocksize = blocksize; 902 + journal->j_dev = bdev; 903 + journal->j_fs_dev = fs_dev; 904 + journal->j_blk_offset = start; 905 + journal->j_maxlen = len; 906 + bdevname(journal->j_dev, journal->j_devname); 907 + p = journal->j_devname; 908 + while ((p = strchr(p, '/'))) 909 + *p = '!'; 902 910 jbd2_stats_proc_init(journal); 903 911 n = journal->j_blocksize / sizeof(journal_block_tag_t); 904 912 journal->j_wbufsize = n; ··· 916 908 __func__); 917 909 goto out_err; 918 910 } 919 - journal->j_dev = bdev; 920 - journal->j_fs_dev = fs_dev; 921 - journal->j_blk_offset = start; 922 - journal->j_maxlen = len; 923 - bdevname(journal->j_dev, journal->j_devname); 924 - p = journal->j_devname; 925 - while ((p = strchr(p, '/'))) 926 - *p = '!'; 927 911 928 912 bh = __getblk(journal->j_dev, start, journal->j_blocksize); 929 913 if (!bh) {