Eric Dumazet 047fe36052 splice: fix racy pipe->buffers uses
Dave Jones reported a kernel BUG at mm/slub.c:3474! triggered
by splice_shrink_spd() called from vmsplice_to_pipe()

commit 35f3d14dbbc5 (pipe: add support for shrinking and growing pipes)
added capability to adjust pipe->buffers.

Problem is some paths don't hold pipe mutex and assume pipe->buffers
doesn't change for their duration.

Fix this by adding nr_pages_max field in struct splice_pipe_desc, and
use it in place of pipe->buffers where appropriate.

splice_shrink_spd() loses its struct pipe_inode_info argument.

Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Tom Herbert <therbert@google.com>
Cc: stable <stable@vger.kernel.org> # 2.6.35
Tested-by: Dave Jones <davej@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2012-06-13 21:16:42 +02:00
..
2012-05-29 23:28:34 -04:00
2012-05-29 23:28:34 -04:00
2012-05-28 09:54:45 -07:00
2012-05-29 23:28:33 -04:00
2012-05-28 09:54:45 -07:00
2012-05-28 09:54:45 -07:00
2012-06-01 10:12:15 -07:00
2012-05-29 23:28:33 -04:00
2012-05-28 09:54:45 -07:00
2012-05-29 23:28:33 -04:00
2012-05-29 23:28:40 -04:00
2012-05-28 09:54:45 -07:00
2012-03-20 21:29:52 -04:00
2012-03-20 21:29:38 -04:00
2012-03-30 17:31:56 -07:00
2012-05-28 09:54:45 -07:00
2012-05-29 23:28:32 -04:00
2012-05-29 23:28:33 -04:00
2012-05-28 09:54:45 -07:00
2012-05-29 16:22:23 -07:00
2012-03-20 21:29:46 -04:00
2012-03-20 21:29:46 -04:00
2012-05-28 09:54:45 -07:00
2012-05-29 23:28:41 -04:00
2012-06-01 12:12:00 -04:00
2012-05-29 23:28:31 -04:00
2012-03-20 21:29:38 -04:00
2012-05-29 23:28:41 -04:00
2012-05-29 23:28:41 -04:00
2012-06-13 21:16:42 +02:00
2012-05-29 23:28:29 -04:00