block: Add post_release() operation - #1278
Open
blktests-ci-kpd[bot] wants to merge 2 commits into
Open
blktests-ci-kpd[bot] wants to merge 2 commits into
blktests-ci-kpd[bot] wants to merge 2 commits into
Conversation
Author
|
Upstream branch: 893e117 |
blktests-ci-kpd
Bot
force-pushed
the
linus-master_base
branch
from
September 10, 2026 15:29
00cc4ca to
7efd8cd
Compare
Author
|
Upstream branch: 50d05c7 |
blktests-ci-kpd
Bot
force-pushed
the
series/1161240=>linus-master
branch
from
September 10, 2026 15:35
635c630 to
a3023c3
Compare
blktests-ci-kpd
Bot
force-pushed
the
linus-master_base
branch
from
September 12, 2026 02:26
7efd8cd to
a0aeca9
Compare
Author
|
Upstream branch: 5225b8e |
blktests-ci-kpd
Bot
force-pushed
the
series/1161240=>linus-master
branch
from
September 12, 2026 02:30
a3023c3 to
b56095c
Compare
blktests-ci-kpd
Bot
force-pushed
the
linus-master_base
branch
from
September 13, 2026 08:50
a0aeca9 to
772381e
Compare
Author
|
Upstream branch: 2f0c1cf |
blktests-ci-kpd
Bot
force-pushed
the
series/1161240=>linus-master
branch
from
September 13, 2026 09:40
b56095c to
ad49884
Compare
blktests-ci-kpd
Bot
force-pushed
the
linus-master_base
branch
from
September 13, 2026 22:56
772381e to
0224dee
Compare
Author
|
Upstream branch: 2f0c1cf |
added 2 commits
September 13, 2026 23:00
Add post_release() block device operation which provides a hook for performing synchronous cleanup without disk->open_mutex held, which is needed by the loop devices. Real-world container engines, test suites, and system utilities rely on fput() from __loop_clr_fd() being completed when lo_release() returns. But changes which went to the v7.1 merge window broke an assumption that there is no outstanding I/O when __loop_clr_fd() is called, causing NULL pointer dereference problem in lo_rw_aio(). In order to fix this regression, we want to allow __loop_clr_fd() to flush outstanding I/O. But calling drain_workqueue() from __loop_clr_fd() with disk->open_mutex held causes lockdep warnings. We need a mechanism which can flush outstanding I/O without disk->open_mutex held. This post_release() operation is intended for performing only idempotent actions such as flush_work(), for nothing prevents multiple threads from concurrently calling this operation. That is, the loop device schedules a work_struct for calling __loop_clr_fd() from lo_release() where disk->open_mutex is held, and waits for completion of that work_struct using post_release() operation where disk->open_mutex is not held. Also, this post_release() operation is called from only bdev_release() path. This is because loop_configure() is not yet called (there is nothing to clear) if something went wrong between an initialization lo_open() and an error-unwinding lo_release() within the bdev_open() path. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
syzbot is reporting NULL pointer dereference in lo_rw_aio(). An analysis by the Gemini AI collaborator considers that this problem is caused by a timing shift primarily exposed by commit 65565ca ("block: unify the synchronous bi_end_io callbacks"), along with helper refactorings like commit 92c3737 ("block: add a bio_submit_or_kill helper"). But due to difficulty of reproducing this race, discussion about what is happening and how to fix this problem is stalling. Also, we haven't identified how many filesystems are subjected to this problem. Therefore, introduce a grace period for flushing outstanding I/O (which should be a good thing from the perspective of defensive programming) so that we won't hit NULL pointer dereference problem. Since calling drain_workqueue() from __loop_clr_fd() with disk->open_mutex held causes lockdep warnings, schedule lo_clr_work from lo_release() which calls __loop_clr_fd() and wait for completion from lo_post_release(). Link: https://lkml.kernel.org/r/fbb3edda-f108-4e5b-acf2-266f043f8125@I-love.SAKURA.ne.jp Reported-by: syzbot+cd8a9a308e879a4e2c28@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=cd8a9a308e879a4e2c28 Reported-by: syzbot+bc273027d5643e48e5b3@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=bc273027d5643e48e5b3 Depends-on: "block: Add post_release() operation" Fixes: 65565ca ("block: unify the synchronous bi_end_io callbacks") Assisted-by: Gemini-Pro Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
blktests-ci-kpd
Bot
force-pushed
the
series/1161240=>linus-master
branch
from
September 13, 2026 23:00
ad49884 to
e9128cc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request for series with
subject: block: Add post_release() operation
version: 1
url: https://patchwork.kernel.org/series/1161240/