Skip to content

fuse: flush dirty times when a whole-file DLM revoke drops the write … - #277

Merged
hbirth merged 1 commit into
DDNStorage:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1from
hazhou-ddn:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1-revoke-flush
Oct 27, 2026
Merged

hbirth merged 1 commit into
DDNStorage:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1from
hazhou-ddn:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1-revoke-flush

Conversation

@hazhou-ddn

@hazhou-ddn hazhou-ddn commented Oct 27, 2026 •

Copy link
Copy Markdown

Under DLM with the writeback cache, a write takes a write grant, which holds the sattr lock in CW, and file_update_time() only marks the inode's times dirty. When another request needs sattr PR, for example a stat on this or another node, fuse_reverse_inval_inode() writes back and drops the pages, but the dirty times survive the revoke. Close or the flusher sends them later as a WRITEBACK SETATTR. By then this node may hold sattr PR again, and the server has to revoke this node's own PR to grant the SETATTR's CW. In RED-52104 that revoke queued on the node's invalidation thread behind a stuck page-cache invalidation, and the SETATTR hung for more than ten minutes holding an RPC credit.

A sattr revoke always reaches the kernel as a whole-file invalidation. Times are dirtied only under a write grant, so dirty times at a whole-file revoke mean the CW being revoked is this node's. Send them with sync_inode_metadata() after the pages are written back and dropped, while the range lock is still held. The server still sees this node's CW as granted, so the SETATTR's CW is granted past the pending conflicting lock instead of waiting for it, and the node that asked for PR sees this node's times.

…grant

Under DLM with the writeback cache, a write takes a write grant, which
holds the sattr lock in CW, and file_update_time() only marks the
inode's times dirty. When another request needs sattr PR, for example
a stat on this or another node, fuse_reverse_inval_inode() writes back
and drops the pages, but the dirty times survive the revoke. Close or
the flusher sends them later as a WRITEBACK SETATTR. By then this node
may hold sattr PR again, and the server has to revoke this node's own
PR to grant the SETATTR's CW. In RED-52104 that revoke queued on the
node's invalidation thread behind a stuck page-cache invalidation, and
the SETATTR hung for more than ten minutes holding an RPC credit.

A sattr revoke always reaches the kernel as a whole-file invalidation.
Times are dirtied only under a write grant, so dirty times at a whole-file
revoke mean the CW being revoked is this node's. Send them with
sync_inode_metadata() after the pages are written back and dropped,
while the range lock is still held. The server still sees this node's
CW as granted, so the SETATTR's CW is granted past the pending
conflicting lock instead of waiting for it, and the node that asked
for PR sees this node's times.

Signed-off-by: Hai Zhong Zhou <hazhou@ddn.com>
Comment thread fs/fuse/inode.c Resolved
@hbirth

hbirth commented Oct 27, 2026

Copy link
Copy Markdown
Collaborator

interesting hack ... I'm not convinced we need it. What we need is a clear design for meta data. So this can only be a temporary fix.

@hazhou-ddn

Copy link
Copy Markdown
Author

interesting hack ... I'm not convinced we need it. What we need is a clear design for meta data. So this can only be a temporary fix.

Horst, actually the design for metadata was clear for write-back -- that is the mtime should be cached from fuse kernel, and this is the only metadata is updated in fuse kernel. However, the code change like this was missed... So I'm just adding it back.

In summary, for metadata, all metadata should be still responsible by the redfs server, except for mtime from cache writes, and dirtied mtime should be flushed back to redfs server when losing the sattr CW/PW lock -- that should be done in invalidation path for the whole file (whole file invalidation means the sattr CW/PW lock is being revoked).

@hbirth hbirth left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can't do anything about it ... so here we go.

@hbirth
hbirth merged commit 9973e48 into DDNStorage:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1 Oct 27, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants