[{"id":3672378,"web_url":"http://patchwork.ozlabs.org/comment/3672378/","msgid":"<31ba8b4f-972c-4ec5-8366-8e668fef6a64@redhat.com>","list_archive_url":null,"date":"2026-04-01T17:34:40","subject":"Re: [PATCH 3/3] scsi: register again after PREEMPT without\n reservation","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"content":"On 4/1/26 19:19, Stefan Hajnoczi wrote:\n> The SCSI specification says PREEMPT without a reservation removes all\n> registrations with the given key. Try to register again after PREEMPT\n> since our key will have been removed.\n> \n> In practice some SCSI targets keep the calling I_T nexus' registration\n> instead of removing it. Therefore we need to handle both the\n> spec-compliant and the non-compliant behavior.\n> \n> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>\n> ---\n>   hw/scsi/scsi-generic.c | 10 ++++++++++\n>   1 file changed, 10 insertions(+)\n> \n> diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c\n> index 349dea6bdd..5182f9236d 100644\n> --- a/hw/scsi/scsi-generic.c\n> +++ b/hw/scsi/scsi-generic.c\n> @@ -513,6 +513,16 @@ bool scsi_generic_pr_state_preempt(SCSIDevice *s, Error **errp)\n>           if (!scsi_generic_pr_preempt(s, key, resv_type, errp)) {\n>               return false;\n>           }\n> +\n> +        /*\n> +         * Some SCSI targets, like the Linux LIO target, remove our\n> +         * registration when preempting without a reservation (resv_type is 0).\n> +         * Try to register again but ignore the error since a RESERVATION\n> +         * CONFLICT is expected if our registration remained in place.\n> +         */\n> +        if (resv_type == 0) {\n> +            scsi_generic_pr_register(s, key, NULL);\n> +        }\n\nHi Stefan,\n\nI'm replying here for both patch 2 and patch 3.\n\nCan this happen after the previous patch?  (Also it's conflicting to say \n  in patch 2 that LIO rejects PREEMPT, but also in this one that LIO \nunregisters the key).\n\nAnd for patch 2, is a RELEASE needed after issuing PREEMPT with an \nartificial PR_TYPE_WRITE_EXCLUSIVE?\n\nPaolo","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=OKC+UFqE;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmBwl3zwzz1yCp\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 04:36:05 +1100 (AEDT)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w7zSw-0005c1-Aj; Wed, 01 Apr 2026 13:34:54 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <pbonzini@redhat.com>)\n id 1w7zSv-0005bc-D5\n for qemu-devel@nongnu.org; Wed, 01 Apr 2026 13:34:53 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <pbonzini@redhat.com>)\n id 1w7zSr-0003y1-6i\n for qemu-devel@nongnu.org; Wed, 01 Apr 2026 13:34:51 -0400","from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-470-bAzHZf0GNjaeFr2xAEvpKQ-1; Wed,\n 01 Apr 2026 13:34:44 -0400","from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 952671800611; Wed,  1 Apr 2026 17:34:43 +0000 (UTC)","from [10.44.33.85] (unknown [10.44.33.85])\n by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id BBE8119560AB; Wed,  1 Apr 2026 17:34:41 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775064886;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references:autocrypt:autocrypt;\n bh=5rAZyW9wtpyyTmUHhtWy85GtLnx6DUg7sKVV5cKOGKk=;\n b=OKC+UFqEyKTGDntAmAMD/42tLviB8BVTPE4P96M4YZZj/hK7f2I1vwNbnj4ZXLXtO4tcg7\n Ce4OM/VF1QQHcjc4/sIns+rVKRwRdI4IzqdZXsOnVI/+fRYkwqmUiViJ14rEGJ2XRu0vzC\n TIAZ7pHr1OgqOUtftI9Vj9/EQl43/fc=","X-MC-Unique":"bAzHZf0GNjaeFr2xAEvpKQ-1","X-Mimecast-MFC-AGG-ID":"bAzHZf0GNjaeFr2xAEvpKQ_1775064883","Message-ID":"<31ba8b4f-972c-4ec5-8366-8e668fef6a64@redhat.com>","Date":"Wed, 1 Apr 2026 19:34:40 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 3/3] scsi: register again after PREEMPT without\n reservation","To":"Stefan Hajnoczi <stefanha@redhat.com>, qemu-devel@nongnu.org","Cc":"qemu-stable@nongnu.org, qemu-block@nongnu.org, Fam Zheng <fam@euphon.net>","References":"<20260401171927.396672-1-stefanha@redhat.com>\n <20260401171927.396672-4-stefanha@redhat.com>","From":"Paolo Bonzini <pbonzini@redhat.com>","Content-Language":"en-US","Autocrypt":"addr=pbonzini@redhat.com; keydata=\n xsEhBFRCcBIBDqDGsz4K0zZun3jh+U6Z9wNGLKQ0kSFyjN38gMqU1SfP+TUNQepFHb/Gc0E2\n CxXPkIBTvYY+ZPkoTh5xF9oS1jqI8iRLzouzF8yXs3QjQIZ2SfuCxSVwlV65jotcjD2FTN04\n hVopm9llFijNZpVIOGUTqzM4U55sdsCcZUluWM6x4HSOdw5F5Utxfp1wOjD/v92Lrax0hjiX\n DResHSt48q+8FrZzY+AUbkUS+Jm34qjswdrgsC5uxeVcLkBgWLmov2kMaMROT0YmFY6A3m1S\n P/kXmHDXxhe23gKb3dgwxUTpENDBGcfEzrzilWueOeUWiOcWuFOed/C3SyijBx3Av/lbCsHU\n Vx6pMycNTdzU1BuAroB+Y3mNEuW56Yd44jlInzG2UOwt9XjjdKkJZ1g0P9dwptwLEgTEd3Fo\n UdhAQyRXGYO8oROiuh+RZ1lXp6AQ4ZjoyH8WLfTLf5g1EKCTc4C1sy1vQSdzIRu3rBIjAvnC\n tGZADei1IExLqB3uzXKzZ1BZ+Z8hnt2og9hb7H0y8diYfEk2w3R7wEr+Ehk5NQsT2MPI2QBd\n wEv1/Aj1DgUHZAHzG1QN9S8wNWQ6K9DqHZTBnI1hUlkp22zCSHK/6FwUCuYp1zcAEQEAAc0j\n UGFvbG8gQ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jlHjEXoPwpMs0KZsgdU0pP\n JQzMUMwmB1wM8JxovFlPYrhNT9MAEQEAAcLBMwQYAQIACQUCVEJx7gIbDAAKCRB+FRAMzTZp\n sadRDqCctLmYICZu4GSnie4lKXl+HqlLanpVMOoFNnWs9oRP47MbE2wv8OaYh5pNR9VVgyhD\n OG0AU7oidG36OeUlrFDTfnPYYSF/mPCxHttosyt8O5kabxnIPv2URuAxDByz+iVbL+RjKaGM\n GDph56ZTswlx75nZVtIukqzLAQ5fa8OALSGum0cFi4ptZUOhDNz1onz61klD6z3MODi0sBZN\n Aj6guB2L/+2ZwElZEeRBERRd/uommlYuToAXfNRdUwrwl9gRMiA0WSyTb190zneRRDfpSK5d\n usXnM/O+kr3Dm+Ui+UioPf6wgbn3T0o6I5BhVhs4h4hWmIW7iNhPjX1iybXfmb1gAFfjtHfL\n xRUr64svXpyfJMScIQtBAm0ihWPltXkyITA92ngCmPdHa6M1hMh4RDX+Jf1fiWubzp1voAg0\n JBrdmNZSQDz0iKmSrx8xkoXYfA3bgtFN8WJH2xgFL28XnqY4M6dLhJwV3z08tPSRqYFm4NMP\n dRsn0/7oymhneL8RthIvjDDQ5ktUjMe8LtHr70OZE/TT88qvEdhiIVUogHdo4qBrk41+gGQh\n b906Dudw5YhTJFU3nC6bbF2nrLlB4C/XSiH76ZvqzV0Z/cAMBo5NF/w=","In-Reply-To":"<20260401171927.396672-4-stefanha@redhat.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","X-Scanned-By":"MIMEDefang 3.0 on 10.30.177.12","Received-SPF":"pass client-ip=170.10.133.124;\n envelope-from=pbonzini@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-6","X-Spam_score":"-0.7","X-Spam_bar":"/","X-Spam_report":"(-0.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.01,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3672398,"web_url":"http://patchwork.ozlabs.org/comment/3672398/","msgid":"<20260401183057.GA400282@fedora>","list_archive_url":null,"date":"2026-04-01T18:30:57","subject":"Re: [PATCH 3/3] scsi: register again after PREEMPT without\n reservation","submitter":{"id":17227,"url":"http://patchwork.ozlabs.org/api/people/17227/","name":"Stefan Hajnoczi","email":"stefanha@redhat.com"},"content":"On Wed, Apr 01, 2026 at 07:34:40PM +0200, Paolo Bonzini wrote:\n> On 4/1/26 19:19, Stefan Hajnoczi wrote:\n> > The SCSI specification says PREEMPT without a reservation removes all\n> > registrations with the given key. Try to register again after PREEMPT\n> > since our key will have been removed.\n> > \n> > In practice some SCSI targets keep the calling I_T nexus' registration\n> > instead of removing it. Therefore we need to handle both the\n> > spec-compliant and the non-compliant behavior.\n> > \n> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>\n> > ---\n> >   hw/scsi/scsi-generic.c | 10 ++++++++++\n> >   1 file changed, 10 insertions(+)\n> > \n> > diff --git a/hw/scsi/scsi-generic.c b/hw/scsi/scsi-generic.c\n> > index 349dea6bdd..5182f9236d 100644\n> > --- a/hw/scsi/scsi-generic.c\n> > +++ b/hw/scsi/scsi-generic.c\n> > @@ -513,6 +513,16 @@ bool scsi_generic_pr_state_preempt(SCSIDevice *s, Error **errp)\n> >           if (!scsi_generic_pr_preempt(s, key, resv_type, errp)) {\n> >               return false;\n> >           }\n> > +\n> > +        /*\n> > +         * Some SCSI targets, like the Linux LIO target, remove our\n> > +         * registration when preempting without a reservation (resv_type is 0).\n> > +         * Try to register again but ignore the error since a RESERVATION\n> > +         * CONFLICT is expected if our registration remained in place.\n> > +         */\n> > +        if (resv_type == 0) {\n> > +            scsi_generic_pr_register(s, key, NULL);\n> > +        }\n> \n> Hi Stefan,\n> \n> I'm replying here for both patch 2 and patch 3.\n> \n> Can this happen after the previous patch?  (Also it's conflicting to say  in\n> patch 2 that LIO rejects PREEMPT, but also in this one that LIO unregisters\n> the key).\n\nYes. Both patches are needed.\n\nThe first patch gets LIO to process the PREEMPT. Before LIO would just\nfail the command.\n\nBut once LIO processes the PREEMPT, we hit the next problem: PREEMPT\ncompletes but our registration has been removed. So now we need to\nregister again after PREEMPT.\n\n> And for patch 2, is a RELEASE needed after issuing PREEMPT with an\n> artificial PR_TYPE_WRITE_EXCLUSIVE?\n\nNo, because PREEMPT will not acquire a reservation when there is no\nreservation holder with the given key. PREEMPT will only remove\nregistrations in that case.\n\nStefan","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=CCgzCYPx;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmF5h1DbVz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 06:14:00 +1100 (AEDT)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w810Z-0003RK-3t; Wed, 01 Apr 2026 15:13:43 -0400","from [2001:470:142:3::10] (helo=eggs.gnu.org)\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <stefanha@redhat.com>)\n id 1w80Sp-0005sr-9p\n for qemu-devel@nongnu.org; Wed, 01 Apr 2026 14:38:51 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <stefanha@redhat.com>)\n id 1w80LL-00043h-RO\n for qemu-devel@nongnu.org; Wed, 01 Apr 2026 14:31:10 -0400","from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-660-sHOs8MCKMn6QMlAcSrdfXw-1; Wed,\n 01 Apr 2026 14:31:03 -0400","from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 7B4C31955D86; Wed,  1 Apr 2026 18:31:00 +0000 (UTC)","from localhost (unknown [10.44.32.12])\n by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP\n id 520DF1800671; Wed,  1 Apr 2026 18:30:58 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775068266;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=5qPEIJ870NSeuHpii3DCPuBaCM6n8ZznzPXviE/dGVA=;\n b=CCgzCYPx6zcvFBEWWiQfWfpv6M0FKB1mA5CDYZN6hnUWpCdOwOkRc2+7QNid2WwSUgevJ6\n osDol2PYwO6GtIAqm508sFDDYur4EIZaUJ5ZBCt494vHQeKtBzzoAFRihpsein4Q1/Bu1l\n DzxRpf0g/s24HXtHvehAhceXsUaFvBs=","X-MC-Unique":"sHOs8MCKMn6QMlAcSrdfXw-1","X-Mimecast-MFC-AGG-ID":"sHOs8MCKMn6QMlAcSrdfXw_1775068261","Date":"Wed, 1 Apr 2026 14:30:57 -0400","From":"Stefan Hajnoczi <stefanha@redhat.com>","To":"Paolo Bonzini <pbonzini@redhat.com>","Cc":"qemu-devel@nongnu.org, qemu-stable@nongnu.org, qemu-block@nongnu.org,\n Fam Zheng <fam@euphon.net>","Subject":"Re: [PATCH 3/3] scsi: register again after PREEMPT without\n reservation","Message-ID":"<20260401183057.GA400282@fedora>","References":"<20260401171927.396672-1-stefanha@redhat.com>\n <20260401171927.396672-4-stefanha@redhat.com>\n <31ba8b4f-972c-4ec5-8366-8e668fef6a64@redhat.com>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha512;\n protocol=\"application/pgp-signature\"; boundary=\"CNROKYCfByVZmHfY\"","Content-Disposition":"inline","In-Reply-To":"<31ba8b4f-972c-4ec5-8366-8e668fef6a64@redhat.com>","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.93","Received-SPF":"pass client-ip=170.10.133.124;\n envelope-from=stefanha@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"27","X-Spam_score":"2.7","X-Spam_bar":"++","X-Spam_report":"(2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.01, RCVD_IN_SBL_CSS=3.335,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}},{"id":3672654,"web_url":"http://patchwork.ozlabs.org/comment/3672654/","msgid":"<CABgObfbns7H-WB5TkQmCz6UaekfU0qXnCa=BTaLc59rbCpHh8Q@mail.gmail.com>","list_archive_url":null,"date":"2026-04-02T10:39:19","subject":"Re: [PATCH 3/3] scsi: register again after PREEMPT without\n reservation","submitter":{"id":2701,"url":"http://patchwork.ozlabs.org/api/people/2701/","name":"Paolo Bonzini","email":"pbonzini@redhat.com"},"content":"On Wed, Apr 1, 2026 at 8:31 PM Stefan Hajnoczi <stefanha@redhat.com> wrote:\n> The first patch gets LIO to process the PREEMPT. Before LIO would just\n> fail the command.\n>\n> But once LIO processes the PREEMPT, we hit the next problem: PREEMPT\n> completes but our registration has been removed. So now we need to\n> register again after PREEMPT.\n>\n> > And for patch 2, is a RELEASE needed after issuing PREEMPT with an\n> > artificial PR_TYPE_WRITE_EXCLUSIVE?\n>\n> No, because PREEMPT will not acquire a reservation when there is no\n> reservation holder with the given key. PREEMPT will only remove\n> registrations in that case.\n\nThanks for explaining all this. I didn't understand the behavior where\nthe source does not have a reservation. Series\n\nReviewed-by: Paolo Bonzini <pbonzini@redhat.com>\n\nPaolo","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=X2BzbFnM;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=google header.b=lQGekknu;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmdfb0WpNz1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 21:40:21 +1100 (AEDT)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1w8FSg-0000R8-Sx; Thu, 02 Apr 2026 06:39:42 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <pbonzini@redhat.com>)\n id 1w8FSc-0000QE-Mq\n for qemu-devel@nongnu.org; Thu, 02 Apr 2026 06:39:38 -0400","from us-smtp-delivery-124.mimecast.com ([170.10.133.124])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <pbonzini@redhat.com>)\n id 1w8FSa-0006a1-Lz\n for qemu-devel@nongnu.org; Thu, 02 Apr 2026 06:39:38 -0400","from mail-wr1-f71.google.com (mail-wr1-f71.google.com\n [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-644-OhXj3iUXO7Ke0Oadxby1jg-1; Thu, 02 Apr 2026 06:39:33 -0400","by mail-wr1-f71.google.com with SMTP id\n ffacd0b85a97d-43b96365ea8so879638f8f.2\n for <qemu-devel@nongnu.org>; Thu, 02 Apr 2026 03:39:33 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1775126375;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=Hk6ZZHnAo0uqbKllhg44lMNFIKMFWGlDAQfn/0AWrc0=;\n b=X2BzbFnMH36i2F6LU/xkSDh+B+E5A1Jedz9g59DQHLoDLWwRMaV2LhWuOlRKzC5dk/mU6m\n q0b8zvNi4B2g9mvUNIeJH+9Mgh6MB/vIxd2VA+RjCWUFwKR/mUQmG1QYMgg7UeEZmVuUve\n WLbmVHmXCbzQLpE5IMWc5Tjs0OBwmWI=","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=redhat.com; s=google; t=1775126372; x=1775731172; darn=nongnu.org;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:from:to:cc:subject:date\n :message-id:reply-to;\n bh=Hk6ZZHnAo0uqbKllhg44lMNFIKMFWGlDAQfn/0AWrc0=;\n b=lQGekknu87M/irq2NKgGrn5l2s51PrPN0/5MQc1Ci5tlGznKZv/mPo1BG/xTtKk0EE\n lPPJKllMgoMducXaDbCz5O/auN0H2JeS6Fur6ikMmXjyxvdJOBqRreg+VoX1JTNaN+ps\n w7DiVozZ9Sx3DHERrLgaJ1LJVW85cdW6IP96G+wvRw8xHRKJVQjWWFl4xCoMiCUbh5l1\n T93BCVbdSlV0hdM/fUl0dBNYExAbJRdifUs8QonZiUWcAIhYzLJr+8H5l+TrVSl434lr\n yDUAPetDZWQs/Mbo2zPQQyUw9FbtNVil7dqZ6Vld/GEY69NEd3PnMIGAqcNkvijZi8xc\n ftgg=="],"X-MC-Unique":"OhXj3iUXO7Ke0Oadxby1jg-1","X-Mimecast-MFC-AGG-ID":"OhXj3iUXO7Ke0Oadxby1jg_1775126373","ARC-Seal":"i=1; a=rsa-sha256; t=1775126372; cv=none;\n d=google.com; s=arc-20240605;\n b=OCy84DdalXgG4uPpEeZntCgxC4dD8XK7vSVQPykqu1IZYor0qzl1CBm1r/cEc7KRbt\n QgjlNBPapvDeAOktE+G0vrvBgJa+ZOGobPbmirTgN2C9jhuOjfGNtUHDK5yOWrudbEka\n TzsSbQnzdMr66vrSU+CxGI80moTC94RPW+kMtzaUhn8LvDDTHbApAkLb8hqVGi3DHB/b\n d2qhpwaKQhDnRJTQlF7WzW5sQXWQslasRFSTzBfUzfkoSm0NlUxiNGr7CkJqh+xYMe7I\n BQNwsul4RQr5XbsJoBF39BUIy8OhUum0lTztE48YhFEGaP2Iw1OxTJaAcxgPwoY18zqS\n M4jQ==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:dkim-signature;\n bh=Hk6ZZHnAo0uqbKllhg44lMNFIKMFWGlDAQfn/0AWrc0=;\n fh=/8gB++1TZOi33lidPokoUONy3iR2nMIESGop2kgt58Q=;\n b=a1KotlvYHxFHK2t60r04ph/EYdTKnMMvB8ntudSqqW7Mucr4OPSmzVUOMpNAfjlrEW\n v654IVFk8KvGfK5qY93QZiGURI917CZVjezmo1yARDSExXKLRVr4DE4zLB8I5Bxz5QM9\n vZHwOB6gleUf/7gGSeL6ooGp+sxS/cRNYEDoAlPWOerzpq6MnSTmw7F5UzD3yvzfxtzQ\n zVjYgf2Z7/Q6hPeBx5eLZyUTKg14+Gw0iBqfJsbNctxbCXv6HfuUUTZNwYQ7rFR8gCnj\n AzbW5bcc6RVtKQy+NiTZ3W/LurGGiGoERX14zslmOXs27S0ts6hzzhjDl5yFgnOOG+DP\n r9mQ==; darn=nongnu.org","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775126372; x=1775731172;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:re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f8f.22.1775126371662;\n Thu, 02 Apr 2026 03:39:31 -0700 (PDT)","by 2002:a5d:5d13:0:b0:43c:f1da:4880 with SMTP id\n ffacd0b85a97d-43d1f1e3051mr5060947f8f.22.1775126371277; Thu, 02 Apr 2026\n 03:39:31 -0700 (PDT)"],"MIME-Version":"1.0","References":"<20260401171927.396672-1-stefanha@redhat.com>\n <20260401171927.396672-4-stefanha@redhat.com>\n <31ba8b4f-972c-4ec5-8366-8e668fef6a64@redhat.com>\n <20260401183057.GA400282@fedora>","In-Reply-To":"<20260401183057.GA400282@fedora>","From":"Paolo Bonzini <pbonzini@redhat.com>","Date":"Thu, 2 Apr 2026 12:39:19 +0200","X-Gm-Features":"AQROBzCtML1mtQCUHYytVnK-QzSmr3or9RdsALCIzFKgZvoCETy4LxPGoyaoi_I","Message-ID":"\n <CABgObfbns7H-WB5TkQmCz6UaekfU0qXnCa=BTaLc59rbCpHh8Q@mail.gmail.com>","Subject":"Re: [PATCH 3/3] scsi: register again after PREEMPT without\n reservation","To":"Stefan Hajnoczi <stefanha@redhat.com>","Cc":"qemu-devel@nongnu.org, qemu-stable@nongnu.org, qemu-block@nongnu.org,\n Fam Zheng <fam@euphon.net>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","Received-SPF":"pass client-ip=170.10.133.124;\n envelope-from=pbonzini@redhat.com;\n helo=us-smtp-delivery-124.mimecast.com","X-Spam_score_int":"-6","X-Spam_score":"-0.7","X-Spam_bar":"/","X-Spam_report":"(-0.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.54,\n DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,\n RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.01,\n RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=1, RCVD_IN_VALIDITY_RPBL_BLOCKED=1,\n SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"qemu development <qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://lists.nongnu.org/archive/html/qemu-devel>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}}]