diff options
author | Christian Brauner <brauner@kernel.org> | 2024-04-17 14:49:56 +0300 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-04-17 14:49:56 +0300 |
commit | 193feb69af4c8c8c2e2a178b9f9c2bffff10b860 (patch) | |
tree | f7d87bd744a18af5356ace95128e2b46cce59a2d /include/linux/fs.h | |
parent | c6854e5a267c28300ff045480b5a7ee7f6f1d913 (diff) | |
parent | ad191eb6d6942bb835a0b20b647f7c53c1d99ca4 (diff) | |
download | linux-193feb69af4c8c8c2e2a178b9f9c2bffff10b860.tar.xz |
Merge patch series 'Fix shmem_rename2 directory offset calculation' of https://lore.kernel.org/r/20240415152057.4605-1-cel@kernel.org
Pull shmem_rename2() offset fixes from Chuck Lever:
The existing code in shmem_rename2() allocates a fresh directory
offset value when renaming over an existing destination entry. User
space does not expect this behavior. In particular, applications
that rename while walking a directory can loop indefinitely because
they never reach the end of the directory.
* 'Fix shmem_rename2 directory offset calculation' of https://lore.kernel.org/r/20240415152057.4605-1-cel@kernel.org: (3 commits)
shmem: Fix shmem_rename2()
libfs: Add simple_offset_rename() API
libfs: Fix simple_offset_rename_exchange()
fs/libfs.c | 55 +++++++++++++++++++++++++++++++++++++++++-----
include/linux/fs.h | 2 ++
mm/shmem.c | 3 +--
3 files changed, 52 insertions(+), 8 deletions(-)
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index d376dd7057d5..e5f643e97cfd 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -3353,6 +3353,8 @@ void simple_offset_init(struct offset_ctx *octx); int simple_offset_add(struct offset_ctx *octx, struct dentry *dentry); void simple_offset_remove(struct offset_ctx *octx, struct dentry *dentry); int simple_offset_empty(struct dentry *dentry); +int simple_offset_rename(struct inode *old_dir, struct dentry *old_dentry, + struct inode *new_dir, struct dentry *new_dentry); int simple_offset_rename_exchange(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, |