diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-06-02 02:05:42 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-06-02 02:05:42 -0400 |
commit | f407a8258610169cd8e975dba7f0b2824562014c (patch) | |
tree | 6c87b2d168a4665411a9e16b9f481599f2db25bc /fs/xfs/libxfs/xfs_bmap.c | |
parent | 960d447b94b22ceba286917056871d1dac8da697 (diff) | |
parent | c46a024ea5eb0165114dbbc8c82c29b7bcf66e71 (diff) |
Merge branch 'linus' into sched/core, to resolve conflict
Conflicts:
arch/sparc/include/asm/topology_64.h
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.c')
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c index aeffeaaac0ec..f1026e86dabc 100644 --- a/fs/xfs/libxfs/xfs_bmap.c +++ b/fs/xfs/libxfs/xfs_bmap.c | |||
@@ -3224,12 +3224,24 @@ xfs_bmap_extsize_align( | |||
3224 | align_alen += temp; | 3224 | align_alen += temp; |
3225 | align_off -= temp; | 3225 | align_off -= temp; |
3226 | } | 3226 | } |
3227 | |||
3228 | /* Same adjustment for the end of the requested area. */ | ||
3229 | temp = (align_alen % extsz); | ||
3230 | if (temp) | ||
3231 | align_alen += extsz - temp; | ||
3232 | |||
3227 | /* | 3233 | /* |
3228 | * Same adjustment for the end of the requested area. | 3234 | * For large extent hint sizes, the aligned extent might be larger than |
3235 | * MAXEXTLEN. In that case, reduce the size by an extsz so that it pulls | ||
3236 | * the length back under MAXEXTLEN. The outer allocation loops handle | ||
3237 | * short allocation just fine, so it is safe to do this. We only want to | ||
3238 | * do it when we are forced to, though, because it means more allocation | ||
3239 | * operations are required. | ||
3229 | */ | 3240 | */ |
3230 | if ((temp = (align_alen % extsz))) { | 3241 | while (align_alen > MAXEXTLEN) |
3231 | align_alen += extsz - temp; | 3242 | align_alen -= extsz; |
3232 | } | 3243 | ASSERT(align_alen <= MAXEXTLEN); |
3244 | |||
3233 | /* | 3245 | /* |
3234 | * If the previous block overlaps with this proposed allocation | 3246 | * If the previous block overlaps with this proposed allocation |
3235 | * then move the start forward without adjusting the length. | 3247 | * then move the start forward without adjusting the length. |
@@ -3318,7 +3330,9 @@ xfs_bmap_extsize_align( | |||
3318 | return -EINVAL; | 3330 | return -EINVAL; |
3319 | } else { | 3331 | } else { |
3320 | ASSERT(orig_off >= align_off); | 3332 | ASSERT(orig_off >= align_off); |
3321 | ASSERT(orig_end <= align_off + align_alen); | 3333 | /* see MAXEXTLEN handling above */ |
3334 | ASSERT(orig_end <= align_off + align_alen || | ||
3335 | align_alen + extsz > MAXEXTLEN); | ||
3322 | } | 3336 | } |
3323 | 3337 | ||
3324 | #ifdef DEBUG | 3338 | #ifdef DEBUG |
@@ -4099,13 +4113,6 @@ xfs_bmapi_reserve_delalloc( | |||
4099 | /* Figure out the extent size, adjust alen */ | 4113 | /* Figure out the extent size, adjust alen */ |
4100 | extsz = xfs_get_extsz_hint(ip); | 4114 | extsz = xfs_get_extsz_hint(ip); |
4101 | if (extsz) { | 4115 | if (extsz) { |
4102 | /* | ||
4103 | * Make sure we don't exceed a single extent length when we | ||
4104 | * align the extent by reducing length we are going to | ||
4105 | * allocate by the maximum amount extent size aligment may | ||
4106 | * require. | ||
4107 | */ | ||
4108 | alen = XFS_FILBLKS_MIN(len, MAXEXTLEN - (2 * extsz - 1)); | ||
4109 | error = xfs_bmap_extsize_align(mp, got, prev, extsz, rt, eof, | 4116 | error = xfs_bmap_extsize_align(mp, got, prev, extsz, rt, eof, |
4110 | 1, 0, &aoff, &alen); | 4117 | 1, 0, &aoff, &alen); |
4111 | ASSERT(!error); | 4118 | ASSERT(!error); |