Commit d701cb4
ublk: add UBLK_CMD_TRY_STOP_DEV command
This command is similar to UBLK_CMD_STOP_DEV, but it only stops the
device if there are no active openers for the ublk block device.
If the device is busy, the command returns -EBUSY instead of
disrupting active clients. This allows safe, non-destructive stopping.
Advertise UBLK_CMD_TRY_STOP_DEV support via UBLK_F_SAFE_STOP_DEV
feature flag.
Signed-off-by: Yoav Cohen <[email protected]>
Reviewed-by: Ming Lei <[email protected]>
Signed-off-by: Ming Lei <[email protected]>1 parent 5d09d20 commit d701cb4
File tree
3 files changed
+51
-3
lines changed- drivers/block
- include/uapi/linux
- tools/testing/selftests/ublk
3 files changed
+51
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
76 | | - | |
| 77 | + | |
| 78 | + | |
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| |||
239 | 241 | | |
240 | 242 | | |
241 | 243 | | |
| 244 | + | |
| 245 | + | |
242 | 246 | | |
243 | 247 | | |
244 | 248 | | |
| |||
919 | 923 | | |
920 | 924 | | |
921 | 925 | | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
922 | 929 | | |
923 | 930 | | |
924 | 931 | | |
| |||
3188 | 3195 | | |
3189 | 3196 | | |
3190 | 3197 | | |
3191 | | - | |
| 3198 | + | |
| 3199 | + | |
3192 | 3200 | | |
3193 | 3201 | | |
3194 | 3202 | | |
| |||
3309 | 3317 | | |
3310 | 3318 | | |
3311 | 3319 | | |
| 3320 | + | |
| 3321 | + | |
| 3322 | + | |
| 3323 | + | |
| 3324 | + | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
| 3330 | + | |
| 3331 | + | |
| 3332 | + | |
| 3333 | + | |
| 3334 | + | |
| 3335 | + | |
| 3336 | + | |
| 3337 | + | |
| 3338 | + | |
| 3339 | + | |
| 3340 | + | |
| 3341 | + | |
| 3342 | + | |
| 3343 | + | |
| 3344 | + | |
| 3345 | + | |
| 3346 | + | |
| 3347 | + | |
3312 | 3348 | | |
3313 | 3349 | | |
3314 | 3350 | | |
| |||
3704 | 3740 | | |
3705 | 3741 | | |
3706 | 3742 | | |
| 3743 | + | |
3707 | 3744 | | |
3708 | 3745 | | |
3709 | 3746 | | |
| |||
3817 | 3854 | | |
3818 | 3855 | | |
3819 | 3856 | | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
3820 | 3860 | | |
3821 | 3861 | | |
3822 | 3862 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
311 | 312 | | |
312 | 313 | | |
313 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
314 | 321 | | |
315 | 322 | | |
316 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1454 | 1454 | | |
1455 | 1455 | | |
1456 | 1456 | | |
| 1457 | + | |
1457 | 1458 | | |
1458 | 1459 | | |
1459 | 1460 | | |
| |||
0 commit comments