diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2016-11-09 17:13:11 -0500 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2016-12-10 15:39:45 -0500 |
commit | 3e10b793fc40dfdbe51762e0d084bd6f2c8acaaa (patch) | |
tree | df233a1038dc50358baf2e7dcd6d30bfbaf21ebb /fs/ocfs2 | |
parent | 06a70305812c3973c66824f26223656283c59b27 (diff) |
ocfs2: budget for extent tree splits when adding refcount flag
When we're adding the refcount flag to an extent, we have to budget
enough space to handle a full extent btree split in addition to
whatever modifications have to be made to the refcount btree. We
don't currently do this, with the result that generic/186 crashes
when we need an extent split but not a refcount split because meta_ac
never gets allocated.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/ocfs2')
-rw-r--r-- | fs/ocfs2/refcounttree.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c index 3410eb105b0d..6c98d567ba01 100644 --- a/fs/ocfs2/refcounttree.c +++ b/fs/ocfs2/refcounttree.c | |||
@@ -3692,6 +3692,9 @@ int ocfs2_add_refcount_flag(struct inode *inode, | |||
3692 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 3692 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
3693 | struct ocfs2_alloc_context *meta_ac = NULL; | 3693 | struct ocfs2_alloc_context *meta_ac = NULL; |
3694 | 3694 | ||
3695 | /* We need to be able to handle at least an extent tree split. */ | ||
3696 | ref_blocks = ocfs2_extend_meta_needed(data_et->et_root_el); | ||
3697 | |||
3695 | ret = ocfs2_calc_refcount_meta_credits(inode->i_sb, | 3698 | ret = ocfs2_calc_refcount_meta_credits(inode->i_sb, |
3696 | ref_ci, ref_root_bh, | 3699 | ref_ci, ref_root_bh, |
3697 | p_cluster, num_clusters, | 3700 | p_cluster, num_clusters, |