From: Eryu Guan <guaneryu@gmail.com>
To: Dave Chinner <david@fromorbit.com>
Cc: Nikolay Borisov <nborisov@suse.com>,
fstests@vger.kernel.org, Dave Chinner <dchinner@redhat.com>
Subject: Re: [PATCH] common/config: Always create RESULT_BASE
Date: Fri, 4 Jan 2019 17:43:30 +0800 [thread overview]
Message-ID: <20190104094330.GB2803@desktop> (raw)
In-Reply-To: <20190103215609.GU6311@dastard>
On Fri, Jan 04, 2019 at 08:56:09AM +1100, Dave Chinner wrote:
> On Thu, Jan 03, 2019 at 02:29:08PM +0200, Nikolay Borisov wrote:
> >
> >
> > On 3.01.19 г. 12:01 ч., Nikolay Borisov wrote:
> > > Commit 7fc034868d5d ("common/config: create $RESULT_BASE before dumping kmemleak leaks")
> > > inadvertently broke $RESULT_BASE dir creation since it changed the logic
> > > to only create the directory only if this variable is not explicitly set
> > > by the user. Fix this by ensuring RESULT_BASE is always created.
> > >
> > > Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> >
> > Eryu,
> >
> > I think Johannes' commit should actually be reverted. Currently
> > get_next_config is called at the beginning of the section code _AFTER_
> > _init_kmemleak so it's not really fixing the problem that Johannes
> > described. So care to revert his commit ?
>
> Yes, the original commit should be reverted. Using RESULT_BASE in
> the way that init_kmemleak is using it is fundamentally broken.
> Using RESULTS_BASE is incorrect - harness run state is supposed to
> be stored in the section-aware RESULTS_DIR (e.g. see
> _require_scratch()) which is constant and always exists for each
> section that is run.
>
> The code was architectected this way because section definitions can
> change RESULT_BASE, and that means the RESULT_BASE defined when
> init_kmemleak() is called may not point to the same location as when
> check_memleak() is called. Hence check_memleak will never run if a
> section definition changes RESULT_BASE.
>
> IOWs, the init_kmemleak() call needs to be done inside the
> section iteration loop, after the section config has been parsed and
> we've determined if the the section will be run. This is where the
> original code created RESULT_BASE if it didn't exist. Further, all
> the section run state is then stored in RESULTS_DIR, which is
> created from the current RESULT_BASE (e.g. see _require_scratch,
> check_dmesg, etc).
This makes more sense, thanks for the suggestion!
>
> Hence init_kmemleak() and check_kmemleak() should have a scope
> inside a valid RESULT_DIR path. And once this is done, you can then
> add a USE_KMEMLEAK section variable to turn kmemleak detection on
> and off via the config file on a per-section basis.....
>
> So, IMO, the correct thing to do here is revert the original broken
> change and fix the kmemleak infrastructure to be properly aware of
> config sections.
I think we can take Nikolay's patch for now so we don't leave
user-specified RESULT_BASE not created for any longer, and revert it and
7fc034868d5d when we rework kmemleak infrastructure.
Thanks,
Eryu
next prev parent reply other threads:[~2019-01-04 9:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-03 10:01 [PATCH] common/config: Always create RESULT_BASE Nikolay Borisov
2019-01-03 12:29 ` Nikolay Borisov
2019-01-03 15:22 ` Eryu Guan
2019-01-03 21:56 ` Dave Chinner
2019-01-04 9:43 ` Eryu Guan [this message]
2019-01-04 9:54 ` Nikolay Borisov
2019-01-04 13:19 ` Eryu Guan
2019-01-06 17:47 ` Darrick J. Wong
2019-01-06 18:08 ` 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=20190104094330.GB2803@desktop \
--to=guaneryu@gmail.com \
--cc=david@fromorbit.com \
--cc=dchinner@redhat.com \
--cc=fstests@vger.kernel.org \
--cc=nborisov@suse.com \
/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.