use notify prune from upstream#137
use notify prune from upstream#137hbirth wants to merge 2 commits intoDDNStorage:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1from
Conversation
4748957 to
d25cddd
Compare
|
@yongzech Please also take a look. |
|
@yongzech your patch contained the explicit invalidation of the fuse cache ... Miklos left that out. He probably relies on some mechanism that the cache will be cleaned anyway. Was there a special reason why you invalidated the fuse cache explicitly? It actually just sets the time to 0. |
d25cddd to
f297a15
Compare
|
fs/fuse/dev.c
Outdated
| case FUSE_NOTIFY_INC_EPOCH: | ||
| return fuse_notify_inc_epoch(fc); | ||
|
|
||
| case FUSE_NOTIFY_PRUNE: |
There was a problem hiding this comment.
We already have libfuse interface for FUSE_NOTIFY_PRUNE ?
There was a problem hiding this comment.
no ... but we have to start at the kernel ... the libfuse code is in a PR
fs/fuse/inode.c
Outdated
| if (S_ISDIR(inode->i_mode)) { | ||
| dentry = d_find_alias(inode); | ||
| if (dentry) { | ||
| shrink_dcache_parent(dentry); |
There was a problem hiding this comment.
But this only remove the children which with ref count is zero?
fs/fuse/inode.c
Outdated
| } | ||
| } | ||
|
|
||
| d_prune_aliases(inode); |
There was a problem hiding this comment.
Same here, only when d_lockref.count is zero. But when lost a lock, we need to invalidate dcache entry
There was a problem hiding this comment.
we do at the moment ... that's why I left that code in
There was a problem hiding this comment.
I think issue with d_invalidate is if it is currently used for for something, which is why Miklos is suggesting shrink_dcache_parent()
There was a problem hiding this comment.
But the problem with shrink_dcache_parent and `d_prune_aliases is that, if another node delete a file whose dcache already cached in this node, then don't invalidate dcache.
Miklos said that he does not want to dehash the dentry ... but I think WE want exactly that ... that's why I think at the moment we need both |
|
Well, let's say something is currently actively using the dentry while it gets invalidated - the racing process would then work with an unhashed dentry. I think the critical call is And there the question is if this couldn't cause a null pointer deref at some point. |
|
@yongzech do we want FUSE_NOTIFY_PRUNE? |
Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com> (cherry picked from commit ad21e5a)
Fix uninterruptible sleep (D state) hangs during FUSE filesystem teardown when using io_uring. The issue manifests as processes stuck waiting for requests that are never completed, particularly affecting force requests like FUSE_FLUSH or when requests are created after fuse_abort_conn() already finished. If on daemon exit io_uring_try_cancel_requests() runs and calls fuse_uring_cancel() which will teardown the entries by calling fuse_uring_entry_teardown() before fuse_abort_conn() then we end up in fuse_uring_abort with queue_refs == 0 and the queues are never stopped. If the queues are stopped all new requests will be rejected, but that does not happen, so all new calls are stuck. Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com> (cherry picked from commit 9550b4d)
f297a15 to
48c9b7a
Compare
No description provided.