[RFC PATCH 2/6 6.6] libfs: Add simple_offset_empty()

2024-11-10 Thread cel
From: Chuck Lever [ Upstream commit ecba88a3b32d733d41e27973e25b2bc580f64281 ] For simple filesystems that use directory offset mapping, rely strictly on the directory offset map to tell when a directory has no children. After this patch is applied, the emptiness test holds only the RCU read lo

[RFC PATCH 1/6 6.6] libfs: Define a minimum directory offset

2024-11-10 Thread cel
From: Chuck Lever [ Upstream commit 7beea725a8ca412c6190090ce7c3a13b169592a1 ] This value is used in several places, so make it a symbolic constant. Reviewed-by: Jan Kara Signed-off-by: Chuck Lever Link: https://lore.kernel.org/r/170820142741.6328.12428356024575347885.st...@91.116.238.104.ho

[RFC PATCH 6/6 6.6] libfs: fix infinite directory reads for offset dir

2024-11-10 Thread cel
5c5f ("shmem: stable directory offsets") Signed-off-by: yangerkun Link: https://lore.kernel.org/r/20240731043835.1828697-1-yanger...@huawei.com Reviewed-by: Chuck Lever [brauner: only update last_index after seek when offset is zero like Jan suggested] Signed-off-by: Christian Brau

[RFC PATCH 5/6 6.6] shmem: Fix shmem_rename2()

2024-11-10 Thread cel
From: Chuck Lever [ Upstream commit ad191eb6d6942bb835a0b20b647f7c53c1d99ca4 ] When renaming onto an existing directory entry, user space expects the replacement entry to have the same directory offset as the original one. Link: https://gitlab.alpinelinux.org/alpine/aports/-/issues/15966 Fixes:

[RFC PATCH 3/6 6.6] libfs: Fix simple_offset_rename_exchange()

2024-11-10 Thread cel
ned-off-by: Chuck Lever Link: https://lore.kernel.org/r/20240415152057.4605-2-...@kernel.org Signed-off-by: Christian Brauner [ cel: adjusted to apply to origin/linux-6.6.y ] Signed-off-by: Chuck Lever --- fs/libfs.c | 25 +++-- 1 file changed, 19 insertions(+), 6 deletions(-)

[RFC PATCH 0/6 6.6] Address rename/readdir bugs in fs/libfs.c

2024-11-10 Thread cel
r this set looks stable. I'm interested in hearing review comments and test results. Branch for testing: https://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git/log/?h=nfsd-6.6.y Chuck Lever (5): libfs: Define a minimum directory offset libfs: Add simple_offset_empty

[RFC PATCH 4/6 6.6] libfs: Add simple_offset_rename() API

2024-11-10 Thread cel
From: Chuck Lever [ Upstream commit 5a1a25be995e1014abd01600479915683e356f5c ] I'm about to fix a tmpfs rename bug that requires the use of internal simple_offset helpers that are not available in mm/shmem.c Signed-off-by: Chuck Lever Link: https://lore.kernel.org/r/20240415152057.4605-3-...@k