All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: "Darrick J. Wong" <darrick.wong@oracle.com>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/3] xfs_scrub: implement deferred description string rendering
Date: Wed, 6 Nov 2019 13:47:19 -0600	[thread overview]
Message-ID: <f9ebec79-4a46-c98d-026e-8b803aea8752@sandeen.net> (raw)
In-Reply-To: <20191106155148.GI4153244@magnolia>



On 11/6/19 9:51 AM, Darrick J. Wong wrote:
>> but it's not clear to me, if, this is the case, who is responsible to
>> free up the memory previously associated with the dsc->where pointer
>> here, and so, it just feels like a potential memory leak landmine
>> here.
> It's the caller's responsibility.  So far all three callers passed in
> pointers local stack variables, so the variable and the @dsc disappear
> into the aether when the function returns.
> 
>> Maybe I've got confused by the comment or didn't fully understand your
>> intention here.
> Nah, the problem is that the comment is unclear.  How about:
> 
> /*
>  * Set a new location context for this deferred-rendering string.
>  * The caller is responsible for freeing the old context, if necessary.
>  */

LGTM, maybe "if any" to indicate there may not be (probably is not) an
old context.

> Question: does this API need to return the old context?  For now the
> void return is fine under the "YAGNI" principle, since we can always add
> it later if the usage pattern changes.

Can't imagine why you'd need the old one....
 
W/ the comment-flogging,

Reviewed-by: Eric Sandeen <sandeen@redhat.com>

  reply	other threads:[~2019-11-06 19:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-22 18:49 [PATCH 0/3] xfs_scrub: deferred labelling to save time Darrick J. Wong
2019-10-22 18:49 ` [PATCH 1/3] xfs_scrub: bump work_threads to include the controller thread Darrick J. Wong
2019-10-22 18:49 ` [PATCH 2/3] xfs_scrub: implement deferred description string rendering Darrick J. Wong
2019-11-06 10:38   ` Carlos Maiolino
2019-11-06 15:51     ` Darrick J. Wong
2019-11-06 19:47       ` Eric Sandeen [this message]
2019-10-22 18:49 ` [PATCH 3/3] xfs_scrub: adapt phase5 to deferred descriptions Darrick J. Wong
2019-11-06 20:00   ` Eric Sandeen
  -- strict thread matches above, loose matches on Subject: below --
2019-09-25 21:37 [PATCH 0/3] xfs_scrub: deferred labelling to save time Darrick J. Wong
2019-09-25 21:37 ` [PATCH 2/3] xfs_scrub: implement deferred description string rendering Darrick J. Wong
2019-09-06  3:40 [PATCH 0/3] xfs_scrub: deferred labelling to save time Darrick J. Wong
2019-09-06  3:40 ` [PATCH 2/3] xfs_scrub: implement deferred description string rendering Darrick J. Wong
2019-08-26 21:32 [PATCH 0/3] xfs_scrub: deferred labelling to save time Darrick J. Wong
2019-08-26 21:32 ` [PATCH 2/3] xfs_scrub: implement deferred description string rendering Darrick J. Wong

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=f9ebec79-4a46-c98d-026e-8b803aea8752@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.