[Unionfs] Can't make branch read only

Herton Ronaldo Krzesinski herton at mandriva.com.br
Thu Oct 25 09:49:31 EDT 2007


Em Wednesday 24 October 2007 15:47:52 Herton Ronaldo Krzesinski escreveu:
> Em Wednesday 24 October 2007 04:55:18 Erez Zadok escreveu:
> > In message <200710231821.22948.herton at mandriva.com.br>, Herton Ronaldo
>
> Krzesinski writes:
> > > Em Tuesday 23 October 2007 18:02:26 Herton Ronaldo Krzesinski escreveu:
> > > > Em Tuesday 23 October 2007 16:13:40 Olivier Blin escreveu:
> > > > > Actually, the "mount -t unionfs -o remount,mode=/live/foo=ro none
> > > > > /live/union" command succeeds, with no error message, and nothing
> > > > > in syslog.
> > > >
> > > > Yes. And debugging here what happens in this case is that
> > > > unionfs_remount_fs is called with options NULL, so the "goto
> > > > out_error" early in the function triggers, and do_remount_mode_option
> > > > isn't even executed.
> > >
> > > Confirmed, the problem is "mode" option, it falls in "VFS took care of
> > > it" case, doing this:
> > >
> > > --- fs/unionfs/super.c.orig	2007-10-23 18:10:15.000000000 -0200
> > > +++ fs/unionfs/super.c	2007-10-23 18:10:36.000000000 -0200
> > > @@ -626,7 +626,7 @@ static int unionfs_remount_fs(struct sup
> > >  			new_branches--;
> > >  			continue;
> > >  		}
> > > -		if (!strcmp("mode", optname)) {
> > > +		if (!strcmp("mode_", optname)) {
> > >  			err = do_remount_mode_option(optarg, new_branches,
> > >  						     tmp_data,
> > >  						     tmp_lower_paths);
> >
> > Herton, what kernel are you using that refuses to pass the mode option to
> > unionfs?  Is this a vanilla kernel or a modified one?  if it's a modified
> > one (mandriva?), can you point me to kernel sources please so I can check
> > them out.  I'm unable to reproduce your bug with my vanilla kernels: the
> > mode option is passed just fine to unionfs.
> >
> > Note that many file systems use mode=XXX for an assortment of uses.  if,
> > somehow, the VFS in your kernel takes over the mode option for some
> > reason, then it would break a bunch of other file systems: affs, devpts,
> > iso9660, and tmpfs.
>
> Strange, now I tried a stock kernel and still get this behaviour, it's a
> 2.6.22.9 kernel with just unionfs-2.1.7_for_2.6.22.10.diff.gz applied,
> config attached.

Found some more time to debug this, and I discovered the following, with
"mount -t unionfs -o remount,mode=/live/foo=ro none /live/union" for some 
reason it fails as I told, but doing:
"mount -o remount,mode=/live/foo=ro unionfs /live/union" I get the expected 
behaviour. Note the slightly changes, I just don't use "-t" anymore and none 
is replaced by unionfs. Can be a bug in our mount (from 
util-linux-ng-2.13.0.1) or in kernel itself, I didn't found out yet (or is 
just this way and we are using mount wrongly).

>
> > > And using "mount -t unionfs -o remount,mode_=/live/foo=ro none
> > > /live/union" I can get now the error message:
> > > "unionfs: leftmost branch cannot be read-only (use "remount,ro" to
> > > create a read-only union)"
> > >
> > > --
> > > []'s
> > > Herton
> >
> > Thanks,
> > Erez.
>
> --
> []'s
> Herton

-- 
[]'s
Herton


More information about the unionfs mailing list