For mount() we have it - see mount_sem usage.
> > Another thing to consider: behaviour of NFS-exported filesystems. That has
> > nothing to loops. Look at the export table handling in knfsd. AFAICS it
> > may bite you if you are moving the stuff around that way.
> >
> > And another one: interaction with lookups. I have a nasty gut feeling that
> > in current form it has really unpleasant races waiting to happen as soon
> > as we'll allow to move mountpoints *not* dropping the whole tree under
> > them.
>
> Okay, you convinced me. Should the check go in the kernel or in mount(8)?
Why bother with mount(8)? Check is fairly trivial - you are taking a
dentry of new mountpoint anyway, so you can just do the following:
error = -EINVAL;
for(foo=mountpoint->d_inode->i_sb;
foo!=foo->s_root->d_covers->d_inode->i_sb;
foo=foo->s_root->d_covers->d_inode->i_sb)
if (foo == our_sb)
goto no_fscking_way;
That's it. Now, problems with knfsd remain - they have nothing to loops...
Could you look at it?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/