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>
This commit is contained in:
parent
d75afeb3d3
commit
61fe135c1d
14 changed files with 134 additions and 106 deletions
|
@ -306,7 +306,7 @@ xfs_dir3_data_read(
|
|||
err = xfs_da_read_buf(tp, dp, bno, mapped_bno, bpp,
|
||||
XFS_DATA_FORK, &xfs_dir3_data_buf_ops);
|
||||
if (!err && tp)
|
||||
xfs_trans_buf_set_type(tp, *bpp, XFS_BLF_DIR_DATA_BUF);
|
||||
xfs_trans_buf_set_type(tp, *bpp, XFS_BLFT_DIR_DATA_BUF);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -576,7 +576,7 @@ xfs_dir3_data_init(
|
|||
if (error)
|
||||
return error;
|
||||
bp->b_ops = &xfs_dir3_data_buf_ops;
|
||||
xfs_trans_buf_set_type(tp, bp, XFS_BLF_DIR_DATA_BUF);
|
||||
xfs_trans_buf_set_type(tp, bp, XFS_BLFT_DIR_DATA_BUF);
|
||||
|
||||
/*
|
||||
* Initialize the header.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue