From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65C0A36B07A for ; Fri, 27 Feb 2026 18:12:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772215937; cv=none; b=dzIHQj5zVKquRyvBo8o6e0XHl2IqEJMocHstv0RGuBukC98vimCUeWznQ5myXV9SJoRbIoXvKGkdiT/ih932phwaDWRdUDj1DhqoIwyFYAlrzKSLY/VopgztTfuoONrXxkitw0HKZ4u7HGXj3pFXYCOrY1sBvG/Te8t0jjeLknY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772215937; c=relaxed/simple; bh=LhWoa3Gc15gL8xOlC3I0r2uKc6Y2oNYr1JgGUU8tc8Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bMUiNlgeYbw9LjlEQx7a+9DnOty5Q7sDTswDZKNLzx7NEgu5Y/Gt+LMMLTwT3WWpToNdwBrht0m2VwNbXBe+tOtyCCWWL+9kPo8BZRcOTkLR1azzGoxT3JCSdXN+VuyaFgVvqRQlLuCgza4E/P9yhasnQR26KMnwqWRWOprJ5Xc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=RjbF8lMa; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RjbF8lMa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772215934; 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=iG5lt5XxO/hh9xVt2TbhtRpf4Oxa4xmbAazMvGovJ3Q=; b=RjbF8lMa8n94H/BDMb8TggXCXu6hWrAALdBmZt1KSnFVGi2pFjzOuXYkBOfMs7g2M0Ls2W k+lN8EwhIUVc26xw9MZxV0W4/4JB6kEqEOr4HdRnqAChW24/IDptYSSkRVSV1Di1H0cudz 1asQh29ah0D+I/3CIEwRC2zFBH9/p80= Received: from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-562-omPVtsOgMy-QsqCfcc6GHw-1; Fri, 27 Feb 2026 13:12:09 -0500 X-MC-Unique: omPVtsOgMy-QsqCfcc6GHw-1 X-Mimecast-MFC-AGG-ID: omPVtsOgMy-QsqCfcc6GHw_1772215927 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id EFC28180025E; Fri, 27 Feb 2026 18:12:05 +0000 (UTC) Received: from bmarzins-01.fast.eng.rdu2.dc.redhat.com (unknown [10.6.23.247]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 3FC081800286; Fri, 27 Feb 2026 18:12:04 +0000 (UTC) Received: from bmarzins-01.fast.eng.rdu2.dc.redhat.com (localhost [127.0.0.1]) by bmarzins-01.fast.eng.rdu2.dc.redhat.com (8.18.1/8.17.1) with ESMTPS id 61RIC3Le1740709 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 27 Feb 2026 13:12:03 -0500 Received: (from bmarzins@localhost) by bmarzins-01.fast.eng.rdu2.dc.redhat.com (8.18.1/8.18.1/Submit) id 61RIC2001740708; Fri, 27 Feb 2026 13:12:02 -0500 Date: Fri, 27 Feb 2026 13:12:02 -0500 From: Benjamin Marzinski To: Keith Busch Cc: John Garry , hch@lst.de, sagi@grimberg.me, axboe@fb.com, martin.petersen@oracle.com, james.bottomley@hansenpartnership.com, hare@suse.com, jmeneghi@redhat.com, linux-nvme@lists.infradead.org, linux-scsi@vger.kernel.org, michael.christie@oracle.com, snitzer@kernel.org, dm-devel@lists.linux.dev, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 09/13] libmultipath: Add PR support Message-ID: References: <20260225153225.1031169-1-john.g.garry@oracle.com> <20260225153225.1031169-10-john.g.garry@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 On Wed, Feb 25, 2026 at 08:49:00AM -0700, Keith Busch wrote: > On Wed, Feb 25, 2026 at 03:32:21PM +0000, John Garry wrote: > > +static int mpath_pr_register(struct block_device *bdev, u64 old_key, > > + u64 new_key, unsigned int flags) > > +{ > > + struct mpath_disk *mpath_disk = dev_get_drvdata(&bdev->bd_device); > > + struct mpath_head *mpath_head = mpath_disk->mpath_head; > > + struct mpath_device *mpath_device; > > + int srcu_idx, ret = -EWOULDBLOCK; > > + > > + srcu_idx = srcu_read_lock(&mpath_head->srcu); > > + mpath_device = mpath_find_path(mpath_head); > > + if (mpath_device) > > + ret = mpath_head->mpdt->pr_ops->pr_register(mpath_device, > > + old_key, new_key, flags); > > + srcu_read_unlock(&mpath_head->srcu, srcu_idx); > > Instead of having the lower layer define new mp template functions, why > not use the existing pr_ops from mpath_device->disk->fops->pr_ops? I don't think that's the right answer. The regular scsi persistent reservation functions simply won't work on a multipath device. Even just a simple reservation fails. For example (with /dev/sda being multipath device 0): # echo round-robin > /sys/class/scsi_mpath_device/0/iopolicy # blkpr -c register -k 0x1 /dev/sda # blkpr -c reserve -k 0x1 -t exclusive-access-reg-only /dev/sda # dd if=/dev/sda of=/dev/null iflag=direct count=100 dd: error reading '/dev/sda': Invalid exchange 1+0 records in 1+0 records out 512 bytes copied, 0.00871312 s, 58.8 kB/s Here are the kernel messages: [ 3494.660401] sd 7:0:1:0: reservation conflict [ 3494.661802] sd 7:0:1:0: [sda:1] tag#768 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_OK cmd_age=0s [ 3494.664848] sd 7:0:1:0: [sda:1] tag#768 CDB: Read(10) 28 00 00 00 00 01 00 00 01 00 [ 3494.667092] reservation conflict error, dev sda:1, sector 1 op 0x0:(READ) flags 0x2800800 phys_seg 1 prio class 2 If you don't have a multipathed scsi device to try this on, you can run: targetcli <