xfs
[Top] [All Lists]

[PATCH] xfs_bmap_add_extent_delay_real should set br_startoff

To: aelder@xxxxxxx
Subject: [PATCH] xfs_bmap_add_extent_delay_real should set br_startoff
From: Ben Myers <bpm@xxxxxxx>
Date: Wed, 12 Jan 2011 13:42:28 -0600
Cc: xfs@xxxxxxxxxxx
User-agent: StGit/0.15
When filling in the middle of a previous delayed allocation, set
br_startoff of the new delay extent to the right to NULLSTARTBLOCK so that
it is ignored by xfs_bmap_extent_to_btree.  This prevents a forced shutdown
when that in-core extent is converted from delay to real and is found to be
already in the btree.  The value is overwritten below.

SGI-PV: 1013221

Signed-off-by: Ben Myers <bpm@xxxxxxx>
---
 fs/xfs/xfs_bmap.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 4111cd3..cd75c77 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -1040,13 +1040,14 @@ xfs_bmap_add_extent_delay_real(
                 * This case is avoided almost all the time.
                 */
                temp = new->br_startoff - PREV.br_startoff;
+               temp2 = PREV.br_startoff + PREV.br_blockcount - new_endoff;
                trace_xfs_bmap_pre_update(ip, idx, 0, _THIS_IP_);
                xfs_bmbt_set_blockcount(ep, temp);
                r[0] = *new;
                r[1].br_state = PREV.br_state;
-               r[1].br_startblock = 0;
+               r[1].br_startblock = nullstartblock(
+                               (int)xfs_bmap_worst_indlen(ip, temp2));
                r[1].br_startoff = new_endoff;
-               temp2 = PREV.br_startoff + PREV.br_blockcount - new_endoff;
                r[1].br_blockcount = temp2;
                xfs_iext_insert(ip, idx + 1, 2, &r[0], state);
                ip->i_df.if_lastex = idx + 1;

<Prev in Thread] Current Thread [Next in Thread>