diff options
| author | Olof Johansson <olof@lixom.net> | 2012-11-25 21:34:34 -0800 | 
|---|---|---|
| committer | Olof Johansson <olof@lixom.net> | 2012-11-25 21:34:34 -0800 | 
| commit | 0f9cb211ba5db93d488fe6b154138231fdd0e22d (patch) | |
| tree | 293871b042e9ebc49b1d783f1b110eef541ddc97 /fs/xfs/xfs_attr_leaf.c | |
| parent | 007108a2279123ad6639b6c653ad1a731febb60f (diff) | |
| parent | 9489e9dcae718d5fde988e4a684a0f55b5f94d17 (diff) | |
| download | olio-linux-3.10-0f9cb211ba5db93d488fe6b154138231fdd0e22d.tar.xz olio-linux-3.10-0f9cb211ba5db93d488fe6b154138231fdd0e22d.zip  | |
Merge tag 'v3.7-rc7' into next/cleanup
Merging in mainline back to next/cleanup since it has collected a few
conflicts between fixes going upstream and some of the cleanup patches.
Git doesn't auto-resolve some of them, and they're mostly noise so let's
take care of it locally.
Conflicts are in:
	arch/arm/mach-omap2/omap_hwmod_44xx_data.c
	arch/arm/plat-omap/i2c.c
	drivers/video/omap2/dss/dss.c
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'fs/xfs/xfs_attr_leaf.c')
| -rw-r--r-- | fs/xfs/xfs_attr_leaf.c | 20 | 
1 files changed, 18 insertions, 2 deletions
diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index d330111ca73..70eec182977 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c @@ -1291,6 +1291,7 @@ xfs_attr_leaf_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1,  	leaf2 = blk2->bp->b_addr;  	ASSERT(leaf1->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC));  	ASSERT(leaf2->hdr.info.magic == cpu_to_be16(XFS_ATTR_LEAF_MAGIC)); +	ASSERT(leaf2->hdr.count == 0);  	args = state->args;  	trace_xfs_attr_leaf_rebalance(args); @@ -1361,6 +1362,7 @@ xfs_attr_leaf_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1,  		 * I assert that since all callers pass in an empty  		 * second buffer, this code should never execute.  		 */ +		ASSERT(0);  		/*  		 * Figure the total bytes to be added to the destination leaf. @@ -1422,10 +1424,24 @@ xfs_attr_leaf_rebalance(xfs_da_state_t *state, xfs_da_state_blk_t *blk1,  			args->index2 = 0;  			args->blkno2 = blk2->blkno;  		} else { +			/* +			 * On a double leaf split, the original attr location +			 * is already stored in blkno2/index2, so don't +			 * overwrite it overwise we corrupt the tree. +			 */  			blk2->index = blk1->index  				    - be16_to_cpu(leaf1->hdr.count); -			args->index = args->index2 = blk2->index; -			args->blkno = args->blkno2 = blk2->blkno; +			args->index = blk2->index; +			args->blkno = blk2->blkno; +			if (!state->extravalid) { +				/* +				 * set the new attr location to match the old +				 * one and let the higher level split code +				 * decide where in the leaf to place it. +				 */ +				args->index2 = blk2->index; +				args->blkno2 = blk2->blkno; +			}  		}  	} else {  		ASSERT(state->inleaf == 1);  |