Skip to content
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

Fixed key error issue in file-disks/disk.py #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

shiv-u
Copy link

@shiv-u shiv-u commented Jun 20, 2020

If the requested list of block addresses contains a block address greater than the computed block of addresses it throws a key error while seeking and the seeking action wouldn’t stop. Fixed this issue in file-disks/disk.py by exiting the program if the requested block is less than the maximum block allowed in InitBlockLayout.
ex:
./disk.py -a 10,20,40 -G.
(without the changes the above command would throw key error 40)
After the changes the program would exit with the following message
Error: The requested block address 40 is greater than the maximum block 35 available.

…ater than the computed block of addresses it throws a key error while seeking and the seeking action wouldn’t stop. Fixed this issue by exiting the program if the requested block is less than the maximum block allowed in InitBlockLayout.
Copy link
Owner

@remzi-arpacidusseau remzi-arpacidusseau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed a bug, or, at least, something to handle more gracefully (one could argue that throwing an uncaught exception is fine...). However, this is not the right place to put checking code. I think the best place might be in MakeRequests(), which is called for normal requests as well as "late" ones, and handles both forms of user-passed in addresses...

@shiv-u
Copy link
Author

shiv-u commented Jun 21, 2020

@remzi-arpacidusseau I wasn't able to get what are late requests. I tried running the following command but it throws key error.
./disk.py -a 10,20 -l 30,31 -G
More information on late requests would help me solve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants