From patchwork Wed Mar 11 12:40:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 11431597 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0E5AA921 for ; Wed, 11 Mar 2020 12:43:34 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D829B208E4 for ; Wed, 11 Mar 2020 12:43:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GtGR6CAP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D829B208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:51166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jC0hx-0002cN-2C for patchwork-qemu-devel@patchwork.kernel.org; Wed, 11 Mar 2020 08:43:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46856) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jC0fc-0006Ts-Lc for qemu-devel@nongnu.org; Wed, 11 Mar 2020 08:41:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jC0fb-0000Dc-Iu for qemu-devel@nongnu.org; Wed, 11 Mar 2020 08:41:08 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:21562 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jC0fb-0000DS-Fl for qemu-devel@nongnu.org; Wed, 11 Mar 2020 08:41:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1583930467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LYqKUmaJke914092shDhJOwoKcdjeHSS5ptesBdfPMI=; b=GtGR6CAP7NwfQoOVNrkxwvjHzZ0hmmGXHczvICfriXx4ITuCavkKoIZUnZBjFHmVJcoefh F6QQmUK7TsaLM/YbHlVCmKaltacu/kMByDHLYsHZrwUXj3EQ8lo2VvWebdYUa/xGIbxdk3 7tBWoNJIgPVvFDDz8I2TbLL5WIeOAO4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-213-rRoVyL-vM7yTf0u4DTwryA-1; Wed, 11 Mar 2020 08:41:01 -0400 X-MC-Unique: rRoVyL-vM7yTf0u4DTwryA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EB6788010E3; Wed, 11 Mar 2020 12:40:59 +0000 (UTC) Received: from localhost (unknown [10.36.118.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AF105C28E; Wed, 11 Mar 2020 12:40:56 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL 2/9] aio-posix: remove confusing QLIST_SAFE_REMOVE() Date: Wed, 11 Mar 2020 12:40:38 +0000 Message-Id: <20200311124045.277969-3-stefanha@redhat.com> In-Reply-To: <20200311124045.277969-1-stefanha@redhat.com> References: <20200311124045.277969-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Peter Maydell , qemu-block@nongnu.org, Max Reitz , Stefan Hajnoczi , Paolo Bonzini , Kevin Wolf Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" QLIST_SAFE_REMOVE() is confusing here because the node must be on the list. We actually just wanted to clear the linked list pointers when removing it from the list. QLIST_REMOVE() now does this, so switch to it. Suggested-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi Link: https://lore.kernel.org/r/20200224103406.1894923-3-stefanha@redhat.com Message-Id: <20200224103406.1894923-3-stefanha@redhat.com> --- util/aio-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/aio-posix.c b/util/aio-posix.c index 9e1befc0c0..b339aab12c 100644 --- a/util/aio-posix.c +++ b/util/aio-posix.c @@ -493,7 +493,7 @@ static bool aio_dispatch_ready_handlers(AioContext *ctx, AioHandler *node; while ((node = QLIST_FIRST(ready_list))) { - QLIST_SAFE_REMOVE(node, node_ready); + QLIST_REMOVE(node, node_ready); progress = aio_dispatch_handler(ctx, node) || progress; }