]> www.infradead.org Git - users/hch/xfs.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>
Thu, 9 Jan 2025 09:36:23 +0000 (10:36 +0100)
commitba50dbf7a9e352d0c8a360069d70fdc961adf103
tree2ca33810f8e78a7d26dfb747fa65b1880a2b3c77
parent7beff61f8590cd76ec167696e7d913570194744b
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