Commit 105549d
netfs: Fix enomem handling in buffered reads
If netfs_read_to_pagecache() gets an error from either ->prepare_read() or
from netfs_prepare_read_iterator(), it needs to decrement ->nr_outstanding,
cancel the subrequest and break out of the issuing loop. Currently, it
only does this for two of the cases, but there are two more that aren't
handled.
Fix this by moving the handling to a common place and jumping to it from
all four places. This is in preference to inserting a wrapper around
netfs_prepare_read_iterator() as proposed by Dmitry Antipov[1].
Link: https://lore.kernel.org/r/[email protected]/ [1]
Fixes: ee4cdf7 ("netfs: Speed up buffered reading")
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=404b4b745080b6210c6c
Signed-off-by: David Howells <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Tested-by: [email protected]
cc: Dmitry Antipov <[email protected]>
cc: Jeff Layton <[email protected]>
cc: [email protected]
cc: [email protected]
Signed-off-by: Christian Brauner <[email protected]>1 parent c8b90d4 commit 105549d
1 file changed
+16
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
| 278 | + | |
| 279 | + | |
284 | 280 | | |
285 | 281 | | |
286 | 282 | | |
287 | 283 | | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
| 284 | + | |
| 285 | + | |
294 | 286 | | |
295 | 287 | | |
296 | 288 | | |
| |||
302 | 294 | | |
303 | 295 | | |
304 | 296 | | |
| 297 | + | |
| 298 | + | |
305 | 299 | | |
306 | 300 | | |
307 | 301 | | |
| |||
310 | 304 | | |
311 | 305 | | |
312 | 306 | | |
| 307 | + | |
| 308 | + | |
313 | 309 | | |
314 | 310 | | |
315 | 311 | | |
| |||
318 | 314 | | |
319 | 315 | | |
320 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
321 | 325 | | |
322 | 326 | | |
323 | 327 | | |
| |||
0 commit comments