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, 12 Oct 2019 21:51:29 +0000 (23:51 +0200)
commitc2635b871d1dd03a6608a9255222672decd49e09
treee395a23095d78ba2c3a5f667cd10ecc0aaf05698
parent77cfc0739d30c1282f7de24d2ec086d244e34bb7
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>
package/kernel/trelay/src/trelay.c