diff options
| author | Sachin Prabhu <[email protected]> | 2011-08-01 11:10:12 +0000 |
|---|---|---|
| committer | Trond Myklebust <[email protected]> | 2011-09-13 21:10:15 +0000 |
| commit | fb2088ccc139ffbf1cf359216883712dab4ae43d (patch) | |
| tree | 88fd8cad42bd9d7518fdc25b519965b37cdcb4a5 /lib/debugobjects.c | |
| parent | NFS: Fix a typo in nfs_flush_multi (diff) | |
| download | kernel-fb2088ccc139ffbf1cf359216883712dab4ae43d.tar.gz kernel-fb2088ccc139ffbf1cf359216883712dab4ae43d.zip | |
nfs: Do not allow multiple mounts on same mountpoint when using -o noac
Do not allow multiple mounts on same mountpoint when using -o noac
When you normally attempt to mount a share twice on the same mountpoint,
a check in do_add_mount causes it to return an error
# mount localhost:/nfsv3 /mnt
# mount localhost:/nfsv3 /mnt
mount.nfs: /mnt is already mounted or busy
However when using the option 'noac', the user is able to mount the same
share on the same mountpoint multiple times. This happens because a
share mounted with the noac option is automatically assigned the 'sync'
flag MS_SYNCHRONOUS in nfs_initialise_sb(). This flag is set after the
check for already existing superblocks is done in sget(). The check for
the mount flags in nfs_compare_mount_options() does not take into
account the 'sync' flag applied later on in the code path. This means
that when using 'noac', a new superblock structure is assigned for every
new mount of the same share and multiple shares on the same mountpoint
are allowed.
ie.
# mount -onoac localhost:/nfsv3 /mnt
can be run multiple times.
The patch checks for noac and assigns the sync flag before sget() is
called to obtain an already existing superblock structure.
Signed-off-by: Sachin Prabhu <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
Diffstat (limited to 'lib/debugobjects.c')
0 files changed, 0 insertions, 0 deletions
