Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b31eabd8 authored by Chris Mason's avatar Chris Mason
Browse files

Btrfs: catch errors from btrfs_sync_log



btrfs_sync_log returns -EAGAIN when we need full transaction commits
instead of small log commits, but sometimes we were dropping the return
value.

In practice, we check for this a few different ways, but this is still a
bug that can leave off full log commits when we really need them.

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent b1953bce
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -2051,6 +2051,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
		wait_log_commit(trans, log_root_tree,
		wait_log_commit(trans, log_root_tree,
				log_root_tree->log_transid);
				log_root_tree->log_transid);
		mutex_unlock(&log_root_tree->log_mutex);
		mutex_unlock(&log_root_tree->log_mutex);
		ret = 0;
		goto out;
		goto out;
	}
	}
	atomic_set(&log_root_tree->log_commit[index2], 1);
	atomic_set(&log_root_tree->log_commit[index2], 1);
@@ -2115,7 +2116,7 @@ int btrfs_sync_log(struct btrfs_trans_handle *trans,
	smp_mb();
	smp_mb();
	if (waitqueue_active(&root->log_commit_wait[index1]))
	if (waitqueue_active(&root->log_commit_wait[index1]))
		wake_up(&root->log_commit_wait[index1]);
		wake_up(&root->log_commit_wait[index1]);
	return 0;
	return ret;
}
}


static void free_log_tree(struct btrfs_trans_handle *trans,
static void free_log_tree(struct btrfs_trans_handle *trans,