On Wed, 2010-06-09 at 23:05 +0200, ext Jan Engelhardt wrote:
Unfortunately sysfs_add and sysfs_create will throw a kernel warning if
we try to create a file that already exists. But this was not really
the problem.
Now I just throw an WARN_ON if the sysfs file creation fails, the other
sysfs functions I'm calling can handle this situation. This shouldn't
happen in normal cases and, if it does, the timer will run normally, but
there won't be a sysfs file associated with it (and there won't be any
notification).
As I just wrote in another email, I thought I had figured out a way to
do it without a workqueue. But now that I looked into the code again, I
think there might still be some race conditions... For example: If
someone deletes the timer immediately after I released the lock and
before I created the sysfs entry... The deletion won't cause problems if
the file is not there, it will just nop. But the creation of the file
after the timer has been deleted will cause the file to be dangling in
sysfs without any timer associated with it... :(
--
Cheers,
Luca.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html