All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harald Hoyer <harald@redhat.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: scsi_id - EBUSY and serialization
Date: Wed, 11 Jun 2008 19:35:33 +0000	[thread overview]
Message-ID: <48502905.7000207@redhat.com> (raw)
In-Reply-To: <484FA10E.9010303@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1024 bytes --]

Kay Sievers wrote:
> On Wed, Jun 11, 2008 at 11:55 AM, Harald Hoyer <harald@redhat.com> wrote:
>> We have a customer, who misses some symlinks for some of his scsi devices.
>> Because of limited access and debugging facilities, I could only guess a
>> fix.
>>
>> The first patch retries opening the scsi device, if it is EBUSY.
>> The second patch serializes access with flock.
>>
>> With these patches it seems to work. I don't know if the flock patch is
>> really necessary. Any help and comments appreciated.
> 
>> -       fd = open(devname, O_RDONLY | O_NONBLOCK);
>> +       while (((fd = open(devname, O_RDONLY | O_NONBLOCK)) != 0) && (cnt >
> 
> What is open() != 0 doing? I guess you want < 0?

errr... yes :)

> 
>> +       strncpy(flock_path, "/sys/", MAX_PATH_LEN-1);
>> +       strncat(flock_path, devpath, MAX_PATH_LEN-1);
> 
> Current scsi_id has no idea about sysfs anymore. I guess, we should
> try if the retry patch is enough.
> 
> Kay

if not, we could flock s.th. like  "/dev/.udev/tmp_" + major + minor

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3636 bytes --]

  parent reply	other threads:[~2008-06-11 19:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-11  9:55 scsi_id - EBUSY and serialization Harald Hoyer
2008-06-11 19:26 ` Kay Sievers
2008-06-11 19:35 ` Harald Hoyer [this message]
2008-06-11 21:56 ` Kay Sievers

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=48502905.7000207@redhat.com \
    --to=harald@redhat.com \
    --cc=linux-hotplug@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.