aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/localalloc.c
diff options
context:
space:
mode:
authorYounger Liu <younger.liu@huawei.com>2013-09-11 17:19:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:56:31 -0400
commit7e9b79370733945b25c24e09d663b07c3936d10c (patch)
treec9496c12fdaf0e7313c873397f17a9bc9bea4dbb /fs/ocfs2/localalloc.c
parent98ac9125c5afed8c5d2e4c5824988f8ad51814e1 (diff)
ocfs2: ac_bits_wanted should be local_alloc_bits when returns -ENOSPC
There is an issue in reserving and claiming space for localalloc, When localalloc space is not enough, it would claim space from global_bitmap. And if there is not enough free space in global_bitmap, the size of claiming space would set to half of orignal size and retry. The issue is as follows: osb->local_alloc_bits is set to half of orignal size in ocfs2_recalc_la_window(), but ac->ac_bits_wanted is set to osb->local_alloc_default_bits which is not changed. localalloc always reserves and claims local_alloc_default_bits space and returns ENOSPC. So, ac->ac_bits_wanted should be osb->local_alloc_bits which would be changed. Signed-off-by: Younger Liu <younger.liu@huawei.com> Cc: Joel Becker <jlbec@evilplan.org> Cc: Mark Fasheh <mfasheh@suse.com> Cc: Jeff Liu <jeff.liu@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ocfs2/localalloc.c')
-rw-r--r--fs/ocfs2/localalloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c
index aebeacd807c3..cd5496b7a0a3 100644
--- a/fs/ocfs2/localalloc.c
+++ b/fs/ocfs2/localalloc.c
@@ -1082,7 +1082,7 @@ static int ocfs2_local_alloc_reserve_for_window(struct ocfs2_super *osb,
1082 } 1082 }
1083 1083
1084retry_enospc: 1084retry_enospc:
1085 (*ac)->ac_bits_wanted = osb->local_alloc_default_bits; 1085 (*ac)->ac_bits_wanted = osb->local_alloc_bits;
1086 status = ocfs2_reserve_cluster_bitmap_bits(osb, *ac); 1086 status = ocfs2_reserve_cluster_bitmap_bits(osb, *ac);
1087 if (status == -ENOSPC) { 1087 if (status == -ENOSPC) {
1088 if (ocfs2_recalc_la_window(osb, OCFS2_LA_EVENT_ENOSPC) == 1088 if (ocfs2_recalc_la_window(osb, OCFS2_LA_EVENT_ENOSPC) ==
@@ -1154,7 +1154,7 @@ retry_enospc:
1154 OCFS2_LA_DISABLED) 1154 OCFS2_LA_DISABLED)
1155 goto bail; 1155 goto bail;
1156 1156
1157 ac->ac_bits_wanted = osb->local_alloc_default_bits; 1157 ac->ac_bits_wanted = osb->local_alloc_bits;
1158 status = ocfs2_claim_clusters(handle, ac, 1158 status = ocfs2_claim_clusters(handle, ac,
1159 osb->local_alloc_bits, 1159 osb->local_alloc_bits,
1160 &cluster_off, 1160 &cluster_off,