lkml.org 
[lkml]   [2020]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 1/2] block: add simple copy support
From
Date
On Tue, 2020-12-01 at 11:09 +0530, SelvaKumar S wrote:
> + ret = __blkdev_issue_copy(bdev, dest, nr_srcs, rlist, gfp_mask, flags,
> + &bio);
> + if (!ret && bio) {
> + ret = submit_bio_wait(bio);
> + if (ret == -EOPNOTSUPP)
> + ret = 0;
> +
> + kfree(page_address(bio_first_bvec_all(bio)->bv_page) +
> + bio_first_bvec_all(bio)->bv_offset);
> + bio_put(bio);
> + }
> +
> + return ret;
> +}
I think there is an issue here that if bio_add_page returns error in
__blkdev_issue_copy then ret is -ENOMEM and we never do bio_put for bio
allocated in __blkdev_issue_copy so it is small memory leak.


\
 
 \ /
  Last update: 2020-12-01 11:31    [W:0.079 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site