]> www.infradead.org Git - users/jedix/linux-maple.git/commit
vfs: fix d_ancestor() case in d_materialize_unique
authorMichel Lespinasse <walken@google.com>
Tue, 27 Mar 2012 00:32:44 +0000 (17:32 -0700)
committerMaxim Uvarov <maxim.uvarov@oracle.com>
Fri, 13 Apr 2012 19:22:52 +0000 (12:22 -0700)
commitf5cfabe28a5f3bd9bbda5c622fdcea874a29ec5a
treed8e7e53462c09580202efe21697d5293578516b1
parent2618a43ba2c28dcf3b99c90faa4c8499b145ff41
vfs: fix d_ancestor() case in d_materialize_unique

commit b18dafc86bb879d2f38a1743985d7ceb283c2f4d upstream.

In d_materialise_unique() there are 3 subcases to the 'aliased dentry'
case; in two subcases the inode i_lock is properly released but this
does not occur in the -ELOOP subcase.

This seems to have been introduced by commit 1836750115f2 ("fix loop
checks in d_materialise_unique()").

Signed-off-by: Michel Lespinasse <walken@google.com>
[ Added a comment, and moved the unlock to where we generate the -ELOOP,
  which seems to be more natural.

  You probably can't actually trigger this without a buggy network file
  server - d_materialize_unique() is for finding aliases on non-local
  filesystems, and the d_ancestor() case is for a hardlinked directory
  loop.

  But we should be robust in the case of such buggy servers anyway. ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/dcache.c