From: Kay Sievers Date: Fri, 22 Sep 2006 11:10:21 +0000 Subject: Re: Udev 100: Inconsistency in 60-persistent-storage.rules? Message-Id: <1158923421.3603.76.camel@pim.off.vrfy.org> List-Id: References: <4513C178.9090406@ums.usu.ru> In-Reply-To: <4513C178.9090406@ums.usu.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org On Fri, 2006-09-22 at 16:56 +0600, Alexander E. Patrakov wrote: > Hello, >=20 > the 60-persistent-storage.rules file contains the following rules: >=20 > # never access non-cdrom removable ide devices, the drivers are causing=20 > event loops on open() > KERNEL=3D"hd*[!0-9]", ATTRS{removable}=3D"1",=20 > DRIVERS=3D"ide-cs|ide-floppy", GOTO=3D"persistent_storage_end" > KERNEL=3D"hd*[0-9]", ATTRS{removable}=3D"1", GOTO=3D"persistent_storage_e= nd" >=20 > # >=20 > # by-label/by-uuid (filesystem properties) > KERNEL=3D"*[!0-9]", ATTR{removable}=3D"1", GOTO=3D"persistent_storage_end" >=20 > # >=20 > LABEL=3D"persistent_storage_end" >=20 > What's the reason for the ATTRS vs ATTR difference? Where exactly does=20 > the "removable" attribute live in sysfs? The "removable" attribute is a disk, not a partition attribute. ATTR matches only on the device we receive the event for, ATTRS searches up the chain of parents for a match. ATTRS, like all other *S keys is usually more expensive, cause we may need to walk up the parent devices to see that nothing matches. KERNEL=3D"*[!0-9]", ATTR{removable}=3D"1" matches only the disk device here, where the attribute is expected. KERNEL=3D"hd*[0-9]", ATTRS{removable}=3D"1" will find the "removable" attribute of the disk, which is the parent of the partition we match on with KERNEL. KERNEL=3D"hd*[!0-9]", ATTRS{removable}=3D"1" could be ATTR I think, cause it will not run for a partition anyway cause of the KERNEL match. Kay ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=DEVD= EV _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel