Duplicate network filesystems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

In fs/namespace.c do_add_mount() we do this check:

	/* Refuse the same filesystem on the same mount point */
	err = -EBUSY;
	if (path->mnt->mnt_sb == newmnt->mnt.mnt_sb &&
	    path->mnt->mnt_root == path->dentry)
		goto unlock;

So that mount fails with EBUSY. But for networked filesystems (at least
cifs and nfs) you can do this:

mount //foo /mnt -o A
mount //foo /mnt -o B # different options

Since the SB are different it works, fine.

But mounting a 3rd time with options A succeeds, where from a user POV I
would have expected to fail.

So to recap:

mount //foo /mnt -o A
mount //foo /mnt -o A
# EBUSY => expected behaviour

mount //foo /mnt -o A
mount //foo /mnt -o B
# ok => expected behaviour

mount //foo /mnt -o A
mount //foo /mnt -o B
mount //foo /mnt -o A
# ok => what?

Shouldn't we check the stack of filesystems mounted at the path instead of
just the last one?

Cheers,

-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Linux GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux