diff options
author | Tao Ma <tao.ma@oracle.com> | 2010-03-19 03:04:24 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-03-19 17:53:52 -0400 |
commit | b23179681c90a55e2a2083e1dde9f727ecffb2b7 (patch) | |
tree | 262a3a1f4e7780fbcea841ca9ffc3d5ac0481cd5 /fs | |
parent | dfe4d3d6a6f707fff1dbfd4b8fce65e64a91b809 (diff) |
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/xattr.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 82c2a0b53eb4..3e7773089b96 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -6528,13 +6528,11 @@ static int ocfs2_create_empty_xattr_block(struct inode *inode, | |||
6528 | int indexed) | 6528 | int indexed) |
6529 | { | 6529 | { |
6530 | int ret; | 6530 | int ret; |
6531 | struct ocfs2_alloc_context *meta_ac; | ||
6532 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 6531 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
6533 | struct ocfs2_xattr_set_ctxt ctxt = { | 6532 | struct ocfs2_xattr_set_ctxt ctxt; |
6534 | .meta_ac = meta_ac, | ||
6535 | }; | ||
6536 | 6533 | ||
6537 | ret = ocfs2_reserve_new_metadata_blocks(osb, 1, &meta_ac); | 6534 | memset(&ctxt, 0, sizeof(ctxt)); |
6535 | ret = ocfs2_reserve_new_metadata_blocks(osb, 1, &ctxt.meta_ac); | ||
6538 | if (ret < 0) { | 6536 | if (ret < 0) { |
6539 | mlog_errno(ret); | 6537 | mlog_errno(ret); |
6540 | return ret; | 6538 | return ret; |
@@ -6556,7 +6554,7 @@ static int ocfs2_create_empty_xattr_block(struct inode *inode, | |||
6556 | 6554 | ||
6557 | ocfs2_commit_trans(osb, ctxt.handle); | 6555 | ocfs2_commit_trans(osb, ctxt.handle); |
6558 | out: | 6556 | out: |
6559 | ocfs2_free_alloc_context(meta_ac); | 6557 | ocfs2_free_alloc_context(ctxt.meta_ac); |
6560 | return ret; | 6558 | return ret; |
6561 | } | 6559 | } |
6562 | 6560 | ||