-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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: add zpl_drop_inode #16612
Draft
snajpa
wants to merge
2
commits into
openzfs:master
Choose a base branch
from
vpsfreecz:zpl-drop-inode
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Linux: add zpl_drop_inode #16612
Conversation
This file contains 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
snajpa
force-pushed
the
zpl-drop-inode
branch
2 times, most recently
from
October 7, 2024 13:19
f6c80c6
to
08a1cc1
Compare
snajpa
force-pushed
the
zpl-drop-inode
branch
5 times, most recently
from
October 8, 2024 16:45
a87e1db
to
a747e6d
Compare
snajpa
added a commit
to vpsfreecz/zfs
that referenced
this pull request
Oct 8, 2024
Other than openzfs#16612, this is the only place I see where trouble similar to openzfs#16608 could arise. I'm not sure all the supported kernel versions will be okay with these modifications, I'm posting this as a draft to let the bots chew on it to find out. Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
13 tasks
snajpa
added a commit
to vpsfreecz/zfs
that referenced
this pull request
Oct 8, 2024
Other than openzfs#16612, this is the only place I see where trouble similar to openzfs#16608 could arise. I'm not sure all the supported kernel versions will be okay with these modifications, I'm posting this as a draft to let the bots chew on it to find out. Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
This is an attempt to rectify the situation in zfs_zget() on Linux, where we might be racing with inode reclaim from the kernel. The code is ugly and I'm not sure it's perfectly OK to do it this way anyway. I am by no means sure the refcount check is right, lets develop this idea in the open, I'm eager to see what the testbots say here. Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
This should avoid this VERIFY trip: VERIFY3(tx->tx_txg <= spa_final_dirty_txg(os->os_spa)) failed (63 <= 62 PANIC at dbuf.c:2324:dbuf_dirty() Showing stack for process 587858 CPU: 1 PID: 587858 Comm: txg_sync Tainted: P OE 6.10.12- Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian- Call Trace: <TASK> dump_stack_lvl+0x64/0x80 spl_panic+0x100/0x120 [spl] dbuf_dirty+0xd5a/0x1300 [zfs] ? srso_alias_return_thunk+0x5/0xfbef5 ? dmu_buf_will_dirty_impl+0xdf/0x330 [zfs] spa_history_log_sync+0x11e/0x620 [zfs] ? srso_alias_return_thunk+0x5/0xfbef5 ? list_head+0x9/0x30 [zfs] ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? __cv_destroy+0x92/0x250 [spl] ? srso_alias_return_thunk+0x5/0xfbef5 ? mutex_lock+0x12/0x30 dsl_sync_task_sync+0xb9/0x120 [zfs] dsl_pool_sync+0x4c7/0x6a0 [zfs] spa_sync_iterate_to_convergence+0xd8/0x320 [zfs] spa_sync+0x308/0x8e0 [zfs] ? __wake_up+0x44/0x60 txg_sync_thread+0x272/0x3c0 [zfs] ? __pfx_txg_sync_thread+0x10/0x10 [zfs] ? __pfx_thread_generic_wrapper+0x10/0x10 [spl] thread_generic_wrapper+0x66/0x90 [spl] kthread+0xd2/0x100 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x34/0x50 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 </TASK> Signed-off-by: Pavel Snajdr <snajpa@snajpa.net>
snajpa
force-pushed
the
zpl-drop-inode
branch
from
October 10, 2024 01:47
a747e6d
to
b092a3e
Compare
Might be a good idea to wrap the sa buffer hold check in znode hold enter... |
Or not... BUG: scheduling while atomic: z_zrele/1836/0x00000002 |
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.
Motivation and Context
This is an attempt to rectify the situation in zfs_zget() on Linux, where we might be racing with inode reclaim from the kernel.
The code is ugly and I'm not sure it's perfectly OK to do it this way anyway.
Now I'm moderately sure the refcount check is right, but the more eyes it gets the better.
Description
There's now VERIFY-wrapped mandatory
igrab()
inzget()
, because inode lifetime should be guaranteed by the newzpl_drop_inode
super_op. This should simplify reasoning about znode/inode lifetimes as both alloc and drop are defined by zpl_super_operations now.How Has This Been Tested?
Bots + locally (+ hammered by template builds)
Types of changes
Checklist:
Signed-off-by
.