On 2020/2/12 11:27, Bart Van Assche wrote:
What is the behavior of this loop if multiple block devices are being removed concurrently? Does it perhaps change remove block device removal from an O(1) into an O(n) operation?
Yes, there may be performance overhead.(I thought it's minimal) However, I can change the name of dir form "read_to_remove_%d" to "read_to_remove_%s(dev_name)_%d" to fix that.
Since this scenario may only matter to syzbot tests: has it been considered to delay block device creation if the debugfs directory from a previous incarnation of the block device still exists?
I think it's a bug device creation succeed when the debugfs directory exist. Of course delay block device creation can fix the problem, but I haven't come up with a good solution. And by renaming the dir, there is no need to delay cration. Thanks! Yu Kuai