summaryrefslogtreecommitdiffstats
path: root/fs/gfs2
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2019-08-22 18:07:09 +0200
committerAndreas Gruenbacher <agruenba@redhat.com>2019-09-03 09:42:41 +0200
commit8f0daef5f797c13d7f9bd248190933932b14df36 (patch)
tree77fb3ac352e1899d07a6b8746fefccbcafeaadf3 /fs/gfs2
parent98fb057487a806303f93db3e0f746525ea487c59 (diff)
downloadlinux-8f0daef5f797c13d7f9bd248190933932b14df36.tar.bz2
gfs2: Fix recovery slot bumping
Get rid of the assumption that the number of slots can at most increase by RECOVER_SIZE_INC (16) in set_recover_size. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/lock_dlm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/gfs2/lock_dlm.c b/fs/gfs2/lock_dlm.c
index 4361804646d8..7c7197343ee2 100644
--- a/fs/gfs2/lock_dlm.c
+++ b/fs/gfs2/lock_dlm.c
@@ -1035,12 +1035,12 @@ static int set_recover_size(struct gfs2_sbd *sdp, struct dlm_slot *slots,
}
old_size = ls->ls_recover_size;
-
- if (old_size >= max_jid + 1)
+ new_size = old_size;
+ while (new_size < max_jid + 1)
+ new_size += RECOVER_SIZE_INC;
+ if (new_size == old_size)
return 0;
- new_size = old_size + RECOVER_SIZE_INC;
-
submit = kcalloc(new_size, sizeof(uint32_t), GFP_NOFS);
result = kcalloc(new_size, sizeof(uint32_t), GFP_NOFS);
if (!submit || !result) {