]> git.baikalelectronics.ru Git - kernel.git/commit
sysfs: Reject with a warning invalid uses of tagged directories.
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 12 Oct 2011 22:02:43 +0000 (22:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Oct 2011 23:24:16 +0000 (19:24 -0400)
commit88230e2c16609ce4739f745e54b3fe57f130443e
treee63059c0acbfde6eca66cd9c293a984e64d6cab8
parent9ae2b4ea18d7a897c39575ba19f587c2858f7fc0
sysfs: Reject with a warning invalid uses of tagged directories.

sysfs is a core piece of ifrastructure that many people use and
few people have all of the rules in their head on how to use
it correctly.  Add warnings for people using tagged directories
improperly to that any misuses can be caught and diagnosed quickly.

A single inexpensive test in sysfs_find_dirent is almost sufficient
to catch all possible misuses.  An additional warning is needed
in sysfs_add_dirent so that we actually fail when attempting to
add an untagged dirent in a tagged directory.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
fs/sysfs/dir.c
fs/sysfs/file.c