devtmpfs: regular files

From: Sami Kerola
Date: Sat Aug 19 2017 - 10:57:02 EST


Hi,

Is there some reason why devtmpfs allows creation of regular files? I
think it would be nice if /dev would behave same way as /proc, that
is:

$ echo example > /proc/regular-file.txt
-bash: /proc/regular-file.txt: No such file or directory

That would make users who rm /dev/null to notice something is wrong
before all space is taken by some rubbish writer. Secondly when /dev/
is used for pairing daemons with fifo this would make incorrect start
order to fail without intervention needed - no more writer creating a
file, and reader that wants to use same path for fifo being unable to
do so.

This could be a mount option. Something like nofile in spirit of nodev
but with opposite effect. My assumption is that changing default
behavior is unlikely to be approvable.

--
Sami Kerola
http://www.iki.fi/kerolasa/