• David Howells's avatar
    VFS: Log the fact that we've given ELOOP rather than creating a loop · dd179946
    David Howells authored
    To prevent an NFS server from being used to create a directory loop in an NFS
    superblock on the client, the following patch was committed:
    
    	commit 18367501
    	Author: Al Viro <viro@zeniv.linux.org.uk>
    	Date:   Tue Jul 12 21:42:24 2011 -0400
    	Subject: fix loop checks in d_materialise_unique()
    
    This causes ELOOP to be reported to anyone trying to access the dentry that
    would otherwise cause the kernel to complete the loop.
    
    However, no indication is given to the caller as to why an operation that ought
    to work doesn't.  The fault is with the kernel, which doesn't want to try and
    solve the problem as it gets horrendously messy if there's another mountpoint
    somewhere in the trees being spliced that can't be moved[*].
    
    [*] The real problem is that we don't handle the excision of a subtree that
    gets moved _out_ of what we can see.  This can happen on the server where a
    directory is merely moved between two other dirs on the same filesystem, but
    where destination dir is not accessible by the client.
    
    So, given the choice to return ELOOP rather than trying to reconfigure the
    dentry tree, we should give the caller some indication of why they aren't being
    allowed to make what should be a legitimate request and log a message.
    Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
    Acked-by: default avatarSachin Prabhu <sprabhu@redhat.com>
    Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
    dd179946
dcache.c 77 KB