aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir2_node.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2013-04-03 01:11:30 -0400
committerBen Myers <bpm@sgi.com>2013-04-27 14:01:58 -0400
commit61fe135c1dde112f483bba01d645debd881b5428 (patch)
tree6ec57ed9730f555b29b94aeb6983b4ddbebffe51 /fs/xfs/xfs_dir2_node.c
parentd75afeb3d302019527331520a2632b6614425b40 (diff)
xfs: buffer type overruns blf_flags field
The buffer type passed to log recvoery in the buffer log item overruns the blf_flags field. I had assumed that flags field was a 32 bit value, and it turns out it is a unisgned short. Therefore having 19 flags doesn't really work. Convert the buffer type field to numeric value, and use the top 5 bits of the flags field for it. We currently have 17 types of buffers, so using 5 bits gives us plenty of room for expansion in future.... Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Ben Myers <bpm@sgi.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir2_node.c')
-rw-r--r--fs/xfs/xfs_dir2_node.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/xfs/xfs_dir2_node.c b/fs/xfs/xfs_dir2_node.c
index 1806a22d5593..ecc6c661064c 100644
--- a/fs/xfs/xfs_dir2_node.c
+++ b/fs/xfs/xfs_dir2_node.c
@@ -168,7 +168,7 @@ __xfs_dir3_free_read(
168 168
169 /* try read returns without an error or *bpp if it lands in a hole */ 169 /* try read returns without an error or *bpp if it lands in a hole */
170 if (!err && tp && *bpp) 170 if (!err && tp && *bpp)
171 xfs_trans_buf_set_type(tp, *bpp, XFS_BLF_DIR_FREE_BUF); 171 xfs_trans_buf_set_type(tp, *bpp, XFS_BLFT_DIR_FREE_BUF);
172 return err; 172 return err;
173} 173}
174 174
@@ -256,7 +256,7 @@ xfs_dir3_free_get_buf(
256 if (error) 256 if (error)
257 return error; 257 return error;
258 258
259 xfs_trans_buf_set_type(tp, bp, XFS_BLF_DIR_FREE_BUF); 259 xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DIR_FREE_BUF);
260 bp->b_ops = &xfs_dir3_free_buf_ops; 260 bp->b_ops = &xfs_dir3_free_buf_ops;
261 261
262 /* 262 /*
@@ -404,7 +404,7 @@ xfs_dir2_leaf_to_node(
404 else 404 else
405 leaf->hdr.info.magic = cpu_to_be16(XFS_DIR3_LEAFN_MAGIC); 405 leaf->hdr.info.magic = cpu_to_be16(XFS_DIR3_LEAFN_MAGIC);
406 lbp->b_ops = &xfs_dir3_leafn_buf_ops; 406 lbp->b_ops = &xfs_dir3_leafn_buf_ops;
407 xfs_trans_buf_set_type(tp, lbp, XFS_BLF_DIR_LEAFN_BUF); 407 xfs_trans_buf_set_type(tp, lbp, XFS_BLFT_DIR_LEAFN_BUF);
408 xfs_dir3_leaf_log_header(tp, lbp); 408 xfs_dir3_leaf_log_header(tp, lbp);
409 xfs_dir3_leaf_check(mp, lbp); 409 xfs_dir3_leaf_check(mp, lbp);
410 return 0; 410 return 0;
@@ -820,7 +820,7 @@ xfs_dir2_leafn_lookup_for_entry(
820 (char *)curbp->b_addr); 820 (char *)curbp->b_addr);
821 state->extrablk.magic = XFS_DIR2_DATA_MAGIC; 821 state->extrablk.magic = XFS_DIR2_DATA_MAGIC;
822 curbp->b_ops = &xfs_dir3_data_buf_ops; 822 curbp->b_ops = &xfs_dir3_data_buf_ops;
823 xfs_trans_buf_set_type(tp, curbp, XFS_BLF_DIR_DATA_BUF); 823 xfs_trans_buf_set_type(tp, curbp, XFS_BLFT_DIR_DATA_BUF);
824 if (cmp == XFS_CMP_EXACT) 824 if (cmp == XFS_CMP_EXACT)
825 return XFS_ERROR(EEXIST); 825 return XFS_ERROR(EEXIST);
826 } 826 }
@@ -835,7 +835,7 @@ xfs_dir2_leafn_lookup_for_entry(
835 state->extrablk.blkno = curdb; 835 state->extrablk.blkno = curdb;
836 state->extrablk.magic = XFS_DIR2_DATA_MAGIC; 836 state->extrablk.magic = XFS_DIR2_DATA_MAGIC;
837 curbp->b_ops = &xfs_dir3_data_buf_ops; 837 curbp->b_ops = &xfs_dir3_data_buf_ops;
838 xfs_trans_buf_set_type(tp, curbp, XFS_BLF_DIR_DATA_BUF); 838 xfs_trans_buf_set_type(tp, curbp, XFS_BLFT_DIR_DATA_BUF);
839 } else { 839 } else {
840 /* If the curbp is not the CI match block, drop it */ 840 /* If the curbp is not the CI match block, drop it */
841 if (state->extrablk.bp != curbp) 841 if (state->extrablk.bp != curbp)