[GH-ISSUE #1958] Should mknod be able to create non-regular files under s3fs mount? #990

Open
opened 2026-03-04 01:50:28 +03:00 by kerem · 2 comments
Owner

Originally created by @ggtakec on GitHub (Jun 10, 2022).
Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1958

Currently, creating a regular file with mknod works because FUSE calls the create hook.(See, #1934, #1957)

However, I would like to consider whether it should support files(devices) in other modes(CHARACTER, BLOCK, FIFO, SOCK) that can be created with mknod.

At present, FIFO and SOCK can apparently create a file and have a corresponding correct mode in stat.
However, I don't think it can be operated according to the purpose.

Also, CHARACTER and BLOCK are not even able to set the major and minor numbers of the device, so it looks like the file was created, but the major and minor numbers are always 0.
If CHARACTER and BLOCK are supported, the value of dev_t must be included in the meta header.
And this file is also not internally implemented.

I would like to consider whether these special files should be supported for mounted distributed storage.(ex. use case, required behavior, etc.)

s3fs creates/uses a local cache file when specified the use_cache option, but this cache file is always a regular file.
If we support all file type, we need to create cache files as same as file type by mknod.

In any case, I'd love to know if user really need support for these file types.
And if anyone know the use case, I would like to know it too.
@gaul Please let me know what you think.

Originally created by @ggtakec on GitHub (Jun 10, 2022). Original GitHub issue: https://github.com/s3fs-fuse/s3fs-fuse/issues/1958 Currently, creating a regular file with `mknod` works because FUSE calls the `create` hook.(See, #1934, #1957) However, I would like to consider whether it should support files(devices) in other modes(`CHARACTER`, `BLOCK`, `FIFO`, `SOCK`) that can be created with `mknod`. At present, `FIFO` and `SOCK` can apparently create a file and have a corresponding correct mode in stat. However, I don't think it can be operated according to the purpose. Also, `CHARACTER` and `BLOCK` are not even able to set the major and minor numbers of the device, so it looks like the file was created, but the major and minor numbers are always 0. If `CHARACTER` and `BLOCK` are supported, the value of `dev_t` must be included in the meta header. And this file is also not internally implemented. I would like to consider whether these special files should be supported for mounted distributed storage.(ex. use case, required behavior, etc.) s3fs creates/uses a local cache file when specified the `use_cache` option, but this cache file is always a regular file. If we support all file type, we need to create cache files as same as file type by mknod. In any case, I'd love to know if user really need support for these file types. And if anyone know the use case, I would like to know it too. @gaul Please let me know what you think.
Author
Owner

@gaul commented on GitHub (Jun 19, 2022):

I think this should be OK. I worry about situations where a root mounts s3fs and a different user creates a device file. We should be careful to make sure that we don't allow unexpected permission elevation.

<!-- gh-comment-id:1159622937 --> @gaul commented on GitHub (Jun 19, 2022): I think this should be OK. I worry about situations where a root mounts s3fs and a different user creates a device file. We should be careful to make sure that we don't allow unexpected permission elevation.
Author
Owner

@ggtakec commented on GitHub (Jun 19, 2022):

Yes, I'm worried about that too.
And above all, these files(devices) have not been implemented(Read/Write), which makes them meaningless to s3fs users.
I plan to change the processing of these mknods so that an error occurs.
If it shouldn't be an error, please let me know.

<!-- gh-comment-id:1159626264 --> @ggtakec commented on GitHub (Jun 19, 2022): Yes, I'm worried about that too. And above all, these files(devices) have not been implemented(Read/Write), which makes them meaningless to s3fs users. I plan to change the processing of these mknods so that an error occurs. If it shouldn't be an error, please let me know.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#990
No description provided.