block: fix page leak by merging to same page
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest2 patches 0 repliesNew
- v22 patches 5 repliesSuperseded
- v12 patches 1 replySuperseded
Changes in v3 from the cover letter
- avoid to call __bio_try_merge_page() two times
- add comment on the two new flags
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | block: introduce 'enum bvec_merge_flags' for __bio_try_merge_pageblock/ fs/ fs/ +1 more | +29 | 0 replies | |
| 2/2 | block: fix page leak in case of merging to same pageblock/ include/ | +18 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH V3 0/2] block: fix page leak by merging to same page
Hi,
'pages' retrived by __bio_iov_iter_get_pages() may point to same page, and finally they can be merged to the same page in bio_add_page(), then page leak can be caused because bio_release_pages() only drops the page ref once.
Fixes this issue by dropping the extra page ref.
V3:
- avoid to call __bio_try_merge_page() two times
- add comment on the two new flags
V2:
- V1 breaks multi-page merge, and fix it and only put the page ref if the added page is really the 'same page'
Ming Lei (2):
block: introduce 'enum bvec_merge_flags' for __bio_try_merge_page
block: fix page leak in case of merging to same page
block/bio.c | 32 ++++++++++++++++++++++---------- fs/iomap.c | 3 ++- fs/xfs/xfs_aops.c | 3 ++- include/linux/bio.h | 22 +++++++++++++++++++++- 4 files changed, 47 insertions(+), 13 deletions(-)
Signature · 1 line
2.20.1