diff options
author | Xiubo Li <[email protected]> | 2019-09-19 11:44:27 +0530 |
---|---|---|
committer | Jens Axboe <[email protected]> | 2019-10-10 09:44:56 -0600 |
commit | 862488105b84ca744b3d8ff131e0fcfe10644be1 (patch) | |
tree | b390e422dd7a8fe4014c937b4203afb61298abe6 /tools/perf/util/trace-event-scripting.c | |
parent | 79a85e214d62da9a750cc63ef49483e62abbda81 (diff) |
nbd: fix possible sysfs duplicate warning
1. nbd_put takes the mutex and drops nbd->ref to 0. It then does
idr_remove and drops the mutex.
2. nbd_genl_connect takes the mutex. idr_find/idr_for_each fails
to find an existing device, so it does nbd_dev_add.
3. just before the nbd_put could call nbd_dev_remove or not finished
totally, but if nbd_dev_add try to add_disk, we can hit:
debugfs: Directory 'nbd1' with parent 'block' already present!
This patch will make sure all the disk add/remove stuff are done
by holding the nbd_index_mutex lock.
Reported-by: Mike Christie <[email protected]>
Reviewed-by: Josef Bacik <[email protected]>
Signed-off-by: Xiubo Li <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions