diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-04-03 01:11:30 -0400 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-04-27 14:01:58 -0400 |
commit | 61fe135c1dde112f483bba01d645debd881b5428 (patch) | |
tree | 6ec57ed9730f555b29b94aeb6983b4ddbebffe51 /fs/xfs/xfs_da_btree.c | |
parent | d75afeb3d302019527331520a2632b6614425b40 (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_da_btree.c')
-rw-r--r-- | fs/xfs/xfs_da_btree.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/xfs/xfs_da_btree.c b/fs/xfs/xfs_da_btree.c index 5aebd9bd44d1..56814e305dea 100644 --- a/fs/xfs/xfs_da_btree.c +++ b/fs/xfs/xfs_da_btree.c | |||
@@ -312,15 +312,15 @@ xfs_da3_node_read( | |||
312 | switch (be16_to_cpu(info->magic)) { | 312 | switch (be16_to_cpu(info->magic)) { |
313 | case XFS_DA3_NODE_MAGIC: | 313 | case XFS_DA3_NODE_MAGIC: |
314 | case XFS_DA_NODE_MAGIC: | 314 | case XFS_DA_NODE_MAGIC: |
315 | type = XFS_BLF_DA_NODE_BUF; | 315 | type = XFS_BLFT_DA_NODE_BUF; |
316 | break; | 316 | break; |
317 | case XFS_ATTR_LEAF_MAGIC: | 317 | case XFS_ATTR_LEAF_MAGIC: |
318 | case XFS_ATTR3_LEAF_MAGIC: | 318 | case XFS_ATTR3_LEAF_MAGIC: |
319 | type = XFS_BLF_ATTR_LEAF_BUF; | 319 | type = XFS_BLFT_ATTR_LEAF_BUF; |
320 | break; | 320 | break; |
321 | case XFS_DIR2_LEAFN_MAGIC: | 321 | case XFS_DIR2_LEAFN_MAGIC: |
322 | case XFS_DIR3_LEAFN_MAGIC: | 322 | case XFS_DIR3_LEAFN_MAGIC: |
323 | type = XFS_BLF_DIR_LEAFN_BUF; | 323 | type = XFS_BLFT_DIR_LEAFN_BUF; |
324 | break; | 324 | break; |
325 | default: | 325 | default: |
326 | type = 0; | 326 | type = 0; |
@@ -361,7 +361,7 @@ xfs_da3_node_create( | |||
361 | if (error) | 361 | if (error) |
362 | return(error); | 362 | return(error); |
363 | bp->b_ops = &xfs_da3_node_buf_ops; | 363 | bp->b_ops = &xfs_da3_node_buf_ops; |
364 | xfs_trans_buf_set_type(tp, bp, XFS_BLF_DA_NODE_BUF); | 364 | xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DA_NODE_BUF); |
365 | node = bp->b_addr; | 365 | node = bp->b_addr; |
366 | 366 | ||
367 | if (xfs_sb_version_hascrc(&mp->m_sb)) { | 367 | if (xfs_sb_version_hascrc(&mp->m_sb)) { |
@@ -597,7 +597,7 @@ xfs_da3_root_split( | |||
597 | * we are about to copy oldroot to bp, so set up the type | 597 | * we are about to copy oldroot to bp, so set up the type |
598 | * of bp while we know exactly what it will be. | 598 | * of bp while we know exactly what it will be. |
599 | */ | 599 | */ |
600 | xfs_trans_buf_set_type(tp, bp, XFS_BLF_DA_NODE_BUF); | 600 | xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DA_NODE_BUF); |
601 | } else { | 601 | } else { |
602 | struct xfs_dir3_icleaf_hdr leafhdr; | 602 | struct xfs_dir3_icleaf_hdr leafhdr; |
603 | struct xfs_dir2_leaf_entry *ents; | 603 | struct xfs_dir2_leaf_entry *ents; |
@@ -615,7 +615,7 @@ xfs_da3_root_split( | |||
615 | * we are about to copy oldroot to bp, so set up the type | 615 | * we are about to copy oldroot to bp, so set up the type |
616 | * of bp while we know exactly what it will be. | 616 | * of bp while we know exactly what it will be. |
617 | */ | 617 | */ |
618 | xfs_trans_buf_set_type(tp, bp, XFS_BLF_DIR_LEAFN_BUF); | 618 | xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DIR_LEAFN_BUF); |
619 | } | 619 | } |
620 | 620 | ||
621 | /* | 621 | /* |