Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F131854595
D40522.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D40522.diff
View Options
diff --git a/sbin/camcontrol/camcontrol.c b/sbin/camcontrol/camcontrol.c
--- a/sbin/camcontrol/camcontrol.c
+++ b/sbin/camcontrol/camcontrol.c
@@ -3923,18 +3923,23 @@
ccb = cam_getccb(device);
-retry_12byte:
-
/*
- * We start off asking for just the header to determine how much
- * defect data is available. Some Hitachi drives return an error
- * if you ask for more data than the drive has. Once we know the
- * length, we retry the command with the returned length.
+ * We start off asking for just the header to determine how much defect
+ * data is available. Some Hitachi drives return an error if you ask
+ * for more data than the drive has. Once we know the length, we retry
+ * the command with the returned length. When we're retrying the with
+ * 12-byte command, we're always changing to the 12-byte command and
+ * need to get the length. Simplify the logic below by always setting
+ * use_12byte in this case with this slightly more complex logic here.
*/
- if (!use_12byte)
+ if (!use_12byte) {
dlist_length = sizeof(*hdr10);
- else
+ } else {
+retry_12byte:
+ get_length = true;
+ use_12byte = true;
dlist_length = sizeof(*hdr12);
+ }
retry:
if (defect_list != NULL) {
@@ -4058,8 +4063,6 @@
&& (returned_length > 0)) {
if (!use_12byte
&& (returned_length >= max_possible_size)) {
- get_length = true;
- use_12byte = true;
goto retry_12byte;
}
dlist_length = returned_length + hdr_size;
@@ -4075,8 +4078,6 @@
* byte command.
*/
if (!use_12byte) {
- get_length = true;
- use_12byte = true;
goto retry_12byte;
}
dlist_length = returned_length + hdr_size;
@@ -4091,8 +4092,6 @@
* byte command.
*/
if (!use_12byte) {
- get_length = true;
- use_12byte = true;
goto retry_12byte;
}
dlist_length = returned_length + hdr_size;
@@ -4108,8 +4107,6 @@
if (!use_12byte
&& (returned_length >=
max_possible_size)) {
- get_length = true;
- use_12byte = true;
goto retry_12byte;
}
dlist_length = returned_length +
@@ -4127,8 +4124,6 @@
} else {
if (!use_12byte
&& (returned_length >= max_possible_size)) {
- get_length = true;
- use_12byte = true;
goto retry_12byte;
}
dlist_length = returned_length + hdr_size;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 12, 5:41 PM (6 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
23633510
Default Alt Text
D40522.diff (2 KB)
Attached To
Mode
D40522: camcontrol: Simplfiy 12-byte retry logic in defects command
Attached
Detach File
Event Timeline
Log In to Comment