On Mon, Dec 26, 2011 at 07:14:52PM -0300, Gerardo Exequiel Pozzi wrote:
On 12/26/2011 06:34 PM, Dave Reisner wrote:
Just as I suspected, libmount will always try to canonicalize the source of a device with no regard for what it is. This is a simple change. This is a simple change in the fstab parsing to always trust the source when you encounter a pseudofs (such as tmpfs, cgroup, rpc_pipefs, etc). Patch for this will go out by the end of the night regardless of the mayhem that follows...
Digging into this further -- you don't even need to mount /tmp to duplicate the bad behavior, e.g.
# echo 'foo /foo tmpfs defaults 0 0'>> /etc/fstab # cd /root # mkdir foo # mount -a
...and you'll have a tmpfs on /root/foo. I'm not sure yet if this can be worked around. Seems really ugly... almost like mount(2) might be at fault here and there isn't much libmount can do.
Yes I just used "tmp" as an example.
Success here as well. Stupid thinking -- mount(2) will rightfully ignore the source parameter for a nodev fs.
Only problem, as noted in the patch there, is that legacy mount is a goddamn monster. It does all sorts of bad things and I didn't really see an easy way to fix it. I'm really hoping that it goes away with 2.21, but it seems unlikely right now. Maybe Karel or someone else will be inclined to fix it...