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_dir2_block.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_dir2_block.c')
-rw-r--r-- | fs/xfs/xfs_dir2_block.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_dir2_block.c b/fs/xfs/xfs_dir2_block.c index 58816ecdbba5..e59f5fc816fe 100644 --- a/fs/xfs/xfs_dir2_block.c +++ b/fs/xfs/xfs_dir2_block.c | |||
@@ -137,7 +137,7 @@ xfs_dir3_block_read( | |||
137 | err = xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, bpp, | 137 | err = xfs_da_read_buf(tp, dp, mp->m_dirdatablk, -1, bpp, |
138 | XFS_DATA_FORK, &xfs_dir3_block_buf_ops); | 138 | XFS_DATA_FORK, &xfs_dir3_block_buf_ops); |
139 | if (!err && tp) | 139 | if (!err && tp) |
140 | xfs_trans_buf_set_type(tp, *bpp, XFS_BLF_DIR_BLOCK_BUF); | 140 | xfs_trans_buf_set_type(tp, *bpp, XFS_BLFT_DIR_BLOCK_BUF); |
141 | return err; | 141 | return err; |
142 | } | 142 | } |
143 | 143 | ||
@@ -151,7 +151,7 @@ xfs_dir3_block_init( | |||
151 | struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr; | 151 | struct xfs_dir3_blk_hdr *hdr3 = bp->b_addr; |
152 | 152 | ||
153 | bp->b_ops = &xfs_dir3_block_buf_ops; | 153 | bp->b_ops = &xfs_dir3_block_buf_ops; |
154 | xfs_trans_buf_set_type(tp, bp, XFS_BLF_DIR_BLOCK_BUF); | 154 | xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DIR_BLOCK_BUF); |
155 | 155 | ||
156 | if (xfs_sb_version_hascrc(&mp->m_sb)) { | 156 | if (xfs_sb_version_hascrc(&mp->m_sb)) { |
157 | memset(hdr3, 0, sizeof(*hdr3)); | 157 | memset(hdr3, 0, sizeof(*hdr3)); |