Kay Sievers wrote:
On Wed, Jun 11, 2008 at 11:55 AM, Harald Hoyer <harald@xxxxxxxxxx> 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:
smime.p7s
Description: S/MIME Cryptographic Signature