linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Douglas Miller <dougmill@linux.vnet.ibm.com>
To: Maurizio Lombardi <mlombard@redhat.com>, jejb@linux.vnet.ibm.com
Cc: linux-scsi@vger.kernel.org
Subject: Re: [RFC] enclosure: fix sysfs symlinks creation when using multipath
Date: Fri, 16 Jun 2017 07:53:20 -0500	[thread overview]
Message-ID: <81c9d059-3f2c-4942-ff8d-657cb64bf792@linux.vnet.ibm.com> (raw)
In-Reply-To: <f2ee7996-dd08-6716-f7fd-43ea94086876@redhat.com>

On 06/16/2017 07:48 AM, Maurizio Lombardi wrote:
>
> Dne 16.6.2017 v 14:40 Douglas Miller napsal(a):
>> I'd like to add that we are seeing this problem with singlepath installations and need to get this fixed upstream as soon as possible. RHEL new product contains this fix and is working for us, but we need to be able to offer other distros as well. I am currently running this patch on a custom-built Ubuntu 16.04.2 kernel and it is fixing the problem there.
>>
>> What needs to be done to get this patch accepted?
>>
> Note that James proposed a different patch to fix this bug.
>
> diff --git a/drivers/misc/enclosure.c b/drivers/misc/enclosure.c
> index 65fed71..ae89082 100644
> --- a/drivers/misc/enclosure.c
> +++ b/drivers/misc/enclosure.c
> @@ -375,6 +375,7 @@ int enclosure_add_device(struct enclosure_device *edev, int component,
>   			 struct device *dev)
>   {
>   	struct enclosure_component *cdev;
> +	int err;
>
>   	if (!edev || component >= edev->components)
>   		return -EINVAL;
> @@ -384,12 +385,15 @@ int enclosure_add_device(struct enclosure_device *edev, int component,
>   	if (cdev->dev == dev)
>   		return -EEXIST;
>
> -	if (cdev->dev)
> +	if (cdev->dev) {
>   		enclosure_remove_links(cdev);
> -
> -	put_device(cdev->dev);
> -	cdev->dev = get_device(dev);
> -	return enclosure_add_links(cdev);
> +		put_device(cdev->dev);
> +		cdev->dev = NULL;
> +	}
> +	err = enclosure_add_links(cdev);
> +	if (!err)
> +		cdev->dev = get_device(dev);
> +	return err;
>   }
>   EXPORT_SYMBOL_GPL(enclosure_add_device);
>
>
I will test this out. Thanks.

      reply	other threads:[~2017-06-16 12:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 14:08 [PATCH RFC] enclosure: fix symlinks creation Maurizio Lombardi
2017-02-07 14:08 ` [PATCH RFC] enclosure: fix sysfs symlinks creation when using multipath Maurizio Lombardi
2017-02-16 13:13   ` Maurizio Lombardi
2017-06-16 12:40   ` [RFC] " Douglas Miller
2017-06-16 12:48     ` Maurizio Lombardi
2017-06-16 12:53       ` Douglas Miller [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81c9d059-3f2c-4942-ff8d-657cb64bf792@linux.vnet.ibm.com \
    --to=dougmill@linux.vnet.ibm.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mlombard@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).