]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xfs: remove bp->b_error check in xfs_attr3_root_inactive
authorLong Li <leo.lilong@huawei.com>
Mon, 23 Dec 2024 11:45:11 +0000 (19:45 +0800)
committerCarlos Maiolino <cem@kernel.org>
Mon, 13 Jan 2025 13:56:15 +0000 (14:56 +0100)
commit09f7680dea8760d48dd5b8b5288a388fec122275
treecc032567e9a4e907039c691a98ec25dacba57218
parentadcaff355bd8abb9b5097cc72339fb9cbf2eefda
xfs: remove bp->b_error check in xfs_attr3_root_inactive

The b_error check right after xfs_trans_get_buf() is redundant:

1) If the buffer is found in transaction via xfs_trans_buf_item_match(),
   any corrupted metadata error would have already been exposed during
   previous reads like xfs_da3_node_read().

2) If the buffer is obtained via xfs_buf_get_map():
   - It's called without XBF_READ flag, so won't return buffer with
     b_error set, since xfs_buf_get_map() will clear it anyway.
   - Buffer found in cache normally won't have error since previous reads
     had checked it, unless someone corrupts the buffer and the AIL
     pushes it out to disk while the buffer's unlocked. But in this case,
     AIL will shut down the log.

Remove this redundant check to simplify the code, make the code consistent
with most other xfs_trans_get_buf() callers in XFS.

Signed-off-by: Long Li <leo.lilong@huawei.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_attr_inactive.c