Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for creating temporary files with O_TMPFILE flag #4932

Open
fourquadrantlogger opened this issue Jun 7, 2024 · 0 comments
Open

Support for creating temporary files with O_TMPFILE flag #4932

fourquadrantlogger opened this issue Jun 7, 2024 · 0 comments
Labels
kind/feature New feature or request priority/wishlist The lowest priority

Comments

@fourquadrantlogger
Copy link

I would like JuiceFS to support the creation of temporary files using the O_TMPFILE flag, as defined in the Linux file system API. This feature allows for the creation of an anonymous, unlinked file that is automatically deleted when closed, providing both a security benefit by not leaving traces in the filesystem and an atomicity guarantee for file creation operations.

Why is this needed?

Security Enhancements

Using O_TMPFILE prevents other processes from accessing the temporary file while it's being written to, as it is never visible in the file system tree. This enhances security by reducing the risk of data leaks or unauthorized access to sensitive information stored temporarily.

Atomicity

It enables atomic write operations, ensuring that either the entire file write operation succeeds, or it fails leaving no partial data behind. This is particularly important in scenarios where data integrity and consistency are paramount.

Efficiency

By automatically cleaning up the file upon close, it reduces the need for manual cleanup code, thereby simplifying application logic and minimizing the potential for resource leaks.

Adding support for O_TMPFILE would align JuiceFS more closely with modern file system capabilities and cater to a broader range of use cases, especially those requiring secure and efficient handling of temporary data.

translate too chinese

我希望 JuiceFS 支持使用 Linux 文件系统 API 中定义的 O_TMPFILE 标志来创建临时文件。这个功能允许创建一个匿名的、未链接的文件,该文件在关闭时会自动删除,既提供了不在文件系统中留下痕迹的安全优势,又保证了文件创建操作的原子性。

为什么需要这个功能?

安全性增强:使用 O_TMPFILE 可以防止其他进程在写入临时文件时访问它,因为它在文件系统树中从不可见。这通过降低数据泄露或未经授权访问临时存储的敏感信息的风险来增强安全性。

原子性:它支持原子写入操作,确保要么整个文件写入操作成功,要么失败而不留下任何部分数据。这在数据完整性和一致性至关重要的场景中尤为重要。

效率:通过在关闭时自动清理文件,减少了对手动清理代码的需求,从而简化了应用程序逻辑并减少了资源泄漏的潜在可能性。

添加对 O_TMPFILE 的支持将使 JuiceFS 更符合现代文件系统的功能,并满足更广泛的使用场景,尤其是那些需要安全高效处理临时数据的场景。

@fourquadrantlogger fourquadrantlogger added the kind/feature New feature or request label Jun 7, 2024
@SandyXSD SandyXSD added the priority/wishlist The lowest priority label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request priority/wishlist The lowest priority
Projects
None yet
Development

No branches or pull requests

2 participants