xfs
[Top] [All Lists]

[PATCH] mkfs: fix crash when initializing rbmip

To: Brian Foster <bfoster@xxxxxxxxxx>
Subject: [PATCH] mkfs: fix crash when initializing rbmip
From: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>
Date: Fri, 26 Feb 2016 11:34:56 -0800
Cc: Dave Chinner <david@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
User-agent: Mutt/1.5.21 (2010-09-15)
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@xxxxxxxxxx>
---
 mkfs/proto.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mkfs/proto.c b/mkfs/proto.c
index 933924e..d99e965 100644
--- a/mkfs/proto.c
+++ b/mkfs/proto.c
@@ -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;

<Prev in Thread] Current Thread [Next in Thread>