Commit e9b0a15
md: check mddev->pers before calling md_set_readonly()
If 'mddev->pers' is NULL, there is nothing to do in md_set_readonly().
Except for md_ioctl(), the other two callers of md_set_readonly() have
already checked 'mddev->pers'. To simplify the code, move the check of
'mddev->pers' to the caller.
Signed-off-by: Li Nan <linan122@huawei.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20240226031444.3606764-10-linan666@huaweicloud.com1 parent 650b2e6 commit e9b0a15
1 file changed
Lines changed: 11 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6420 | 6420 | | |
6421 | 6421 | | |
6422 | 6422 | | |
| 6423 | + | |
6423 | 6424 | | |
6424 | 6425 | | |
6425 | 6426 | | |
| |||
6444 | 6445 | | |
6445 | 6446 | | |
6446 | 6447 | | |
6447 | | - | |
6448 | | - | |
6449 | | - | |
6450 | | - | |
6451 | | - | |
6452 | | - | |
6453 | | - | |
| 6448 | + | |
6454 | 6449 | | |
6455 | | - | |
6456 | | - | |
| 6450 | + | |
| 6451 | + | |
| 6452 | + | |
6457 | 6453 | | |
6458 | 6454 | | |
| 6455 | + | |
| 6456 | + | |
| 6457 | + | |
6459 | 6458 | | |
6460 | | - | |
| 6459 | + | |
6461 | 6460 | | |
6462 | 6461 | | |
6463 | 6462 | | |
| |||
7730 | 7729 | | |
7731 | 7730 | | |
7732 | 7731 | | |
7733 | | - | |
| 7732 | + | |
| 7733 | + | |
7734 | 7734 | | |
7735 | 7735 | | |
7736 | 7736 | | |
| |||
0 commit comments