The commit is pushed to "branch-rh9-5.14.0-427.106.1.vz9.90.x-ovz" and will 
appear at [email protected]:openvz/vzkernel.git
after rh9-5.14.0-427.106.1.vz9.90.1
------>
commit d1b19123608364d5a874338e344a455fe1b748d6
Author: Vasileios Almpanis <[email protected]>
Date:   Thu Jan 29 11:15:05 2026 +0000

    fs: Export do_ftruncate
    
    export the do_ftruncate function so kernel code
    can use it directly with file handles without having
    to pass the file descriptor number.
    
    https://virtuozzo.atlassian.net/browse/VSTOR-123292
    Signed-off-by: Vasileios Almpanis <[email protected]>
    
    Feature: fix ms/fs
    ======
    Patchset description:
    dm-ploop: truncate helpers cleanup and read-only table fix
    
      - Add a new do_ftruncate() helper that operates directly on a struct
        file, allowing in-kernel callers to truncate files without going
        through file descriptor based interfaces.
      - Export do_ftruncate() so it can be used by other kernel subsystems.
      - Revert the recently introduced vfs_truncate2() helper, which becomes
        redundant after exporting do_ftruncate() and adds unnecessary API
        surface.
      - Fix dm-ploop target constructor logic to avoid preallocating
        clusters when the table is created in read-only mode. Userspace
        may still pass the optional fallo_new_clu argument, but
        preallocation must be skipped for read-only ploop devices.
---
 fs/open.c                | 1 +
 include/linux/fs.h       | 1 +
 kernel/trace/bpf_trace.c | 1 +
 3 files changed, 3 insertions(+)

diff --git a/fs/open.c b/fs/open.c
index b82f5fc333d7f..b166d00e23663 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -184,6 +184,7 @@ long do_ftruncate(struct file *file, loff_t length, int 
small)
 
        return error;
 }
+EXPORT_SYMBOL_GPL(do_ftruncate);
 
 long do_sys_ftruncate(unsigned int fd, loff_t length, int small)
 {
diff --git a/include/linux/fs.h b/include/linux/fs.h
index d57aed2954f7b..9d28258331b4e 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2769,6 +2769,7 @@ static inline long vfs_truncate(const struct path *path, 
loff_t off)
 }
 int do_truncate(struct user_namespace *, struct dentry *, loff_t start,
                unsigned int time_attrs, struct file *filp);
+extern long do_ftruncate(struct file *file, loff_t length, int small);
 extern int vfs_fallocate(struct file *file, int mode, loff_t offset,
                        loff_t len);
 extern long do_sys_open(int dfd, const char __user *filename, int flags,
diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c
index edd750e629016..9a312fb71685f 100644
--- a/kernel/trace/bpf_trace.c
+++ b/kernel/trace/bpf_trace.c
@@ -939,6 +939,7 @@ BTF_ID(func, security_file_open)
 BTF_ID(func, security_path_truncate)
 #endif
 BTF_ID(func, vfs_truncate2)
+BTF_ID(func, do_ftruncate)
 BTF_ID(func, vfs_fallocate)
 BTF_ID(func, dentry_open)
 BTF_ID(func, vfs_getattr)
_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to