Commit 06a452e5 authored by Adel Gadllah's avatar Adel Gadllah Committed by Jens Axboe

cmdfilter: extend default read filter

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.
Signed-off-by: default avatarAdel Gadllah <adel.gadllah@gmail.com>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 2b272d4f
...@@ -219,6 +219,10 @@ static struct kobj_type rcf_ktype = { ...@@ -219,6 +219,10 @@ static struct kobj_type rcf_ktype = {
.default_attrs = default_attrs, .default_attrs = default_attrs,
}; };
#ifndef MAINTENANCE_IN_CMD
#define MAINTENANCE_IN_CMD 0xa3
#endif
static void rcf_set_defaults(struct blk_scsi_cmd_filter *filter) static void rcf_set_defaults(struct blk_scsi_cmd_filter *filter)
{ {
/* Basic read-only commands */ /* Basic read-only commands */
...@@ -230,6 +234,7 @@ static void rcf_set_defaults(struct blk_scsi_cmd_filter *filter) ...@@ -230,6 +234,7 @@ static void rcf_set_defaults(struct blk_scsi_cmd_filter *filter)
__set_bit(READ_16, filter->read_ok); __set_bit(READ_16, filter->read_ok);
__set_bit(READ_BUFFER, filter->read_ok); __set_bit(READ_BUFFER, filter->read_ok);
__set_bit(READ_DEFECT_DATA, filter->read_ok); __set_bit(READ_DEFECT_DATA, filter->read_ok);
__set_bit(READ_CAPACITY, filter->read_ok);
__set_bit(READ_LONG, filter->read_ok); __set_bit(READ_LONG, filter->read_ok);
__set_bit(INQUIRY, filter->read_ok); __set_bit(INQUIRY, filter->read_ok);
__set_bit(MODE_SENSE, filter->read_ok); __set_bit(MODE_SENSE, filter->read_ok);
...@@ -238,6 +243,10 @@ static void rcf_set_defaults(struct blk_scsi_cmd_filter *filter) ...@@ -238,6 +243,10 @@ static void rcf_set_defaults(struct blk_scsi_cmd_filter *filter)
__set_bit(START_STOP, filter->read_ok); __set_bit(START_STOP, filter->read_ok);
__set_bit(GPCMD_VERIFY_10, filter->read_ok); __set_bit(GPCMD_VERIFY_10, filter->read_ok);
__set_bit(VERIFY_16, filter->read_ok); __set_bit(VERIFY_16, filter->read_ok);
__set_bit(REPORT_LUNS, filter->read_ok);
__set_bit(SERVICE_ACTION_IN, filter->read_ok);
__set_bit(RECEIVE_DIAGNOSTIC, filter->read_ok);
__set_bit(MAINTENANCE_IN_CMD, filter->read_ok);
__set_bit(GPCMD_READ_BUFFER_CAPACITY, filter->read_ok); __set_bit(GPCMD_READ_BUFFER_CAPACITY, filter->read_ok);
/* Audio CD commands */ /* Audio CD commands */
......
...@@ -2502,10 +2502,6 @@ sg_page_free(struct page *page, int size) ...@@ -2502,10 +2502,6 @@ sg_page_free(struct page *page, int size)
__free_pages(page, order); __free_pages(page, order);
} }
#ifndef MAINTENANCE_IN_CMD
#define MAINTENANCE_IN_CMD 0xa3
#endif
#ifdef CONFIG_SCSI_PROC_FS #ifdef CONFIG_SCSI_PROC_FS
static int static int
sg_idr_max_id(int id, void *p, void *data) sg_idr_max_id(int id, void *p, void *data)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment