ocfs2: Init meta_ac properly in ocfs2_create_empty_xattr_block.

You can't store a pointer that you haven't filled in yet and expect it
to work.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>

authored by Tao Ma and committed by Joel Becker b2317968 dfe4d3d6

+4 -6
+4 -6
fs/ocfs2/xattr.c
··· 6528 int indexed) 6529 { 6530 int ret; 6531 - struct ocfs2_alloc_context *meta_ac; 6532 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 6533 - struct ocfs2_xattr_set_ctxt ctxt = { 6534 - .meta_ac = meta_ac, 6535 - }; 6536 6537 - ret = ocfs2_reserve_new_metadata_blocks(osb, 1, &meta_ac); 6538 if (ret < 0) { 6539 mlog_errno(ret); 6540 return ret; ··· 6554 6555 ocfs2_commit_trans(osb, ctxt.handle); 6556 out: 6557 - ocfs2_free_alloc_context(meta_ac); 6558 return ret; 6559 } 6560
··· 6528 int indexed) 6529 { 6530 int ret; 6531 struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); 6532 + struct ocfs2_xattr_set_ctxt ctxt; 6533 6534 + memset(&ctxt, 0, sizeof(ctxt)); 6535 + ret = ocfs2_reserve_new_metadata_blocks(osb, 1, &ctxt.meta_ac); 6536 if (ret < 0) { 6537 mlog_errno(ret); 6538 return ret; ··· 6556 6557 ocfs2_commit_trans(osb, ctxt.handle); 6558 out: 6559 + ocfs2_free_alloc_context(ctxt.meta_ac); 6560 return ret; 6561 } 6562