This patch adds the commands that the former sg filter allowed for read access to the cmdfilter to keep userspace apps that rely on them working.
Unified · Split
| @@ -219,6 +219,10 @@ static struct kobj_type rcf_ktype = { · 218 unmodified lines | |||
| 219 | .default_attrs = default_attrs, | 219 | .default_attrs = default_attrs, |
| 220 | }; | 220 | }; |
| 221 | 221 | ||
| 222 | #ifndef MAINTENANCE_IN_CMD | ||
| 223 | #define MAINTENANCE_IN_CMD 0xa3 | ||
| 224 | #endif | ||
| 225 | |||
| 222 | static void rcf_set_defaults(struct blk_scsi_cmd_filter *filter) | 226 | static void rcf_set_defaults(struct blk_scsi_cmd_filter *filter) |
| 223 | { | 227 | { |
| 224 | /* Basic read-only commands */ | 228 | /* Basic read-only commands */ |
| @@ -230,6 +234,7 @@ static void rcf_set_defaults(struct blk_scsi_cmd_filter *filter) · 5 unmodified lines | |||
| 230 | __set_bit(READ_16, filter->read_ok); | 234 | __set_bit(READ_16, filter->read_ok); |
| 231 | __set_bit(READ_BUFFER, filter->read_ok); | 235 | __set_bit(READ_BUFFER, filter->read_ok); |
| 232 | __set_bit(READ_DEFECT_DATA, filter->read_ok); | 236 | __set_bit(READ_DEFECT_DATA, filter->read_ok); |
| 237 | __set_bit(READ_CAPACITY, filter->read_ok); | ||
| 233 | __set_bit(READ_LONG, filter->read_ok); | 238 | __set_bit(READ_LONG, filter->read_ok); |
| 234 | __set_bit(INQUIRY, filter->read_ok); | 239 | __set_bit(INQUIRY, filter->read_ok); |
| 235 | __set_bit(MODE_SENSE, filter->read_ok); | 240 | __set_bit(MODE_SENSE, filter->read_ok); |
| @@ -238,6 +243,10 @@ static void rcf_set_defaults(struct blk_scsi_cmd_filter *filter) · 2 unmodified lines | |||
| 238 | __set_bit(START_STOP, filter->read_ok); | 243 | __set_bit(START_STOP, filter->read_ok); |
| 239 | __set_bit(GPCMD_VERIFY_10, filter->read_ok); | 244 | __set_bit(GPCMD_VERIFY_10, filter->read_ok); |
| 240 | __set_bit(VERIFY_16, filter->read_ok); | 245 | __set_bit(VERIFY_16, filter->read_ok); |
| 246 | __set_bit(REPORT_LUNS, filter->read_ok); | ||
| 247 | __set_bit(SERVICE_ACTION_IN, filter->read_ok); | ||
| 248 | __set_bit(RECEIVE_DIAGNOSTIC, filter->read_ok); | ||
| 249 | __set_bit(MAINTENANCE_IN_CMD, filter->read_ok); | ||
| 241 | __set_bit(GPCMD_READ_BUFFER_CAPACITY, filter->read_ok); | 250 | __set_bit(GPCMD_READ_BUFFER_CAPACITY, filter->read_ok); |
| 242 | 251 | ||
| 243 | /* Audio CD commands */ | 252 | /* Audio CD commands */ |
| @@ -2502,10 +2502,6 @@ sg_page_free(struct page *page, int size) · 2501 unmodified lines | |||
| 2502 | __free_pages(page, order); | 2502 | __free_pages(page, order); |
| 2503 | } | 2503 | } |
| 2504 | 2504 | ||
| 2505 | #ifndef MAINTENANCE_IN_CMD | ||
| 2506 | #define MAINTENANCE_IN_CMD 0xa3 | ||
| 2507 | #endif | ||
| 2508 | |||
| 2509 | #ifdef CONFIG_SCSI_PROC_FS | 2505 | #ifdef CONFIG_SCSI_PROC_FS |
| 2510 | static int | 2506 | static int |
| 2511 | sg_idr_max_id(int id, void *p, void *data) | 2507 | sg_idr_max_id(int id, void *p, void *data) |