linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* NFS superblock sharing implies mount flags bug
@ 2006-03-15 10:37 Aurelien Degremont
  2006-03-20 13:20 ` Aurelien Degremont
  0 siblings, 1 reply; 3+ messages in thread
From: Aurelien Degremont @ 2006-03-15 10:37 UTC (permalink / raw)
  To: trond.myklebust
  Cc: viro, linux-fsdevel, linux-kernel, nfs,
	Jacques-Charles Lafoucriere

Hello

I'm facing incorrect using of mount flags when dealing with NFS mounts 
and I think it could be seen as a bug.

The error occurs when mounting the same NFS export many times, on the 
same machine but *with different mount flags*, particularly concerning 
RO/RW flags.

As the NFS client code re-uses superblocks when it detects that it is 
the same export (same server/same port/same exported directory) and that 
the read-only flag is managed as a per-superblock flag, if a NFS exports 
is mounted a second time, the superblock of the first mount is re-used 
and the specified mount flag is ignored.

# mount foo:/bar /bar_ro -o ro
# mount foo:/bar /bar_rw -o rw
$ touch /bar_rw/bar
touch: cannot touch `/bar_rw/bar': Read-only file system

Ideally, the best solution to fix this is to move the RDONLY flag from 
its per-superblock basis to a per-mountpoint (vfsmount) basis. I do not 
know is there is a something that prevent that except that this implies 
many changes as many codes do not use macros but access s_flags directly.

It seems quite clear that the superblock sharing couldn't be changed (to 
avoid incoherency, inode aliasing and so on...) ?

Do you have a (better) solution ?
I can help if needed.


Cordially

-- 
Aurelien Degremont

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: NFS superblock sharing implies mount flags bug
  2006-03-15 10:37 NFS superblock sharing implies mount flags bug Aurelien Degremont
@ 2006-03-20 13:20 ` Aurelien Degremont
  2006-03-20 18:05   ` Trond Myklebust
  0 siblings, 1 reply; 3+ messages in thread
From: Aurelien Degremont @ 2006-03-20 13:20 UTC (permalink / raw)
  To: trond.myklebust, viro
  Cc: linux-fsdevel, linux-kernel, nfs, Jacques-Charles Lafoucriere

Nobody is interested by this issue ?
It could be easily reproduced. All recent versions are concerned.

Aurelien


Aurelien Degremont wrote:
> Hello
> 
> I'm facing incorrect using of mount flags when dealing with NFS mounts 
> and I think it could be seen as a bug.
> 
> The error occurs when mounting the same NFS export many times, on the 
> same machine but *with different mount flags*, particularly concerning 
> RO/RW flags.
> 
> As the NFS client code re-uses superblocks when it detects that it is 
> the same export (same server/same port/same exported directory) and that 
> the read-only flag is managed as a per-superblock flag, if a NFS exports 
> is mounted a second time, the superblock of the first mount is re-used 
> and the specified mount flag is ignored.
> 
> # mount foo:/bar /bar_ro -o ro
> # mount foo:/bar /bar_rw -o rw
> $ touch /bar_rw/bar
> touch: cannot touch `/bar_rw/bar': Read-only file system
> 
> Ideally, the best solution to fix this is to move the RDONLY flag from 
> its per-superblock basis to a per-mountpoint (vfsmount) basis. I do not 
> know is there is a something that prevent that except that this implies 
> many changes as many codes do not use macros but access s_flags directly.
> 
> It seems quite clear that the superblock sharing couldn't be changed (to 
> avoid incoherency, inode aliasing and so on...) ?
> 
> Do you have a (better) solution ?
> I can help if needed.
> 
> 
> Cordially
> 


-- 
Aurelien Degremont
CEA/DAM - DIF/DSSI/SISR

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: NFS superblock sharing implies mount flags bug
  2006-03-20 13:20 ` Aurelien Degremont
@ 2006-03-20 18:05   ` Trond Myklebust
  0 siblings, 0 replies; 3+ messages in thread
From: Trond Myklebust @ 2006-03-20 18:05 UTC (permalink / raw)
  To: Aurelien Degremont
  Cc: viro, linux-fsdevel, linux-kernel, nfs,
	Jacques-Charles Lafoucriere

On Mon, 2006-03-20 at 14:20 +0100, Aurelien Degremont wrote:
> Nobody is interested by this issue ?
> It could be easily reproduced. All recent versions are concerned.
> 
> Aurelien

Check the linux-fsdevel and lkml archives.

There has been plenty of work on this issue both by Herbert Poetzl and
(more recently) by Christoph Hellwig.

Cheers,
  Trond



> Aurelien Degremont wrote:
> > Hello
> > 
> > I'm facing incorrect using of mount flags when dealing with NFS mounts 
> > and I think it could be seen as a bug.
> > 
> > The error occurs when mounting the same NFS export many times, on the 
> > same machine but *with different mount flags*, particularly concerning 
> > RO/RW flags.
> > 
> > As the NFS client code re-uses superblocks when it detects that it is 
> > the same export (same server/same port/same exported directory) and that 
> > the read-only flag is managed as a per-superblock flag, if a NFS exports 
> > is mounted a second time, the superblock of the first mount is re-used 
> > and the specified mount flag is ignored.
> > 
> > # mount foo:/bar /bar_ro -o ro
> > # mount foo:/bar /bar_rw -o rw
> > $ touch /bar_rw/bar
> > touch: cannot touch `/bar_rw/bar': Read-only file system
> > 
> > Ideally, the best solution to fix this is to move the RDONLY flag from 
> > its per-superblock basis to a per-mountpoint (vfsmount) basis. I do not 
> > know is there is a something that prevent that except that this implies 
> > many changes as many codes do not use macros but access s_flags directly.
> > 
> > It seems quite clear that the superblock sharing couldn't be changed (to 
> > avoid incoherency, inode aliasing and so on...) ?
> > 
> > Do you have a (better) solution ?
> > I can help if needed.
> > 
> > 
> > Cordially
> > 
> 
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-03-20 18:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-15 10:37 NFS superblock sharing implies mount flags bug Aurelien Degremont
2006-03-20 13:20 ` Aurelien Degremont
2006-03-20 18:05   ` Trond Myklebust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).