-
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 compat 4.16: blk_queue_flag_{set,clear} #7431
Conversation
The HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY case was overlooked in the original 10f88c5 commit because blk_queue_write_cache() was available for the in-kernel builds. Update the blk_queue_flag_{set,clear} wrappers to call the locked versions to avoid confusion. This is safe for all existing callers. The blk_queue_set_write_cache() function has been updated to use these wrappers. This means setting/clearing both QUEUE_FLAG_WC and QUEUE_FLAG_FUA is no longer atomic but this only done early in zvol_alloc() prior to any requests so there is no issue. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Issue openzfs#7428
Codecov Report
@@ Coverage Diff @@
## master #7431 +/- ##
==========================================
- Coverage 76.2% 76.12% -0.08%
==========================================
Files 330 330
Lines 104294 104292 -2
==========================================
- Hits 79474 79392 -82
- Misses 24820 24900 +80
Continue to review full report at Codecov.
|
The change to use queue_flag_set instead of queue_flag_set_unlocked causes a warning with lockdep turned on, when zvol_create_minor_impl calls it. :( |
@nivedita76 can you post the warning, and tell us which kernel and distro you are using? |
4.16.2, gentoo |
@nivedita76 is any additional lock dep information logged? The warning posted appears to be a false positive. |
The HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY case was overlooked in the original 10f88c5 commit because blk_queue_write_cache() was available for the in-kernel builds. Update the blk_queue_flag_{set,clear} wrappers to call the locked versions to avoid confusion. This is safe for all existing callers. The blk_queue_set_write_cache() function has been updated to use these wrappers. This means setting/clearing both QUEUE_FLAG_WC and QUEUE_FLAG_FUA is no longer atomic but this only done early in zvol_alloc() prior to any requests so there is no issue. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov> Reviewed-by: Kash Pande <kash@tripleback.net> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#7428 Closes openzfs#7431
The HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY case was overlooked in the original 10f88c5 commit because blk_queue_write_cache() was available for the in-kernel builds. Update the blk_queue_flag_{set,clear} wrappers to call the locked versions to avoid confusion. This is safe for all existing callers. The blk_queue_set_write_cache() function has been updated to use these wrappers. This means setting/clearing both QUEUE_FLAG_WC and QUEUE_FLAG_FUA is no longer atomic but this only done early in zvol_alloc() prior to any requests so there is no issue. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov> Reviewed-by: Kash Pande <kash@tripleback.net> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#7428 Closes openzfs#7431 Requires-spl: openzfs#701
No that’s it. It’s not a false positive as such no? The queue is not locked and that non-unlocked function asserts that the queue is locked when it’s called. |
The HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY case was overlooked in the original 10f88c5 commit because blk_queue_write_cache() was available for the in-kernel builds. Update the blk_queue_flag_{set,clear} wrappers to call the locked versions to avoid confusion. This is safe for all existing callers. The blk_queue_set_write_cache() function has been updated to use these wrappers. This means setting/clearing both QUEUE_FLAG_WC and QUEUE_FLAG_FUA is no longer atomic but this only done early in zvol_alloc() prior to any requests so there is no issue. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov> Reviewed-by: Kash Pande <kash@tripleback.net> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#7428 Closes openzfs#7431
The HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY case was overlooked in the original 10f88c5 commit because blk_queue_write_cache() was available for the in-kernel builds. Update the blk_queue_flag_{set,clear} wrappers to call the locked versions to avoid confusion. This is safe for all existing callers. The blk_queue_set_write_cache() function has been updated to use these wrappers. This means setting/clearing both QUEUE_FLAG_WC and QUEUE_FLAG_FUA is no longer atomic but this only done early in zvol_alloc() prior to any requests so there is no issue. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov> Reviewed-by: Kash Pande <kash@tripleback.net> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#7428 Closes openzfs#7431
The HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY case was overlooked in the original 10f88c5 commit because blk_queue_write_cache() was available for the in-kernel builds. Update the blk_queue_flag_{set,clear} wrappers to call the locked versions to avoid confusion. This is safe for all existing callers. The blk_queue_set_write_cache() function has been updated to use these wrappers. This means setting/clearing both QUEUE_FLAG_WC and QUEUE_FLAG_FUA is no longer atomic but this only done early in zvol_alloc() prior to any requests so there is no issue. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov> Reviewed-by: Kash Pande <kash@tripleback.net> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #7428 Closes #7431
The HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY case was overlooked in the original 10f88c5 commit because blk_queue_write_cache() was available for the in-kernel builds. Update the blk_queue_flag_{set,clear} wrappers to call the locked versions to avoid confusion. This is safe for all existing callers. The blk_queue_set_write_cache() function has been updated to use these wrappers. This means setting/clearing both QUEUE_FLAG_WC and QUEUE_FLAG_FUA is no longer atomic but this only done early in zvol_alloc() prior to any requests so there is no issue. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov> Reviewed-by: Kash Pande <kash@tripleback.net> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes openzfs#7428 Closes openzfs#7431
Description
The HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY case was overlooked in
the original 10f88c5 commit because blk_queue_write_cache()
was available for the in-kernel builds.
Update the blk_queue_flag_{set,clear} wrappers to call the locked
versions to avoid confusion. This is safe for all existing callers.
The blk_queue_set_write_cache() function has been updated to use
these wrappers. This means setting/clearing both QUEUE_FLAG_WC
and QUEUE_FLAG_FUA is no longer atomic but this only done early
in zvol_alloc() prior to any requests so there is no issue.
Motivation and Context
Issue #7428
How Has This Been Tested?
Local build on Fedora Rawhide. Pending full ZTS from buildbot.
Types of changes
Checklist:
Signed-off-by
.