[PATCH V2 0/3] fix potential infinite loop in debugfs_remove_recursive

From: yu kuai
Date: Fri Nov 29 2019 - 20:41:36 EST


The main purpose of this patchset is to fix potential infinite loop in
debugfs_remove_recursive. Al Viro want to refactor it
(https://lore.kernel.org/lkml/20191115184209.GT26530@xxxxxxxxxxxxxxxxxx/).
I can't really tell if it's better. Since debugfs_remove_recursive is
still using 'simple_empty', whitch is wrong, I'm sending this patchset
just in case.

The first patch add a new enum type for 'dentry_d_lock_class'.The second
patch use the new enum type in 'simple_empty' to avoid confusion for
lockdep. The last patch fix potential infinite loop in
debugfs_remove_recursive by using 'simple_empty' instead of 'list_empty'.

changes in V2:
rename the new enum type in the first patch, add some comments.


yu kuai (3):
dcache: add a new enum type for 'dentry_d_lock_class'
fs/libfs.c: use 'spin_lock_nested' when taking 'd_lock' for dentry in
simple_empty
debugfs: fix potential infinite loop in debugfs_remove_recursive

fs/debugfs/inode.c | 7 +++++--
fs/libfs.c | 4 ++--
include/linux/dcache.h | 11 ++++++++++-
3 files changed, 17 insertions(+), 5 deletions(-)

--
2.17.2