Repository navigation
Commit 0e4e1de
committed
rbd: avoid a deadlock on header_rwsem when flushing notifies
rbd_unregister_watch() flushes notifies and therefore cannot be called
under header_rwsem because a header update notify takes header_rwsem to
synchronize with "rbd map". If mapping an image fails after the watch
is established and a header update notify sneaks in, we deadlock when
erroring out from rbd_dev_image_probe().
Move watch registration and unregistration out of the critical section.
The only reason they were put there was to make header_rwsem management
slightly more obvious.
Fixes: 811c668 ("rbd: fix rbd map vs notify races")
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Reviewed-by: Jason Dillaman <dillaman@redhat.com>1 parent 8f3d9f3 commit 0e4e1de
1 file changed
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4527 | 4527 | | |
4528 | 4528 | | |
4529 | 4529 | | |
| 4530 | + | |
| 4531 | + | |
| 4532 | + | |
| 4533 | + | |
4530 | 4534 | | |
4531 | 4535 | | |
4532 | 4536 | | |
| |||
6907 | 6911 | | |
6908 | 6912 | | |
6909 | 6913 | | |
| 6914 | + | |
| 6915 | + | |
| 6916 | + | |
6910 | 6917 | | |
6911 | 6918 | | |
6912 | 6919 | | |
| |||
6936 | 6943 | | |
6937 | 6944 | | |
6938 | 6945 | | |
| 6946 | + | |
| 6947 | + | |
| 6948 | + | |
6939 | 6949 | | |
6940 | 6950 | | |
6941 | 6951 | | |
| |||
6987 | 6997 | | |
6988 | 6998 | | |
6989 | 6999 | | |
| 7000 | + | |
| 7001 | + | |
6990 | 7002 | | |
6991 | 7003 | | |
6992 | 7004 | | |
| |||
7050 | 7062 | | |
7051 | 7063 | | |
7052 | 7064 | | |
7053 | | - | |
7054 | 7065 | | |
7055 | | - | |
7056 | | - | |
| 7066 | + | |
7057 | 7067 | | |
7058 | | - | |
7059 | 7068 | | |
7060 | 7069 | | |
7061 | 7070 | | |
| |||
0 commit comments