Repository navigation
Commit 3c5df89
rbd: read image size for discard check safely
In rbd_img_request_fill() the image size is only checked to determine
whether we can truncate an object instead of zeroing it for discard
requests. Take rbd_dev->header_rwsem while reading the image size, and
move this read into the discard check, so that non-discard ops don't
need to take the semaphore in this function.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>1 parent 90e98c5 commit 3c5df89
1 file changed
Lines changed: 12 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2332 | 2332 | | |
2333 | 2333 | | |
2334 | 2334 | | |
2335 | | - | |
2336 | 2335 | | |
2337 | 2336 | | |
2338 | 2337 | | |
| |||
2397 | 2396 | | |
2398 | 2397 | | |
2399 | 2398 | | |
2400 | | - | |
| 2399 | + | |
2401 | 2400 | | |
2402 | | - | |
2403 | | - | |
| 2401 | + | |
2404 | 2402 | | |
2405 | | - | |
2406 | | - | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
2407 | 2413 | | |
2408 | 2414 | | |
2409 | 2415 | | |
| |||
0 commit comments