-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
zio_dva_throttle_done() should conditionally accept zinjected ZIOs #6384
Conversation
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.
Nice find, and thanks for the patch.
In addition to the inline comments there's a tiny typo in the commit message, s/donot/do not/
. When you refresh this please go ahead and rebase it on master, and before you push it run make check
locally and fix any style issues.
module/zfs/zio.c
Outdated
* fact that we do this in debug bits, we could do with the crude check | ||
* of zio_injection_enabled. | ||
*/ | ||
ASSERT(zio_injection_enabled || !(zio->io_flags & ZIO_FLAG_IO_RETRY)); | ||
ASSERT(!(zio->io_flags & (ZIO_FLAG_IO_REPAIR | ZIO_FLAG_IO_RETRY))); |
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.
You're going to want to remove ZIO_FLAG_IO_RETRY
from this line otherwise you'll still hit the ASSERT.
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.
Oops... missed that out.
module/zfs/zio.c
Outdated
* that the zio is failed because of a zinject rule. Considering the | ||
* fact that we do this in debug bits, we could do with the crude check | ||
* of zio_injection_enabled. | ||
*/ |
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.
Normally I'm all for detailed comments but this one really breaks up the flow of this function. Since the updated ASSERTs are largely self explanatory I think it'd be OK to simply adding this information to the commit message and remove it from here.
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.
Sure. Let me clean that up.
ca29e4f
to
65e18ab
Compare
Thank you for the review Brian ! Updated the fix. I am still ramping up on github usage so might end up making some mistakes :-) |
65e18ab
to
99612aa
Compare
@sanjeevbagewadi no problem. The updated version looks good. If you can squash these two commit and then |
zinject enables ZIO_FLAG_IO_RETRY to ensure FMA events are generated. Allow such ZIOs in zio_dva_throttle_done() and do not fail the ASSERT() for ZIO_FLAG_IO_RETRY. Signed-off-by: Sanjeev Bagewadi <sanjeev.bagewadi@gmail.com>
99612aa
to
225d707
Compare
If fault injection is enabled, the ZIO_FLAG_IO_RETRY could be set by zio_handle_device_injection() to generate the FMA events and update stats. Hence, ignore the flag and process such zios. A better fix would be to add another flag in the zio_t to indicate that the zio is failed because of a zinject rule. However, considering the fact that we do this in debug bits, we could do with the crude check using the global flag zio_injection_enabled which is set to 1 when zinject records are added. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Sanjeev Bagewadi <sanjeev.bagewadi@gmail.com> Closes #6383 Closes #6384
If fault injection is enabled, the ZIO_FLAG_IO_RETRY could be set by zio_handle_device_injection() to generate the FMA events and update stats. Hence, ignore the flag and process such zios. A better fix would be to add another flag in the zio_t to indicate that the zio is failed because of a zinject rule. However, considering the fact that we do this in debug bits, we could do with the crude check using the global flag zio_injection_enabled which is set to 1 when zinject records are added. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Sanjeev Bagewadi <sanjeev.bagewadi@gmail.com> Closes openzfs#6383 Closes openzfs#6384
#6383)
zinject enables ZIO_FLAG_IO_RETRY to ensure FMA events are generated. These ZIOs
could have ZIO_FLAG_IO_ALOCATING set. Hence, conditionally allow such ZIOs in
zio_dva_throttle_done() and do not fail the ASSERT() for ZIO_FLAG_IO_RETRY.
Signed-off-by: Sanjeev Bagewadi sanjeev.bagewadi@gmail.com
Description
If fault injection is enabled, the ZIO_FLAG_IO_RETRY could be set by
zio_handle_device_injection() to generate the FMA events and update
stats. Hence, ignore the flag and process such zios.
A better fix would be to add another flag in the zio_t to indicate
that the zio is failed because of a zinject rule. However, considering the
fact that we do this in debug bits, we could do with the crude check using the
global flag zio_injection_enabled which is set to 1 when zinject records are added.
Motivation and Context
If zinject faults are enabled, it fails the ZIOs and adds the ZIO_FLAG_IO_RETRY flag to ensure that FMA events are raised. And we could have ZIOs with ZIO_FLAG_IO_ALLOCATING enabled. However, for such IOs in the zio_done() when zio_dva_throttle_done() we hit the ASSERT() for ZIO_FLAG_IO_RETRY. We could apply the ASSERT() only if zinject is not enabled.
How Has This Been Tested?
Ran internal tests which do the following :
Without the fix this would have resulted in a panic (one-debug builds). Ensured that with the fix no panic was seen.
NOTE : The cp command ensures that we have ALLOCATING ZIOs generated.
Types of changes
Checklist:
Signed-off-by
.