debugfs: leave freeing a symlink body until inode eviction
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 22 Feb 2015 03:05:11 +0000 (22:05 -0500)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 9 May 2015 22:16:19 +0000 (23:16 +0100)
commit915f4f86ddc49484217a0e0e16e8a25e3c1ec856
tree2294ac4c2aef6a419e574549f9834a71a885d3dd
parentaafdaa379ae3fb58acefa092b8edc3a64c929bb9
debugfs: leave freeing a symlink body until inode eviction

commit 0db59e59299f0b67450c5db21f7f316c8fb04e84 upstream.

As it is, we have debugfs_remove() racing with symlink traversals.
Supply ->evict_inode() and do freeing there - inode will remain
pinned until we are done with the symlink body.

And rip the idiocy with checking if dentry is positive right after
we'd verified debugfs_positive(), which is a stronger check...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[bwh: Backported to 3.2:
 - Plumb in debugfs_super_operations, which we didn't previously define
 - Call truncate_inode_pages() instead of truncate_inode_pages_final()
 - Call end_writeback() instead of clear_inode()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/debugfs/inode.c