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

On the first vdev open ignore impossible ashift hints #16690

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

amotin
Copy link
Member

@amotin amotin commented Oct 26, 2024

If on the first open device's logical ashift is bigger than set by pool's ashift property, ignore the last as unusable instead of creating vdev that will fail most of I/Os due to misalignment.

How Has This Been Tested?

Before the patch manually created pool with ashift=9 on device with 4KB sector size, which failed immediately.
After the patch created striped and mirrored pools of devices with bigger and smaller sector sizes and observed that pool ashift property value is used only by vdevs where it makes sense.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

If on the first open device's logical ashift is bigger than set
by pool's ashift property, ignore the last as unusable instead of
creating vdev that will fail most of I/Os due to misalignment.

Signed-off-by:  Alexander Motin <[email protected]>
Sponsored by:   iXsystems, Inc.
@amotin
Copy link
Member Author

amotin commented Oct 26, 2024

@ixhamza ^^^

@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Oct 26, 2024
Copy link
Member

@robn robn left a comment

Choose a reason for hiding this comment

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

Looks right, in that it will stop the bad thing happening.

Maybe for another time, but I would like it better if, when the user explicitly supplies an invalid ashift, we error out rather than quietly ignoring it, just so they don't think it worked, and then find it failed later.

@amotin
Copy link
Member Author

amotin commented Oct 27, 2024

I would like it better if, when the user explicitly supplies an invalid ashift, we error out rather than quietly ignoring it, just so they don't think it worked, and then find it failed later.

If pool has devices with different LBS, and the parameter needs to request something in between, strict handling would make it less functional. Plus we already have module parameters for minimum and maximum ashift, and those are also only a hints, ignored if needed. So I prefer it this way.

@amotin amotin merged commit 6187b19 into openzfs:master Oct 29, 2024
20 checks passed
@amotin amotin deleted the small_pool_ashift branch October 29, 2024 19:23
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Nov 1, 2024
If on the first open device's logical ashift is bigger than set
by pool's ashift property, ignore the last as unusable instead of
creating vdev that will fail most of I/Os due to misalignment.

Reviewed-by: Rob Norris <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ameer Hamza <[email protected]>
Signed-off-by:  Alexander Motin <[email protected]>
Sponsored by:   iXsystems, Inc.
Closes openzfs#16690
ixhamza pushed a commit to truenas/zfs that referenced this pull request Nov 11, 2024
If on the first open device's logical ashift is bigger than set
by pool's ashift property, ignore the last as unusable instead of
creating vdev that will fail most of I/Os due to misalignment.

Reviewed-by: Rob Norris <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ameer Hamza <[email protected]>
Signed-off-by:  Alexander Motin <[email protected]>
Sponsored by:   iXsystems, Inc.
Closes openzfs#16690
ptr1337 pushed a commit to CachyOS/zfs that referenced this pull request Nov 14, 2024
If on the first open device's logical ashift is bigger than set
by pool's ashift property, ignore the last as unusable instead of
creating vdev that will fail most of I/Os due to misalignment.

Reviewed-by: Rob Norris <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ameer Hamza <[email protected]>
Signed-off-by:  Alexander Motin <[email protected]>
Sponsored by:   iXsystems, Inc.
Closes openzfs#16690
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants