dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* Re: dm-mpath: Handling SCSI-3 PR RELEASE in multi-controller environment
@ 2016-10-09 13:12 wangyibin
  2016-10-09 15:16 ` Christoph Hellwig
  0 siblings, 1 reply; 11+ messages in thread
From: wangyibin @ 2016-10-09 13:12 UTC (permalink / raw)
  To: Christoph Hellwig, Jiangyiwen; +Cc: dm-devel@redhat.com, Mike Snitzer

Hello Christoph,

There are several issues with current PR implementation:

1. Improper dm_pr_ops implementation.
The dm_pr_ops functions, except register/unregister, all result in
infinite loop by recursively calling themselves, which will definitely cause
stack overflow. In fact, they should be implemented the same way as
register/unregister by calling iterate_devices().

2. Multipath device iteration policy is needed.
Iteration policy should be added to multipath for PR operations.
	- For unregister, we should iterate on all devices.
	- For regisetr, we should stop iteration on failure, and followed by a
	 non-stopping unregister operation.
	- For reserve/query/preempt/clear, we should return success once an
	 iteration returns successfully.
	- For release, we should stop iteraton on failure.

3. Lack of query function.
Sometimes we need to query the reservation key or registered keys.

4. Lack of kernel space API.
Currently there's only API for ioctl, which is meant to be called by user space
utils. I know we can still call them anyway in kernel space via the help of
{set,get}_fs(), but it looks ugly and unnatrual in every aspect.

5. Support for multiple targets devices.
An md device might have multiple targets. Current implementation only supports
single target device.

Please comment on the issues I have written above. We have cooked some patches
for evaluation purposes. And if anyone is interested in the patches, we can post 
them in the mailing list for review.

Thanks,
	Yibin

On Sep 27, 2016 at 00:03, Christoph Hellwig Wrote:
>On Thu, Sep 22, 2016 at 04:14:50PM +0800, jiangyiwen wrote:
>> I briefly reviewed the PR API. If I understand correctly, a bunch of 
>> PR dedicated operations (pr_ops) are defined in 
>> block_device_operations, which includes register, reserve, release, 
>> preempt and clear operations. But among these operations, only 
>> register() calls dm_call_pr(), which in turns iterates over the device for each path and does the registeration.
>
>Register and unregister in fact, but they both multiple throught the same method.
>
>> My point is, we also need to do this in release operation, so that we 
>> can eliminate the possibility of trying to release the reservation on 
>> the wrong controller and get a fake success.
>
>dm_grab_bdev_for_ioctl ensures that we have a working path.  At least that's the theory and my testing confirms it.  If you know a case where the release doesn't work using this path we'll need to fix.

^ permalink raw reply	[flat|nested] 11+ messages in thread
* dm-mpath: Handling SCSI-3 PR RELEASE in multi-controller environment
@ 2016-09-21  9:14 jiangyiwen
  2016-09-21 15:04 ` Mike Snitzer
  0 siblings, 1 reply; 11+ messages in thread
From: jiangyiwen @ 2016-09-21  9:14 UTC (permalink / raw)
  To: dm-devel; +Cc: wangyibin, Mike Snitzer

Hi guys,

I'm sorry if someone else has already asked the same question before, but
here's what we are facing with generic multipath.

We were evaluating SCSI-3 PR and hit the following issue:

Our IPSAN has two controllers (C1/C2). Our host is connected to both
controllers. So we have 2 I_T nexus. The same key is registered on each I_T
nexus. When we issue SCSI-3 PR RESERE through generic multipath, the
reservation will be placed on one of the controllers (say, C1). Now if we
issue SCSI-3 PR RELEASE, generic multipath will select _only_ one of its
paths based on user defined path selection policy. The problem is that, if
the selected path leads to controller C2, which does not hold the
reservation, the reservation won't be released - and what's more, since the
reservation is done by the same host, the RELEASE command returns
successfully. So this gives us the illusion that the reservation is released
but in fact it is still there.

I know that there's a user space tool mpathpersist that can handle this
problem by issuing release command on all available paths, but here I am
talking about doing same thing in kernel space. So my question is, is there
anyone who is working on supporting SCSI-3 PR in a multiple controller
environment?

Please advise. Thanks in advance!

Best regards,
Yiwen

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-10-14 14:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-09 13:12 dm-mpath: Handling SCSI-3 PR RELEASE in multi-controller environment wangyibin
2016-10-09 15:16 ` Christoph Hellwig
2016-10-13  9:19   ` Yibin Wang
2016-10-13 11:16     ` Yibin Wang
2016-10-14 13:48       ` Christoph Hellwig
2016-10-14 14:51     ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2016-09-21  9:14 jiangyiwen
2016-09-21 15:04 ` Mike Snitzer
2016-09-21 17:14   ` Christoph Hellwig
2016-09-22  8:14   ` jiangyiwen
2016-09-26 16:03     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).