Commit 4cbec7e
scsi: target: Fix unmap setup during configuration
This issue was found and also debugged by Carl Lei <me@xecycle.info>.
If the device is not enabled, iblock/file will have not setup their
se_device to bdev/file mappings. If a user tries to config the unmap
settings at this time, we will then crash trying to access a NULL pointer
where the bdev/file should be.
This patch adds a check to make sure the device is configured before
we try to call the configure_unmap callout.
Fixes: 34bd1dc ("scsi: target: Detect UNMAP support post configuration")
Reported-by: Carl Lei <me@xecycle.info>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Link: https://lore.kernel.org/r/20240209215247.5213-1-michael.christie@oracle.com
Reviewed-by: Maurizio Lombardi <mlombard@redhat.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>1 parent 17e94b2 commit 4cbec7e
1 file changed
+32
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
762 | 785 | | |
763 | 786 | | |
764 | 787 | | |
| |||
776 | 799 | | |
777 | 800 | | |
778 | 801 | | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | | - | |
783 | | - | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
784 | 805 | | |
785 | 806 | | |
786 | 807 | | |
| |||
806 | 827 | | |
807 | 828 | | |
808 | 829 | | |
809 | | - | |
810 | | - | |
811 | | - | |
812 | | - | |
813 | | - | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
814 | 833 | | |
815 | 834 | | |
816 | 835 | | |
| |||
1022 | 1041 | | |
1023 | 1042 | | |
1024 | 1043 | | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
1031 | 1047 | | |
1032 | 1048 | | |
1033 | 1049 | | |
| |||
0 commit comments