RE: device properties and change events

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


> -----Original Message-----
> From: Greg KH [mailto:gregkh@xxxxxxxxxxxxxxxxxxx]
> Sent: Thursday, March 28, 2013 3:59 PM
> To: Keith Pine
> Cc: linux-hotplug@xxxxxxxxxxxxxxx
> 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?

��.n��������+%������w��{.n�����{��-�[��)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥

[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     []     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux