]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
mkfs: fix crash when initializing rbmip libxfs-4.6-sync
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 29 Feb 2016 05:03:07 +0000 (16:03 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 29 Feb 2016 05:03:07 +0000 (16:03 +1100)
Initialize rbmip, log the inode, /then/ assign it to the xfs_mount.
Don't try to access rbmip in the xfs_mount before that, or it'll crash.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
mkfs/proto.c

index 933924ef21ae2680e8a135fa1c16dec1cc055ad2..d99e965896407bddd8a495be4c1222c06ed31c44 100644 (file)
@@ -653,7 +653,7 @@ rtinit(
        mp->m_sb.sb_rbmino = rbmip->i_ino;
        rbmip->i_d.di_size = mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize;
        rbmip->i_d.di_flags = XFS_DIFLAG_NEWRTBM;
-       *(__uint64_t *)&VFS_I(mp->m_rbmip)->i_atime = 0;
+       *(__uint64_t *)&VFS_I(rbmip)->i_atime = 0;
        libxfs_trans_log_inode(tp, rbmip, XFS_ILOG_CORE);
        libxfs_log_sb(tp);
        mp->m_rbmip = rbmip;