sysprog21 / simplefs

A simple native file system for Linux kernel
Other
362 stars 91 forks source link

Input/output error #50

Closed HotMercury closed 3 months ago

HotMercury commented 4 months ago

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 commented 4 months ago

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 commented 4 months ago

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 commented 3 months ago

Close via #51