From: Jens Axboe <axboe@kernel.dk>
To: linux-btrace@vger.kernel.org
Subject: Re: [PATCH] btreplay: fix device IO remap functionality
Date: Mon, 16 Sep 2019 16:31:03 +0000 [thread overview]
Message-ID: <8f89cc40-5b47-e6e0-9b90-a523299ae52d@kernel.dk> (raw)
In-Reply-To: <CALrw=nGNOAibEAU5q9S=caPmgdoJzHDkLeR+Dk+M772m4yasiw@mail.gmail.com>
On 9/16/19 9:39 AM, Ignat Korchagin wrote:
> Commit dd093eb1c48e ("Fix warnings on newer gcc") moved string buffers holding
> device names during map file parse stage to stack. However, only pointers to
> them are being stored in the allocated "struct map_dev" structure. These
> pointers are invalid outside of scope of this function and in a different
> thread context. Also "release_map_devs" function still tries to "free" them
> later as if they were allocated on the heap.
>
> Moving the buffers back to the heap by instructing "fscanf" to allocate them
> while parsing the file.
>
> Alternatively, we could redefine the "struct map_dev" to include the whole
> buffers instead of just pointers to them and free them as part of releasing the
> whole "struct map_dev".
Applied - but by hand, your patch is corrupted, it has mangled whitespace.
--
Jens Axboe
next prev parent reply other threads:[~2019-09-16 16:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-16 15:39 [PATCH] btreplay: fix device IO remap functionality Ignat Korchagin
2019-09-16 16:31 ` Jens Axboe [this message]
2019-09-16 17:12 ` Ignat Korchagin
2019-09-16 17:15 ` Jens Axboe
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=8f89cc40-5b47-e6e0-9b90-a523299ae52d@kernel.dk \
--to=axboe@kernel.dk \
--cc=linux-btrace@vger.kernel.org \
/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