GFS2: Fix -o meta mounts for subsequent mounts (i.e. all but the first one)
authorSteven Whitehouse <swhiteho@redhat.com>
Mon, 28 Sep 2009 09:30:49 +0000 (10:30 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Thu, 3 Dec 2009 11:42:47 +0000 (11:42 +0000)
commitf55073ff1eaf99f6b3bc62134a456638bca043a3
tree9637792f97494de2336f17a90a756e91c7d25527
parent7e71c55ee73988d0cb61045660b899eaac23bf8f
GFS2: Fix -o meta mounts for subsequent mounts (i.e. all but the first one)

We have a long term plan to use the "-o meta" flag to GFS2 mounts to
access the alternate root which is used to store metadata for a GFS2
filesystem. This will allow us to eventually remove support for the
gfs2meta filesystem type (which is in any case just a "front end" to
the gfs2 filesystem type with the meta/master root).

Currently the "-o meta" option is only taken into account on the
initial mount of the filesystem. Subsequent mounts of the same
filesystem (i.e. on the same device) result in basically the same
as bind mounting the root of the original mount.

This patch changes that by using what is more or less a copy
of get_sb_bdev() and extending it so that it will take into
account the alternate root in all cases. The main difference
is that we have to parse the mount options a bit earlier. We can
then use them to select the appropriate root towards the end of
the function.

In addition this also fixes a bug where it was possible (but certainly
not desirable) to set different ro/rw options for the meta root
when mounted via the gfs2meta fs compared with the original mount.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Cc: Alexander Viro <aviro@redhat.com>
fs/gfs2/ops_fstype.c
fs/gfs2/super.c
fs/gfs2/super.h