From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D8E2CECAAA1 for ; Thu, 27 Oct 2022 18:30:37 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oo7dD-0007xj-6Z; Thu, 27 Oct 2022 14:29:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oo7dB-0007xE-Ps for qemu-devel@nongnu.org; Thu, 27 Oct 2022 14:29:29 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oo7d8-0001sz-NL for qemu-devel@nongnu.org; Thu, 27 Oct 2022 14:29:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666895365; 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: in-reply-to:in-reply-to:references:references; bh=jQD+rs/yWeG5wmnCqJYmpb15b6FglGLRnOtoCe48AwM=; b=P7X1FIe5X3TL+Boyoh6qW6qj0bTkae/eamiTs3ZylYhi4E0OXtWcDzZ5s8nse8xXHwF5Hg DY2/uVsJqzOTyTA3NeBbHjRJYbMl0DCHggUZdTH9D3XSBVqAfcIRCiXUAiWp8yQtJqSZ7D VulpZfdCW/Ex1PiWzzOi5IFAZCfqf8A= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-601-3YoYsFwPMxCG9Jb9FfgVgw-1; Thu, 27 Oct 2022 14:29:23 -0400 X-MC-Unique: 3YoYsFwPMxCG9Jb9FfgVgw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3925587B2A1; Thu, 27 Oct 2022 18:29:23 +0000 (UTC) Received: from redhat.com (unknown [10.39.194.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3D84BC15BA8; Thu, 27 Oct 2022 18:29:22 +0000 (UTC) Date: Thu, 27 Oct 2022 20:29:20 +0200 From: Kevin Wolf To: Emanuele Giuseppe Esposito Cc: qemu-block@nongnu.org, Hanna Reitz , qemu-devel@nongnu.org Subject: Re: [PATCH] block/block-backend: blk_set_enable_write_cache is IO_CODE Message-ID: References: <20221027072726.2681500-1-eesposit@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221027072726.2681500-1-eesposit@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Received-SPF: pass client-ip=170.10.129.124; envelope-from=kwolf@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.515, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Qemu-devel" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Am 27.10.2022 um 09:27 hat Emanuele Giuseppe Esposito geschrieben: > blk_set_enable_write_cache() is defined as GLOBAL_STATE_CODE > but can be invoked from iothreads when handling scsi requests. > This triggers an assertion failure: > > 0x00007fd6c3515ce1 in raise () from /lib/x86_64-linux-gnu/libc.so.6 > 0x00007fd6c34ff537 in abort () from /lib/x86_64-linux-gnu/libc.so.6 > 0x00007fd6c34ff40f in ?? () from /lib/x86_64-linux-gnu/libc.so.6 > 0x00007fd6c350e662 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6 > 0x000056149e2cea03 in blk_set_enable_write_cache (wce=true, blk=0x5614a01c27f0) > at ../src/block/block-backend.c:1949 > 0x000056149e2d0a67 in blk_set_enable_write_cache (blk=0x5614a01c27f0, > wce=) at ../src/block/block-backend.c:1951 > 0x000056149dfe9c59 in scsi_disk_apply_mode_select (p=0x7fd6b400c00e "\004", > page=, s=) at ../src/hw/scsi/scsi-disk.c:1520 > mode_select_pages (change=true, len=18, p=0x7fd6b400c00e "\004", r=0x7fd6b4001ff0) > at ../src/hw/scsi/scsi-disk.c:1570 > scsi_disk_emulate_mode_select (inbuf=, r=0x7fd6b4001ff0) at > ../src/hw/scsi/scsi-disk.c:1640 > scsi_disk_emulate_write_data (req=0x7fd6b4001ff0) at ../src/hw/scsi/scsi-disk.c:1934 > 0x000056149e18ff16 in virtio_scsi_handle_cmd_req_submit (req=, > req=, s=0x5614a12f16b0) at ../src/hw/scsi/virtio-scsi.c:719 > virtio_scsi_handle_cmd_vq (vq=0x7fd6bab92140, s=0x5614a12f16b0) at > ../src/hw/scsi/virtio-scsi.c:761 > virtio_scsi_handle_cmd (vq=, vdev=) at > ../src/hw/scsi/virtio-scsi.c:775 > virtio_scsi_handle_cmd (vdev=0x5614a12f16b0, vq=0x7fd6bab92140) at > ../src/hw/scsi/virtio-scsi.c:765 > 0x000056149e1a8aa6 in virtio_queue_notify_vq (vq=0x7fd6bab92140) at > ../src/hw/virtio/virtio.c:2365 > 0x000056149e3ccea5 in aio_dispatch_handler (ctx=ctx@entry=0x5614a01babe0, > node=) at ../src/util/aio-posix.c:369 > 0x000056149e3cd868 in aio_dispatch_ready_handlers (ready_list=0x7fd6c09b2680, > ctx=0x5614a01babe0) at ../src/util/aio-posix.c:399 > aio_poll (ctx=0x5614a01babe0, blocking=blocking@entry=true) at > ../src/util/aio-posix.c:713 > 0x000056149e2a7796 in iothread_run (opaque=opaque@entry=0x56149ffde500) at > ../src/iothread.c:67 > 0x000056149e3d0859 in qemu_thread_start (args=0x7fd6c09b26f0) at > ../src/util/qemu-thread-posix.c:504 > 0x00007fd6c36b9ea7 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0 > 0x00007fd6c35d9aef in clone () from /lib/x86_64-linux-gnu/libc.so.6 > > Changing GLOBAL_STATE_CODE in IO_CODE is allowed, since GSC callers are > allowed to call IO_CODE. > > Resolves: #1272 > > Signed-off-by: Emanuele Giuseppe Esposito Thanks, applied to the block branch. Kevin