[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-hotplug
Subject:    RE: device properties and change events
From:       Keith Pine <kpine () ddn ! com>
Date:       2013-03-29 1:26:41
Message-ID: F391FB4F21BEC943926789308B8035905C5C967A () LAX-EX-MB3 ! datadirect ! datadirectnet ! com
[Download RAW message or body]

> -----Original Message-----
> From: Greg KH [mailto:gregkh@linuxfoundation.org]
> Sent: Thursday, March 28, 2013 3:59 PM
> To: Keith Pine
> Cc: linux-hotplug@vger.kernel.org
> Subject: Re: device properties and change events

...

> I think that is correct.  When a device "changes", all of it's
> attributes are thrown away as they obviously changed (the kernel told us
> so.)

Ok, that makes sense.

> > With 'udevadm monitor' I can see change events being triggered whenever
> my
> > application exits (for the devices it has opened), and would like to
> > determine why. I was hoping udev could give me a hint.
> 
> Your kernel driver should tell you why, what driver is it?

SCSI block device (sd). Your questions got me looking again, so I did a quick test \
which showed that the act of closing a file descriptor opened on the block device \
with write access is enough to trigger the change event (read-only access does not \
cause a change event). I looked at scsi debug logs, etc., and finally checked Google, \
where I was reminded about the watch option. Sure enough, the \
60-persistent-storage.rules file enables watch for sd devices. If I set nowatch in my \
custom udev rules the change events no longer trigger; mystery solved.

I guess now I need to consider whether or not I even want watch enabled for my block \
devices. There's no filesystem and my application will typically be the owner and \
only user, so I'm not sure the option is useful. Are you aware of any other kind of \
events that could cause a change event on a block device?

Thanks,
Keith
--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic