debugfs_create_u*() not SMP-safe

From: Eduard - Gabriel Munteanu
Date: Thu Jul 17 2008 - 23:54:22 EST


Hi,

I noticed debugfs_create_u*() functions don't allow for any precautions
to be taken while doing r/w to the exported variables. Thus any export of a
variable isn't SMP-safe.

As far as I can tell, this only works safely for constant data. Let me
ask then, what is the purpose of these functions? Are they intended only
for unreliable data?

As I see it, they could be replaced by one of the following:
- Have them only export atomic data, that is atomic_t variables.
- Have them take a lock as a parameter, which the read() / write()
handler grabs. The kernel code that exported the variable should also
do r/w while holding that same lock.

Or am I wrong?


Thanks,
Eduard

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/