Messages in this thread | | | From | (H. Peter Anvin) | Subject | Overmounting a filesystem | Date | 9 Apr 1996 06:30:43 GMT |
| |
Currently it seems Linux does not permit overmounting a filesystem (mounting a filesystem on top of another, on the same path).
In fs/super.c:
int do_mount(kdev_t dev, const char * dev_name, const char * dir_name, const char * type, int flags, void * data) { struct inode * dir_i; struct super_block * sb; struct vfsmount *vfsmnt; int error;
if (!(flags & MS_RDONLY) && dev && is_read_only(dev)) return -EACCES; /*flags |= MS_RDONLY;*/ error = namei(dir_name, &dir_i); if (error) return error; if (dir_i->i_count != 1 || dir_i->i_mount) { ^^^^^^^^^^^^^^ iput(dir_i); return -EBUSY; }
Is there a rationale for this restriction (I know SunOS 4 doesn't have it.) There are a bunch of nifty tricks involving userfs which would hinge on this being permitted.
-hpa -- PGP public key available - finger hpa@zytor.com "The earth is but one country, and mankind its citizens." -- Bahá'u'lláh I don't work for Yggdrasil, but they sponsor the linux.* hierarchy.
| |