On Tue, Jul 30, 2019 at 10:13:55PM +0100, Al Viro wrote: > AFAICS, it (and configfs_unregister_default_group()) > will break if called with group non-empty (i.e. when rmdir(2) > would've failed with -ENOTEMPTY); configfs_detach_prep() > is called, but return value is completely ignored. > > Similar breakage happens in configfs_unregister_subsystem(), > but there it looks like the drivers are responsible for not calling > it that way. It yells if configfs_detach_prep() fails and AFAICS > all callers do guarantee it never happens. > > configfs_unregister_group() is quiet; from my reading of > the callers, only pci-endpoint might end up calling it for group > that is not guaranteed to be empty. I'm not familiar with > pci-endpoint guts, so I might very well be missing something there. > > Questions to configfs API maintainers (that'd be Christoph, these > days, AFAIK) > > 1) should such a call be considered a driver bug? > 2) should configfs_unregister_group() at least warn when that happens? Yes, I'm patch monkeying these days. From my POV expecting it to act recursively seems like a bug, and we should at the very least warn.