fix unbalanced page refcounting in bio_map_user_iov
authorVitaly Mayatskikh <v.mayatskih@gmail.com>
Fri, 22 Sep 2017 05:18:39 +0000 (01:18 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 11 Nov 2017 13:34:38 +0000 (13:34 +0000)
commit9ff5d8fe36745867da8a028b3ea58629f7546155
treed7557baea4a0b1936dea03c5a7398ecb798dbf2f
parent90d8668e4ac34a84c52dc5b078af9d982323502c
fix unbalanced page refcounting in bio_map_user_iov

commit 95d78c28b5a85bacbc29b8dba7c04babb9b0d467 upstream.

bio_map_user_iov and bio_unmap_user do unbalanced pages refcounting if
IO vector has small consecutive buffers belonging to the same page.
bio_add_pc_page merges them into one, but the page reference is never
dropped.

Signed-off-by: Vitaly Mayatskikh <v.mayatskih@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/bio.c