summaryrefslogtreecommitdiff
path: root/LICENSES
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2019-09-20 16:32:19 +0100
committerDavid Howells <dhowells@redhat.com>2019-11-15 16:22:54 +0000
commita194dfe6e6f6f7205eea850a420f2bc6a1541209 (patch)
tree5a3a0aa3ac86e1f73ee347b7ab28d3e86a4dda39 /LICENSES
parent8446487feba988a92e7649c60367510f0b0445a8 (diff)
pipe: Rearrange sequence in pipe_write() to preallocate slot
Rearrange the sequence in pipe_write() so that the allocation of the new buffer, the allocation of a ring slot and the attachment to the ring is done under the pipe wait spinlock and then the lock is dropped and the buffer can be filled. The data copy needs to be done with the spinlock unheld and irqs enabled, so the lock needs to be dropped first. However, the reader can't progress as we're holding pipe->mutex. We also need to drop the lock as that would impact others looking at the pipe waitqueue, such as poll(), the consumer and a future kernel message writer. We just abandon the preallocated slot if we get a copy error. Future writes may continue it and a future read will eventually recycle it. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'LICENSES')
0 files changed, 0 insertions, 0 deletions