linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Javier González" <javier@javigon.com>
To: "Matias Bjørling" <mb@lightnvm.io>
Cc: chansol.kim@samsung.com,
	"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	Matias Bjorling <matias.bjorling@wdc.com>
Subject: Re: [PATCH] lightnvm: pblk: fix bio leak on large sized io
Date: Wed, 30 Jan 2019 16:02:04 +0100	[thread overview]
Message-ID: <1EBBDBD0-E316-4585-A481-51942C75E484@javigon.com> (raw)
In-Reply-To: <5aa5596b-6394-0d09-533b-0365bc064152@lightnvm.io>

[-- Attachment #1: Type: text/plain, Size: 1870 bytes --]


> On 30 Jan 2019, at 15.06, Matias Bjørling <mb@lightnvm.io> wrote:
> 
> On 1/30/19 2:53 AM, 김찬솔 wrote:
>> Changes:
>>  1. Function pblk_rw_io to get bio* as a reference
>>  2. In pblk_rw_io bio_put call on read case removed
>> A fix to address issue where
>>  1. pblk_make_rq calls pblk_rw_io passes bio* pointer as a value (0xA)
>>  2. pblk_rw_io calls blk_queue_split passing bio* pointer as reference
>>  3. In blk_queue_split, when there is a split, the original bio* (0xA)
>>     is passed to generic_make_requests, and the newly allocated bio is
>>     returned
>>  4. If NVM_IO_DONE returned, pblk_make_rq calls bio_endio on the bio*,
>>     that is not the one returned by blk_queue_split
>>  5. As a result bio_endio is not called on the newly allocated bio.
> 
> The commit message needs a bit of massaging. The Changes: paragraph is not needed (that is what the patch is for). Also, please redo the second paragraph in without the bullets.
> 
>> Signed-off-by: chansol.kim <chansol.kim@samsung.com>
>> ---
>>  drivers/lightnvm/pblk-init.c | 22 ++++++++--------------
>>  1 file changed, 8 insertions(+), 14 deletions(-)
>> diff --git a/drivers/lightnvm/pblk-init.c b/drivers/lightnvm/pblk-init.c
>> index b57f764d..4efc929 100644
>> --- a/drivers/lightnvm/pblk-init.c
>> +++ b/drivers/lightnvm/pblk-init.c
>> @@ -31,30 +31,24 @@ static DECLARE_RWSEM(pblk_lock);
>>  struct bio_set pblk_bio_set;
>>    static int pblk_rw_io(struct request_queue *q, struct pblk *pblk,
>> -			  struct bio *bio)
>> +			  struct bio **bio)
> 
> I am not sure why the **bio change is needed. Can you elaborate?

bio_split creates a new bio and queues the original one again. If the
reference is not updated then the newly created bio is never freed when
NVM_IO_DONE is returned to pblk_make_rq(), thus resulting on a leak.

Javier

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-01-30 15:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20190130015343epcms2p14be92e88982e86f5e9d494e3bdc3fb2a@epcms2p1>
2019-01-30  1:53 ` [PATCH] lightnvm: pblk: fix bio leak on large sized io 김찬솔
2019-01-30  6:58   ` Javier González
2019-01-30 14:06   ` Matias Bjørling
2019-01-30 15:02     ` Javier González [this message]
     [not found]     ` <CGME20190130015343epcms2p14be92e88982e86f5e9d494e3bdc3fb2a@epcms2p2>
2019-01-31  5:55       ` Chansol Kim
2019-01-31 21:14   ` Matias Bjørling
2019-02-01  8:22 ` Chansol Kim
2019-02-05  9:23   ` Matias Bjørling
2019-02-05 10:20     ` Javier González
     [not found]     ` <CGME20190130015343epcms2p14be92e88982e86f5e9d494e3bdc3fb2a@epcms2p7>
2019-02-11 11:14       ` Chansol Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1EBBDBD0-E316-4585-A481-51942C75E484@javigon.com \
    --to=javier@javigon.com \
    --cc=chansol.kim@samsung.com \
    --cc=linux-block@vger.kernel.org \
    --cc=matias.bjorling@wdc.com \
    --cc=mb@lightnvm.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).