JFFS2 bind mount bug ?

Joakim Tjernlund Joakim.Tjernlund at infinera.com
Thu Oct 19 01:05:33 PDT 2023


On Thu, 2023-10-19 at 10:18 +0800, Zhihao Cheng wrote:
> 在 2023/10/18 22:06, Joakim Tjernlund 写道:
> > Got two JFFS2 partitions (on / and /var) and do
> >    PWROOT=/var/os
> >    mount --bind "${PWROOT}"/etc/shadow /etc/shadow
> > then I modify "${PWROOT}"/etc/shadow and expect both "${PWROOT}"/etc/shadow /etc/shadow to
> > be equal but the /etc/shadow is unchanged!
> > Kernel here is 5.15.129
> > 
> 
> 
> Isn't '/etc/shadow' a regular file? Was mounting successful?
> 

It is but I think I figured out why it isn't working. I am really running passwd --root /var/os
and passwd will do a rename(shadow+,shadow) and rename breaks the bind mount whatever I do.
I cannot figure out how to make the bind mount work in this case, is it even possible?

 Joakim


More information about the linux-mtd mailing list