summaryrefslogtreecommitdiffstats
path: root/fs/afs
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-12-11 08:06:08 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-17 19:47:01 +0100
commita51dfaa20868ff6c17b03d19fbc0815553ed336b (patch)
tree08bf9efeec046a97c7893cc2c666bfb690b14dd8 /fs/afs
parentb524247efb99f27cbde4fbe8dd7b9caa88ae438b (diff)
downloadlinux-stable-a51dfaa20868ff6c17b03d19fbc0815553ed336b.tar.gz
linux-stable-a51dfaa20868ff6c17b03d19fbc0815553ed336b.tar.bz2
linux-stable-a51dfaa20868ff6c17b03d19fbc0815553ed336b.zip
afs: Fix missing cell comparison in afs_test_super()
commit 106bc79843c3c6f4f00753d1f46e54e815f99377 upstream. Fix missing cell comparison in afs_test_super(). Without this, any pair volumes that have the same volume ID will share a superblock, no matter the cell, unless they're in different network namespaces. Normally, most users will only deal with a single cell and so they won't see this. Even if they do look into a second cell, they won't see a problem unless they happen to hit a volume with the same ID as one they've already got mounted. Before the patch: # ls /afs/grand.central.org/archive linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/ # ls /afs/kth.se/ linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/ # cat /proc/mounts | grep afs none /afs afs rw,relatime,dyn,autocell 0 0 #grand.central.org:root.cell /afs/grand.central.org afs ro,relatime 0 0 #grand.central.org:root.archive /afs/grand.central.org/archive afs ro,relatime 0 0 #grand.central.org:root.archive /afs/kth.se afs ro,relatime 0 0 After the patch: # ls /afs/grand.central.org/archive linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/ # ls /afs/kth.se/ admin/ common/ install/ OldFiles/ service/ system/ bakrestores/ home/ misc/ pkg/ src/ wsadmin/ # cat /proc/mounts | grep afs none /afs afs rw,relatime,dyn,autocell 0 0 #grand.central.org:root.cell /afs/grand.central.org afs ro,relatime 0 0 #grand.central.org:root.archive /afs/grand.central.org/archive afs ro,relatime 0 0 #kth.se:root.cell /afs/kth.se afs ro,relatime 0 0 Fixes: ^1da177e4c3f4 ("Linux-2.6.12-rc2") Reported-by: Carsten Jacobi <jacobi@de.ibm.com> Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Marc Dionne <marc.dionne@auristor.com> Tested-by: Jonathan Billings <jsbillings@jsbillings.org> cc: Todd DeSantis <atd@us.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/afs')
-rw-r--r--fs/afs/super.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/afs/super.c b/fs/afs/super.c
index bd2608297473..18b9b7ca20c9 100644
--- a/fs/afs/super.c
+++ b/fs/afs/super.c
@@ -356,6 +356,7 @@ static int afs_test_super(struct super_block *sb, void *data)
return (as->net_ns == as1->net_ns &&
as->volume &&
as->volume->vid == as1->volume->vid &&
+ as->cell == as1->cell &&
!as->dyn_root);
}