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

Input/output error #50

Closed
HotMercury opened this issue May 8, 2024 · 3 comments
Closed

Input/output error #50

HotMercury opened this issue May 8, 2024 · 3 comments

Comments

@HotMercury
Copy link
Collaborator

HotMercury commented May 8, 2024

If I fill the image with /dev/random, the touch or mkdir command will error.

Reproduce:

$ dd if=/dev/random of=test.img bs=1M count=32
$ ./mkfs.simplefs test.img
$ mkdir test
$ sudo mount -t simplefs -o loop test.img test
$ cd test
$ touch test.txt

The error message comes up, but if I replace /dev/random with `/dev/zero, it will work correctly.
The error message:

touch: cannot touch 'test.txt': Input/output error
@jserv
Copy link
Collaborator

jserv commented May 8, 2024

If I fill the image with /dev/random, command touch or mkdir will error

Did you run mkfs.simplefs before mounting the image file?

@HotMercury
Copy link
Collaborator Author

HotMercury commented May 8, 2024

Yes, following is my detail actions

$ dd if=/dev/random of=test.img bs=1M count=32
$ ./mkfs.simplefs test.img
$ mkdir test
$ sudo mount -t simplefs -o loop test.img test
$ cd test
[test] $ touch test.txt

the error message comes up, but if I replace /dev/random with /dev/zero, it will work correctly.

jserv pushed a commit that referenced this issue May 18, 2024
If we use 'dd if=/dev/random of=test.img bs=1M count=32' rather
than 'if=/dev/zero' and mount it, it will cause an EIO error and
get stuck in a loop.

This commit addresses an issue where the 'ls' command would read random,
meaningless values from 'simplefs_file_ei_block' for uninitialized
blocks. This occurred because the blocks contained residual data,
leading to erroneous outputs.

Changes:
1. Clear the root extent block during the 'mkfs' process to prevent
   erroneous 'simplefs_file_ei_block' data.
2. Ensure that file data blocks are cleared immediately upon
   allocation to prevent erroneous 'simplefs_file' data.

Close #20 and #50
@jserv
Copy link
Collaborator

jserv commented May 18, 2024

Close via #51

@jserv jserv closed this as completed May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants