Skip to content

fuse: add FUSE_STATX_LIGHT for stat without recalling DLM grants - #272

Open
hbirth wants to merge 1 commit into
DDNStorage:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1from
hbirth:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1
Open

hbirth wants to merge 1 commit into
DDNStorage:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1from
hbirth:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1

Conversation

@hbirth

@hbirth hbirth commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Under DLM the server owns the size, blocks, mtime and ctime of a file another node writes through its writeback cache. To answer a statx exactly, it has to revoke or downgrade that node's write grant, forcing a flush and a later re-acquire. A plain ls -l, find or monitoring agent on one node can so keep breaking the grant of a writer on another.

Add FUSE_STATX_LIGHT to fuse_statx_in.sx_flags, telling the server that the caller does not need cluster-coherent size, blocks and timestamps and that it may answer from its current values without recalling locks. It is only sent for a user stat() of a regular file without AT_STATX_FORCE_SYNC. Internal attribute updates (SEEK_END, O_APPEND, EOF checks, permission checks, setattr) keep sending full requests.

A light reply may lag behind writes, so it does not update the inode: a stale size must not shrink i_size or the page cache, and i_time, inval_mask and FUSE_I_DLM_LOCKED stay as they were. It only fills the kstat, taking the larger size and the later mtime/ctime of the reply and the inode, so this node still sees its own unflushed writes.

Under DLM the server owns the size, blocks, mtime and ctime of a file
another node writes through its writeback cache.  To answer a statx
exactly, it has to revoke or downgrade that node's write grant, forcing
a flush and a later re-acquire.  A plain ls -l, find or monitoring agent
on one node can so keep breaking the grant of a writer on another.

Add FUSE_STATX_LIGHT to fuse_statx_in.sx_flags, telling the server that
the caller does not need cluster-coherent size, blocks and timestamps
and that it may answer from its current values without recalling locks.
It is only sent for a user stat() of a regular file without
AT_STATX_FORCE_SYNC.  Internal attribute updates (SEEK_END, O_APPEND,
EOF checks, permission checks, setattr) keep sending full requests.

A light reply may lag behind writes, so it does not update the inode:
a stale size must not shrink i_size or the page cache, and i_time,
inval_mask and FUSE_I_DLM_LOCKED stay as they were.  It only fills the
kstat, taking the larger size and the later mtime/ctime of the reply
and the inode, so this node still sees its own unflushed writes.

Signed-off-by: Horst Birthelmer <hbirthelmer@ddn.com>
@hazhou-ddn

Copy link
Copy Markdown

Thanks, Horst, please hold on the merge, and let me create a page to make the whole story clear (from fuse kernel to redfsd client and server), then we can move forward.

@hbirth

hbirth commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

@hazhou-ddn don't worry! I'm not merging this. I am just testing this, so that we know that we have the code and you can see what I meant.

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