]> nv-tegra.nvidia Code Review - linux-3.10.git/commit
VFS: Log the fact that we've given ELOOP rather than creating a loop
authorDavid Howells <dhowells@redhat.com>
Tue, 16 Aug 2011 14:31:30 +0000 (15:31 +0100)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 21 Nov 2011 04:04:27 +0000 (23:04 -0500)
commitdd179946db2493646955efc112d73c85b3cafcb1
tree59203e419cf14e4a28e3ede7cb32a00d34bd0f8e
parentf1fd306a91f875e65af0e04855b23adda6831ac9
VFS: Log the fact that we've given ELOOP rather than creating a loop

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 1836750115f20b774e55c032a3893e8c5bdf41ed
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: David Howells <dhowells@redhat.com>
Acked-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/dcache.c