Repository navigation
Fix: parse.c opt_len() to use minimal distance to delimiter to determine option length - #1924
Conversation
|
Tested by running following options:
|
|
(Please don't worry about the Windows build failures. It looks like Cygwin now provides functions for nanosleep and clock_gettime (when it didn't in the past) so we'll have to think about how to test for those such that we only provide the fallbacks if they aren't implemented. nanosleep will be easy enough but clock_gettime will be trickier) |
sitsofe
left a comment
There was a problem hiding this comment.
This looks good code-wise. My next request is could you squash all these changes down to one commit and force push to update this branch? We're more interested in the final product than how you got there when we merge :-)
2895e99 to
eb5d564
Compare
|
Unnecessary commits are squashed and commit message cleaned |
sitsofe
left a comment
There was a problem hiding this comment.
@leonid-kozlov one minor quibble:
Looking at the commit with git log --pretty=fuller I see this:
Author: leonid-kozlov <[hidden]@gmail.com>
AuthorDate: Wed Jun 18 10:54:46 2025 +0300
Commit: lkozlov <[hidden]@aubmc.local>
CommitDate: Thu Jun 19 16:55:34 2025 +0300
Would you be able to set the git username to your "Firstname Lastname" and your email to your gmail in both cases? Beyond that LGTM!
eb5d564 to
51796ae
Compare
Use minimal distance to delimiter to determine option length Current implementation of opt_len() makes impossible to locate option name in random_distribution zones list combining ':' and ',' chars. opt_len() function should try to locate option name by all possible delimiters and return minimal length one instead of returning first found. Fixes: axboe#1923 Signed-off-by: Leonid Kozlov <leonid.e.kozlov@gmail.com>
51796ae to
7d24088
Compare
|
Fixed commit signature |
sitsofe
left a comment
There was a problem hiding this comment.
@leonid-kozlov Perfect, thank you for making the changes.
@axboe can you pull this (I think @vincentkfu is currently on holiday)?
|
Thanks to @leonid-kozlov for the fix and to @sitsofe for reviewing! |
Use minimal distance to delimiter to determine option length
Current implementation of
opt_len()function is using array of possible delimiters for option name search.They are
{',', ':'}.The loop at
fio/parse.c
Line 484 in 813445e
This causes
__handle_option()function to falsely include into option name all chars up to first ',' ignoring any ':' chars.Resulting not possible to parse options like
zoned:50/5:30/15:20/,50/10:50/90.Fixes: #1923
Signed-off-by: Leonid Kozlov leonid.e.kozlov@gmail.com