Skip to content

Commit 09f7680

Browse files
Long Licmaiolino
authored andcommitted
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 <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent adcaff3 commit 09f7680

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

fs/xfs/xfs_attr_inactive.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,6 @@ xfs_attr3_root_inactive(
305305
XFS_FSB_TO_BB(mp, mp->m_attr_geo->fsbcount), 0, &bp);
306306
if (error)
307307
return error;
308-
error = bp->b_error;
309-
if (error) {
310-
xfs_trans_brelse(*trans, bp);
311-
return error;
312-
}
313308
xfs_trans_binval(*trans, bp); /* remove from cache */
314309
/*
315310
* Commit the invalidate and start the next transaction.

0 commit comments

Comments
 (0)