[PATCH] netfs: Document the remote size member and its accessors

From: Karl Mehltretter

Date: Sat Sep 12 2026 - 03:39:11 EST


netfs_inode.remote_i_size was renamed to _remote_i_size and accessors
were added to prevent torn accesses. The netfs library documentation
still shows the old member name.

Update the struct excerpt and member description. Direct readers to
netfs_read_remote_i_size() and netfs_write_remote_i_size(), and state
that writes require inode->i_lock.

Fixes: 2c8f4742bb76 ("netfs: Fix potential for tearing in ->remote_i_size and ->zero_point")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@xxxxxxxxx>
---
Documentation/filesystems/netfs_library.rst | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Documentation/filesystems/netfs_library.rst b/Documentation/filesystems/netfs_library.rst
index ddd799df6ce363d9c348b4f1e82d66b1b54bf4fd..0c9786ffe19240233ea0d8b725dd8300b9f57759 100644
--- a/Documentation/filesystems/netfs_library.rst
+++ b/Documentation/filesystems/netfs_library.rst
@@ -195,7 +195,7 @@ structure is defined::
struct inode inode;
const struct netfs_request_ops *ops;
struct fscache_cookie * cache;
- loff_t remote_i_size;
+ loff_t _remote_i_size;
unsigned long flags;
...
};
@@ -229,11 +229,14 @@ filesystem:
Local caching cookie, or NULL if no caching is enabled. This field does not
exist if fscache is disabled.

- * ``remote_i_size``
+ * ``_remote_i_size``

The size of the file on the server. This differs from inode->i_size if
local modifications have been made but not yet written back.

+ Use netfs_read_remote_i_size() and netfs_write_remote_i_size() to access
+ this field. Hold inode->i_lock when writing it.
+
* ``flags``

A set of flags, some of which the filesystem might be interested in:
--
2.39.5 (Apple Git-154)