trelay: fix deadlock on remove
authorAli MJ Al-Nasrawy <alimjalnasrawy@gmail.com>
Wed, 25 Sep 2019 14:47:12 +0000 (17:47 +0300)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 19 Oct 2019 12:29:44 +0000 (14:29 +0200)
commitb17c95bbdcad6529b846fc52a4ed88b950d40225
tree3178fa2df171451db6f28dccf0b47e58603f2d1a
parent9784a470bb490988b275d32d4bbe9ddd56c2fd71
trelay: fix deadlock on remove

Upon writing to "remove" file, debugfs_remove_recursive() blocks while
holding rtnl_lock. This is because debugfs' file_ops callbacks are
executed in debugfs_use_file_*() context which prevents file removal.

Fix this by only flagging the device for removal and then do the cleanup
in file_ops.release callback which is executed out of that context.

Signed-off-by: Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>
(cherry picked from commit c2635b871d1dd03a6608a9255222672decd49e09)
package/kernel/trelay/src/trelay.c