Commit 2990c89
committed
Merge tag 'netfs-fixes-20211207' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs
Pull netfslib fixes from David Howells:
- Fix a lockdep warning and potential deadlock. This is takes the
simple approach of offloading the write-to-cache done from within a
network filesystem read to a worker thread to avoid taking the
sb_writer lock from the cache backing filesystem whilst holding the
mmap lock on an inode from the network filesystem.
Jan Kara posits a scenario whereby this can cause deadlock[1], though
it's quite complex and I think requires someone in userspace to
actually do I/O on the cache files. Matthew Wilcox isn't so certain,
though[2].
An alternative way to fix this, suggested by Darrick Wong, might be
to allow cachefiles to prevent userspace from performing I/O upon the
file - something like an exclusive open - but that's beyond the scope
of a fix here if we do want to make such a facility in the future.
- In some of the error handling paths where netfs_ops->cleanup() is
called, the arguments are transposed[3]. gcc doesn't complain because
one of the parameters is void* and one of the values is void*.
Link: https://lore.kernel.org/r/20210922110420.GA21576@quack2.suse.cz/ [1]
Link: https://lore.kernel.org/r/Ya9eDiFCE2fO7K/S@casper.infradead.org/ [2]
Link: https://lore.kernel.org/r/20211207031449.100510-1-jefflexu@linux.alibaba.com/ [3]
* tag 'netfs-fixes-20211207' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs:
netfs: fix parameter of cleanup()
netfs: Fix lockdep warning from taking sb_writers whilst holding mmap_lock1 file changed
Lines changed: 8 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
357 | | - | |
358 | | - | |
| 357 | + | |
359 | 358 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
367 | 362 | | |
368 | 363 | | |
369 | 364 | | |
| |||
558 | 553 | | |
559 | 554 | | |
560 | 555 | | |
561 | | - | |
| 556 | + | |
562 | 557 | | |
563 | 558 | | |
564 | 559 | | |
| |||
960 | 955 | | |
961 | 956 | | |
962 | 957 | | |
963 | | - | |
| 958 | + | |
964 | 959 | | |
965 | 960 | | |
966 | 961 | | |
| |||
1191 | 1186 | | |
1192 | 1187 | | |
1193 | 1188 | | |
1194 | | - | |
| 1189 | + | |
1195 | 1190 | | |
1196 | 1191 | | |
1197 | 1192 | | |
| |||
1202 | 1197 | | |
1203 | 1198 | | |
1204 | 1199 | | |
1205 | | - | |
| 1200 | + | |
1206 | 1201 | | |
1207 | 1202 | | |
1208 | 1203 | | |
| |||
0 commit comments