diff options
author | Eric Sandeen <sandeen@sandeen.net> | 2017-01-09 10:38:48 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-01-12 05:39:42 -0500 |
commit | bdbfd4ee6bc7aa37062f0222a143b3c3fee7282e (patch) | |
tree | 54ad78a694c1c8c6a140449c57c15cebf3d64bff /fs | |
parent | 06ac11df915d5d607780b86fa7d98f1ab57dab16 (diff) |
xfs: Move AGI buffer type setting to xfs_read_agi
commit 200237d6746faaeaf7f4ff4abbf13f3917cee60a upstream.
We've missed properly setting the buffer type for
an AGI transaction in 3 spots now, so just move it
into xfs_read_agi() and set it if we are in a transaction
to avoid the problem in the future.
This is similar to how it is done in i.e. the dir3
and attr3 read functions.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/xfs/libxfs/xfs_ialloc.c | 4 | ||||
-rw-r--r-- | fs/xfs/xfs_inode.c | 2 | ||||
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 1 |
3 files changed, 2 insertions, 5 deletions
diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c index 51b4e0de1fdc..c482b9716347 100644 --- a/fs/xfs/libxfs/xfs_ialloc.c +++ b/fs/xfs/libxfs/xfs_ialloc.c | |||
@@ -2450,8 +2450,6 @@ xfs_ialloc_log_agi( | |||
2450 | ASSERT(agi->agi_magicnum == cpu_to_be32(XFS_AGI_MAGIC)); | 2450 | ASSERT(agi->agi_magicnum == cpu_to_be32(XFS_AGI_MAGIC)); |
2451 | #endif | 2451 | #endif |
2452 | 2452 | ||
2453 | xfs_trans_buf_set_type(tp, bp, XFS_BLFT_AGI_BUF); | ||
2454 | |||
2455 | /* | 2453 | /* |
2456 | * Compute byte offsets for the first and last fields in the first | 2454 | * Compute byte offsets for the first and last fields in the first |
2457 | * region and log the agi buffer. This only logs up through | 2455 | * region and log the agi buffer. This only logs up through |
@@ -2592,6 +2590,8 @@ xfs_read_agi( | |||
2592 | XFS_FSS_TO_BB(mp, 1), 0, bpp, &xfs_agi_buf_ops); | 2590 | XFS_FSS_TO_BB(mp, 1), 0, bpp, &xfs_agi_buf_ops); |
2593 | if (error) | 2591 | if (error) |
2594 | return error; | 2592 | return error; |
2593 | if (tp) | ||
2594 | xfs_trans_buf_set_type(tp, *bpp, XFS_BLFT_AGI_BUF); | ||
2595 | 2595 | ||
2596 | xfs_buf_set_ref(*bpp, XFS_AGI_REF); | 2596 | xfs_buf_set_ref(*bpp, XFS_AGI_REF); |
2597 | return 0; | 2597 | return 0; |
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 4e560e6a12c1..512ff13ed66a 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c | |||
@@ -2041,7 +2041,6 @@ xfs_iunlink( | |||
2041 | agi->agi_unlinked[bucket_index] = cpu_to_be32(agino); | 2041 | agi->agi_unlinked[bucket_index] = cpu_to_be32(agino); |
2042 | offset = offsetof(xfs_agi_t, agi_unlinked) + | 2042 | offset = offsetof(xfs_agi_t, agi_unlinked) + |
2043 | (sizeof(xfs_agino_t) * bucket_index); | 2043 | (sizeof(xfs_agino_t) * bucket_index); |
2044 | xfs_trans_buf_set_type(tp, agibp, XFS_BLFT_AGI_BUF); | ||
2045 | xfs_trans_log_buf(tp, agibp, offset, | 2044 | xfs_trans_log_buf(tp, agibp, offset, |
2046 | (offset + sizeof(xfs_agino_t) - 1)); | 2045 | (offset + sizeof(xfs_agino_t) - 1)); |
2047 | return 0; | 2046 | return 0; |
@@ -2133,7 +2132,6 @@ xfs_iunlink_remove( | |||
2133 | agi->agi_unlinked[bucket_index] = cpu_to_be32(next_agino); | 2132 | agi->agi_unlinked[bucket_index] = cpu_to_be32(next_agino); |
2134 | offset = offsetof(xfs_agi_t, agi_unlinked) + | 2133 | offset = offsetof(xfs_agi_t, agi_unlinked) + |
2135 | (sizeof(xfs_agino_t) * bucket_index); | 2134 | (sizeof(xfs_agino_t) * bucket_index); |
2136 | xfs_trans_buf_set_type(tp, agibp, XFS_BLFT_AGI_BUF); | ||
2137 | xfs_trans_log_buf(tp, agibp, offset, | 2135 | xfs_trans_log_buf(tp, agibp, offset, |
2138 | (offset + sizeof(xfs_agino_t) - 1)); | 2136 | (offset + sizeof(xfs_agino_t) - 1)); |
2139 | } else { | 2137 | } else { |
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 2d91f5ab7538..9b3d7c76915d 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c | |||
@@ -4929,7 +4929,6 @@ xlog_recover_clear_agi_bucket( | |||
4929 | agi->agi_unlinked[bucket] = cpu_to_be32(NULLAGINO); | 4929 | agi->agi_unlinked[bucket] = cpu_to_be32(NULLAGINO); |
4930 | offset = offsetof(xfs_agi_t, agi_unlinked) + | 4930 | offset = offsetof(xfs_agi_t, agi_unlinked) + |
4931 | (sizeof(xfs_agino_t) * bucket); | 4931 | (sizeof(xfs_agino_t) * bucket); |
4932 | xfs_trans_buf_set_type(tp, agibp, XFS_BLFT_AGI_BUF); | ||
4933 | xfs_trans_log_buf(tp, agibp, offset, | 4932 | xfs_trans_log_buf(tp, agibp, offset, |
4934 | (offset + sizeof(xfs_agino_t) - 1)); | 4933 | (offset + sizeof(xfs_agino_t) - 1)); |
4935 | 4934 | ||