Commit fb3b68f
committed
fbtl/posix: fix data-sieving calculations
as part of introducing atomicity support for ompi v5.0, we also tried to improve the robustness in some file I/O routines.
Unfortunately, this also introduced a bug since ret_code returned by a function does not necessarily contain the number of
bytes read or written,
but could contain the last value (e.g. 0). The value was however used in a subsequent calculation and we ended not copying
data out of the temporary buffer used in the data sieving at all.
This commit also simplifies some of the logic in the while loop, no need to retry to read past the end of the file
multiple times.
Fixes issue #11917
Code was tested with the reproducer provided as part of the issue, our internal testsuite, and the hdf5-1.4.2 testsuite, all tests pass.
Signed-off-by: Edgar Gabriel <edgar.gabriel@amd.com>1 parent d6d175e commit fb3b68f
File tree
2 files changed
+6
-30
lines changed- ompi/mca/fbtl/posix
2 files changed
+6
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
| |||
108 | 107 | | |
109 | 108 | | |
110 | 109 | | |
111 | | - | |
112 | 110 | | |
113 | 111 | | |
114 | 112 | | |
| |||
121 | 119 | | |
122 | 120 | | |
123 | 121 | | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
| 122 | + | |
131 | 123 | | |
132 | 124 | | |
133 | 125 | | |
| |||
206 | 198 | | |
207 | 199 | | |
208 | 200 | | |
209 | | - | |
210 | 201 | | |
211 | 202 | | |
212 | 203 | | |
| |||
218 | 209 | | |
219 | 210 | | |
220 | 211 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 212 | + | |
228 | 213 | | |
229 | 214 | | |
230 | 215 | | |
| |||
236 | 221 | | |
237 | 222 | | |
238 | 223 | | |
239 | | - | |
| 224 | + | |
240 | 225 | | |
241 | 226 | | |
242 | 227 | | |
243 | | - | |
244 | | - | |
| 228 | + | |
| 229 | + | |
245 | 230 | | |
246 | 231 | | |
247 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
| |||
192 | 190 | | |
193 | 191 | | |
194 | 192 | | |
195 | | - | |
196 | 193 | | |
197 | 194 | | |
198 | 195 | | |
| |||
203 | 200 | | |
204 | 201 | | |
205 | 202 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
| 203 | + | |
213 | 204 | | |
214 | 205 | | |
215 | 206 | | |
| |||
0 commit comments