mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] netfs: Document the remote size member and its accessors
@ 2026-09-12  7:34 Karl Mehltretter
  2026-09-25 14:13 ` Christian Brauner
  0 siblings, 1 reply; 2+ messages in thread
From: Karl Mehltretter @ 2026-09-12  7:34 UTC (permalink / raw)
  To: David Howells, Paulo Alcantara, Jonathan Corbet
  Cc: Karl Mehltretter, Shuah Khan, Randy Dunlap, Christian Brauner,
	netfs, linux-fsdevel, linux-doc, linux-kernel

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@gmail.com>
---
 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)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] netfs: Document the remote size member and its accessors
  2026-09-12  7:34 [PATCH] netfs: Document the remote size member and its accessors Karl Mehltretter
@ 2026-09-25 14:13 ` Christian Brauner
  0 siblings, 0 replies; 2+ messages in thread
From: Christian Brauner @ 2026-09-25 14:13 UTC (permalink / raw)
  To: David Howells, Paulo Alcantara, Jonathan Corbet, Karl Mehltretter
  Cc: Shuah Khan, Randy Dunlap, netfs, linux-fsdevel, linux-doc, linux-kernel

On Sat, 12 Sep 2026 09:34:44 +0200, Karl Mehltretter wrote:
> netfs: Document the remote size member and its accessors

Applied to the vfs-7.4.netfs branch of the vfs/vfs.git tree.
Patches in the vfs-7.4.netfs branch should appear in linux-next soon.

Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.

It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-7.4.netfs

[1/1] netfs: Document the remote size member and its accessors
      https://git.kernel.org/vfs/vfs/c/afdf722ab983


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-25 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-12  7:34 [PATCH] netfs: Document the remote size member and its accessors Karl Mehltretter
2026-09-25 14:13 ` Christian Brauner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®