-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dev #27
base: dev
Are you sure you want to change the base?
Dev #27
Conversation
After changeing the binary configuration image file, possibly, the size of configuration file will be one byte bigger than original size by using seek(). in this case, we choose QUERY_DESC_CONFIGURAION_MAX_SIZE as its length. Signed-off-by: Bean Huo <[email protected]>
IDE 01h in Atrributes is Reserved. Signed-off-by: Bean Huo <[email protected]>
Flags length has been changed, but we didn't update it in the verify_and_set_idn() Signed-off-by: Bean Huo <[email protected]>
WriteBooster related flags are an array of flags, add its index distinguish. Signed-off-by: Bean Huo <[email protected]>
WriteBooster related attributes are an array of attributes, add its index distinguish. Signed-off-by: Bean Huo <[email protected]>
opt->index, opt->selector, 0, 0, 0); | ||
tmp->device_level & ARRAY ? | ||
opt->index : 0, | ||
opt->selector, 0, 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is redundant fix, By default in case and user didn't set index, selector the values are 0.
See verify_arg_and_set_default function
opt->index, opt->selector, 0, 0, 0); | ||
(tmp->device_level & ARRAY) ? | ||
opt->index : 0, | ||
opt->selector, 0, 0, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as previous one
@@ -266,7 +266,7 @@ static int verify_and_set_idn(struct tool_options *options) | |||
} | |||
break; | |||
case FLAG_TYPE: | |||
if (idn > QUERY_FLAG_IDN_PERMANENTLYDISABLEFW) { | |||
if (idn > QUERY_FLAG_IDN_MAX) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
@@ -244,7 +244,7 @@ struct query_err_res { | |||
|
|||
struct attr_fields ufs_attrs[] = { | |||
{"bBootLunEn", BYTE, (URD|UWRT), (READ_ONLY|WRITE_PRSIST), DEV}, | |||
{"bMAX_DATA_SIZE_FOR_HPB_SINGLE_CMD", BYTE, URD, READ_ONLY, DEV}, | |||
{ATTR_RSRV()}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct
@@ -806,6 +806,9 @@ static int do_conf_desc(int fd, __u8 opt, __u8 index, char *data_file) | |||
} | |||
lseek(data_fd, 0, SEEK_SET); | |||
|
|||
if (file_size > QUERY_DESC_CONFIGURAION_MAX_SIZE) | |||
file_size = QUERY_DESC_CONFIGURAION_MAX_SIZE; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case an user create the wrong config file. I don't think the tool shall try fix it. Better if the user will receive Invalid length Query error and fix it.
No description provided.