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_alloc.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_alloc.c')
-rw-r--r-- | fs/xfs/xfs_alloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c index 40d3d576f473..5673bcfda2f0 100644 --- a/fs/xfs/xfs_alloc.c +++ b/fs/xfs/xfs_alloc.c | |||
@@ -2099,7 +2099,7 @@ xfs_alloc_log_agf( | |||
2099 | 2099 | ||
2100 | trace_xfs_agf(tp->t_mountp, XFS_BUF_TO_AGF(bp), fields, _RET_IP_); | 2100 | trace_xfs_agf(tp->t_mountp, XFS_BUF_TO_AGF(bp), fields, _RET_IP_); |
2101 | 2101 | ||
2102 | xfs_trans_buf_set_type(tp, bp, XFS_BLF_AGF_BUF); | 2102 | xfs_trans_buf_set_type(tp, bp, XFS_BLFT_AGF_BUF); |
2103 | 2103 | ||
2104 | xfs_btree_offsets(fields, offsets, XFS_AGF_NUM_BITS, &first, &last); | 2104 | xfs_btree_offsets(fields, offsets, XFS_AGF_NUM_BITS, &first, &last); |
2105 | xfs_trans_log_buf(tp, bp, (uint)first, (uint)last); | 2105 | xfs_trans_log_buf(tp, bp, (uint)first, (uint)last); |
@@ -2179,7 +2179,7 @@ xfs_alloc_put_freelist( | |||
2179 | 2179 | ||
2180 | xfs_alloc_log_agf(tp, agbp, logflags); | 2180 | xfs_alloc_log_agf(tp, agbp, logflags); |
2181 | 2181 | ||
2182 | xfs_trans_buf_set_type(tp, agflbp, XFS_BLF_AGFL_BUF); | 2182 | xfs_trans_buf_set_type(tp, agflbp, XFS_BLFT_AGFL_BUF); |
2183 | xfs_trans_log_buf(tp, agflbp, startoff, | 2183 | xfs_trans_log_buf(tp, agflbp, startoff, |
2184 | startoff + sizeof(xfs_agblock_t) - 1); | 2184 | startoff + sizeof(xfs_agblock_t) - 1); |
2185 | return 0; | 2185 | return 0; |