bcachefs: Fix a memory leak in dio write path
Commit c42bca92be928ce7dece5fc04cf68d0e37ee6718 "bio: don't copy bvec for direct IO" changed bio_iov_iter_get_pages() to point bio->bi_iovec at the incoming biovec, meaning if we already allocated one, it'll be leaked. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
This commit is contained in:
parent
120f63e321
commit
2ed5cd508d
@ -2025,7 +2025,9 @@ ssize_t bch2_direct_write(struct kiocb *req, struct iov_iter *iter)
|
||||
}
|
||||
|
||||
bio = bio_alloc_bioset(NULL,
|
||||
iov_iter_npages(iter, BIO_MAX_VECS),
|
||||
iov_iter_is_bvec(iter)
|
||||
? 0
|
||||
: iov_iter_npages(iter, BIO_MAX_VECS),
|
||||
REQ_OP_WRITE,
|
||||
GFP_KERNEL,
|
||||
&c->dio_write_bioset);
|
||||
|
Loading…
x
Reference in New Issue
Block a user