-
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
linux/zvol_os: fix zvol queue limits initialization #16454
Conversation
zvol queue limits initialization depends on `zv_volblocksize`, but it is initialized later, leading to several limits being initialized with incorrect values, including `max_discard_*` limits. This also causes `blkdiscard` command to consistently fail, as `blk_ioctl_discard` reads `bdev_max_discard_sectors()` limits as 0, leading to failure. The fix is straightforward: initialize `zv->zv_volblocksize` early, before setting the queue limits. This PR should fix `zvol/zvol_misc/zvol_misc_trim` failure on recent PRs, as the test case issues `blkdiscard` for a zvol. Additionally, `zvol_misc_trim` was recently enabled in `6c7d41a`, which is why the issue wasn't identified earlier. Signed-off-by: Ameer Hamza <[email protected]>
@ixhamza just wanted to let you know that the Fedora buildbots are basically down until #16450 and #16453 get merged (#16453 actually contains both the needed commits). You can either include those in your patchstack if you want a clean buildbot run (and we'll ignore them when merging this PR), or just wait until they get merged and re-base. |
@tonyhutter - Thanks for the update. This can wait. Once #16453 is merged, I’ll rebase. |
@ixhamza merged, please go ahead and rebase this. |
@ixhamza never mind, I see we got a clean run with the GitHub actions builders and this is a straightforward fix. Merged. |
@behlendorf - Sorry, I just saw your message. Thanks for the quick merge. |
@ixhamza would you mind taking another look at this. It looks like we're still failing the |
@behlendorf - It's another issue in the zvol queue limits initialization. truenas@3af5c63 should fix it. I will open a PR once it passes GitHub actions in my repository. |
zvol queue limits initialization depends on `zv_volblocksize`, but it is initialized later, leading to several limits being initialized with incorrect values, including `max_discard_*` limits. This also causes `blkdiscard` command to consistently fail, as `blk_ioctl_discard` reads `bdev_max_discard_sectors()` limits as 0, leading to failure. The fix is straightforward: initialize `zv->zv_volblocksize` early, before setting the queue limits. This PR should fix `zvol/zvol_misc/zvol_misc_trim` failure on recent PRs, as the test case issues `blkdiscard` for a zvol. Additionally, `zvol_misc_trim` was recently enabled in `6c7d41a`, which is why the issue wasn't identified earlier. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Signed-off-by: Ameer Hamza <[email protected]> Closes openzfs#16454
Motivation and Context
zvol queue limits initialization depends on
zv_volblocksize
, but it is initialized later, leading to several limits being initialized with incorrect values, includingmax_discard_*
limits. This also causesblkdiscard
command to consistently fail, asblk_ioctl_discard
readsbdev_max_discard_sectors()
limits as 0, leading to failure. The fix is straightforward: initializezv->zv_volblocksize
early, before setting the queue limits.This PR should fix
zvol/zvol_misc/zvol_misc_trim
failure on recent PRs, as the test case issuesblkdiscard
for a zvol. Additionally,zvol_misc_trim
was recently enabled in 6c7d41a, which is why the issue wasn't identified earlier.Description
How Has This Been Tested?
Before
After
Types of changes
Checklist:
Signed-off-by
.