aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs')
-rw-r--r--fs/xfs/xfs_alloc.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c
index 077c3417a54e..d43813267a80 100644
--- a/fs/xfs/xfs_alloc.c
+++ b/fs/xfs/xfs_alloc.c
@@ -257,16 +257,14 @@ xfs_alloc_fix_len(
257 k = rlen % args->prod; 257 k = rlen % args->prod;
258 if (k == args->mod) 258 if (k == args->mod)
259 return; 259 return;
260 if (k > args->mod) { 260 if (k > args->mod)
261 if ((int)(rlen = rlen - k - args->mod) < (int)args->minlen) 261 rlen = rlen - (k - args->mod);
262 return; 262 else
263 } else { 263 rlen = rlen - args->prod + (args->mod - k);
264 if ((int)(rlen = rlen - args->prod - (args->mod - k)) < 264 if ((int)rlen < (int)args->minlen)
265 (int)args->minlen) 265 return;
266 return; 266 ASSERT(rlen >= args->minlen && rlen <= args->maxlen);
267 } 267 ASSERT(rlen % args->prod == args->mod);
268 ASSERT(rlen >= args->minlen);
269 ASSERT(rlen <= args->maxlen);
270 args->len = rlen; 268 args->len = rlen;
271} 269}
272 270