In 2.6.34-rc7 `mount --bind` worked fine with both directories and files but in 2.6.34 it no longer works with files. Version: vanilla 2.6.34 kernel, compiled with gcc 4.4.4 (gcc version 4.4.4 20100514 (Red Hat 4.4.4-3)) Steps to reproduce: 1. $ echo 'asd' > file1 2. $ touch file2 3. $ mount --bind file1 file2 I bisected 2.6.34-rc7 (good) and 2.6.34 (bad) kernels and I've found commit which caused this regression. It's: commit d83c49f3e36cecd2e8823b6c48ffba083b8a5704 Author: Al Viro <viro@zeniv.linux.org.uk> Date: Fri Apr 30 17:17:09 2010 -0400 Fix the regression created by "set S_DEAD on unlink()..." commit Feel free to ask me if you need more information.
(In reply to comment #0) > Steps to reproduce: > 1. $ echo 'asd' > file1 > 2. $ touch file2 > 3. $ mount --bind file1 file2 Hm, after little more inspection this is not sufficient reproducer, I will attach a script which triggers this bug.
Created attachment 26457 [details] Reproducer This is part of the /etc/init.d/named init script used in Fedora 13 and newer. Use it this way (on Fedora system) 1. rm -rf /var/named/chroot/ 2. create non-empty files /etc/named.conf, /etc/named.dnssec.keys, /etc/named.rfc1912.zones, /etc/rndc.conf, /etc/rndc.key and /etc/named.iscdlv.key 3. create directories /etc/named, /etc/pki/dnssec-keys 4. execute the script twice You will see following: [root@evileye atkac]# ./reproducer [root@evileye atkac]# ./reproducer mount: No such file or directory mount: No such file or directory mount: No such file or directory mount: No such file or directory mount: No such file or directory
Presumably fixed in 2.6.34 (final) or 2.6.35-rc1.