Commit 13c2493
committed
fix(vfs/posix): various vfs fixes for Linux
While trying to find what could possibly cause files on disk to become corrupted
on Linux I started going through the VFS implementation for Linux and noticed
a few issues.
This fixes a few issues here:
Read/ReadBulk/Write don't try to loop until all of their bytes are written
RenameFile returns `0` on success, while we were checking if it was successful
by checking if it was `!= 0`
GetLength was still reading the buf even though there isn't valid data in it.
See:
https://man7.org/linux/man-pages/man2/write.2.html
https://man7.org/linux/man-pages/man2/read.2.html
https://man7.org/linux/man-pages/man2/pread.2.html
https://man7.org/linux/man-pages/man3/fstat.3p.html
https://man7.org/linux/man-pages/man2/rename.2.html1 parent 2e87af4 commit 13c2493
1 file changed
Lines changed: 69 additions & 6 deletions
Lines changed: 69 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
69 | 92 | | |
70 | 93 | | |
71 | 94 | | |
72 | 95 | | |
73 | 96 | | |
74 | 97 | | |
75 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
76 | 122 | | |
77 | | - | |
| 123 | + | |
78 | 124 | | |
79 | 125 | | |
80 | 126 | | |
81 | 127 | | |
82 | 128 | | |
83 | 129 | | |
84 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
85 | 148 | | |
86 | | - | |
| 149 | + | |
87 | 150 | | |
88 | 151 | | |
89 | 152 | | |
| |||
0 commit comments