diff mbox series

btrfs: remove pointless empty log context list check when syncing log

Message ID f238738e93b197f7125509e5727a8ae93abbac54.1696504114.git.fdmanana@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs: remove pointless empty log context list check when syncing log | expand

Commit Message

Filipe Manana Oct. 5, 2023, 11:11 a.m. UTC
From: Filipe Manana <fdmanana@suse.com>

When syncing the log, if we get an error when updating the log root, we
check first tif he log root tree context is in a log context list, and if
so it deletes from the log root tree context from the list. This check
however is pointless because at this moment the context is always in a
list, he have just added it to a context list. The check became pointless
after commit a93e01682e28 ("btrfs: remove no longer needed use of
log_writers for the log root tree"). So remove this now pointless empty
list check.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/tree-log.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

David Sterba Oct. 6, 2023, 2:31 p.m. UTC | #1
On Thu, Oct 05, 2023 at 12:11:09PM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> When syncing the log, if we get an error when updating the log root, we
> check first tif he log root tree context is in a log context list, and if
> so it deletes from the log root tree context from the list. This check
> however is pointless because at this moment the context is always in a
> list, he have just added it to a context list. The check became pointless
> after commit a93e01682e28 ("btrfs: remove no longer needed use of
> log_writers for the log root tree"). So remove this now pointless empty
> list check.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Added to misc-next, thanks.
diff mbox series

Patch

diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 958bb23d3d99..8b3893c01734 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -2996,9 +2996,7 @@  int btrfs_sync_log(struct btrfs_trans_handle *trans,
 	 */
 	ret = update_log_root(trans, log, &new_root_item);
 	if (ret) {
-		if (!list_empty(&root_log_ctx.list))
-			list_del_init(&root_log_ctx.list);
-
+		list_del_init(&root_log_ctx.list);
 		blk_finish_plug(&plug);
 		btrfs_set_log_full_commit(trans);
 		if (ret != -ENOSPC)