From: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
To: Xiao Ni <xni@redhat.com>
Cc: ncroxon@redhat.com, linux-raid@vger.kernel.org
Subject: Re: [PATCH 02/15] mdadm/Grow: fix coverity issue CHECKED_RETURN
Date: Thu, 18 Jul 2024 09:19:48 +0200 [thread overview]
Message-ID: <20240718091948.0000398e@linux.intel.com> (raw)
In-Reply-To: <CALTww2-UHvkCC-r-YS3DD=T79woc+kPvNrubDyfSMJOkZxd+KQ@mail.gmail.com>
On Thu, 18 Jul 2024 10:29:50 +0800
Xiao Ni <xni@redhat.com> wrote:
> > lseek64 errors are unusual, they are exceptional, and I'm fine with logging
> > same error message but I would prefer to avoid repeating same message in
> > code. In case of debug, developer can do some backtracking, starting from
> > this function rather than hunt for the particular error message you used
> > multiple times.
>
> Hi Mariusz
>
> If we use the above way, pr_err only prints the line of code in the
> function lseek64_log_err. We can't know where the error is. pr_err
> prints the function name and code line number. We put pr_err in the
> place where lseek fails, we can know which function and which lseek
> fails. It should be easy for debug. Is it right?
> >
Oh right, I forgot about this from simple reason - I'm never using this.
Line is printed with make CXFLAGS=DDEBUG. If you will enable DEBUG flag then
mdadm will also spam with debug messages (prr_dbg messages). Anyway, you are
right it is an option.
Enabling DDEBUG in the past many times broke my time sensitive reproductions. I
don't like it.
From the top of my head, there is a rule "do not repeat same code". If we can
avoid repeating same error message by wrapping that to function then you will
satisfy my perfectionist sense. That's all.
I'm not going to force you to follow it - you proved that there is a way to
hunt the line by DDEBUG so I'm satisfied.
Thanks,
Mariusz
next prev parent reply other threads:[~2024-07-18 7:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-15 7:35 [PATCH 00/15] mdadm: fix coverity issues Xiao Ni
2024-07-15 7:35 ` [PATCH 01/15] mdadm/Manage: 01r1fail cases fails Xiao Ni
2024-07-16 15:44 ` Mariusz Tkaczyk
2024-07-15 7:35 ` [PATCH 02/15] mdadm/Grow: fix coverity issue CHECKED_RETURN Xiao Ni
2024-07-17 9:33 ` Mariusz Tkaczyk
2024-07-18 2:29 ` Xiao Ni
2024-07-18 7:19 ` Mariusz Tkaczyk [this message]
2024-07-15 7:35 ` [PATCH 03/15] mdadm/Grow: fix coverity issue RESOURCE_LEAK Xiao Ni
2024-07-17 11:29 ` Mariusz Tkaczyk
2024-07-18 3:27 ` Xiao Ni
2024-07-19 9:52 ` Mariusz Tkaczyk
2024-07-15 7:35 ` [PATCH 04/15] mdadm/Grow: fix coverity issue STRING_OVERFLOW Xiao Ni
2024-07-15 7:35 ` [PATCH 05/15] mdadm/Incremental: fix coverity issues Xiao Ni
2024-07-15 7:35 ` [PATCH 06/15] mdadm/mdmon: fix coverity issue CHECKED_RETURN Xiao Ni
2024-07-15 7:35 ` [PATCH 07/15] mdadm/mdmon: fix coverity issue RESOURCE_LEAK Xiao Ni
2024-07-15 7:35 ` [PATCH 08/15] mdadm/mdopen: fix coverity issue CHECKED_RETURN Xiao Ni
2024-07-15 7:35 ` [PATCH 09/15] mdadm/mdopen: fix coverity issue STRING_OVERFLOW Xiao Ni
2024-07-15 7:35 ` [PATCH 10/15] mdadm/mdstat: fix coverity issue CHECKED_RETURN Xiao Ni
2024-07-15 7:36 ` [PATCH 11/15] mdadm/super0: fix coverity issue CHECKED_RETURN and EVALUATION_ORDER Xiao Ni
2024-07-15 7:36 ` [PATCH 12/15] mdadm/super1: fix coverity issue CHECKED_RETURN Xiao Ni
2024-07-15 7:36 ` [PATCH 13/15] mdadm/super1: fix coverity issue DEADCODE Xiao Ni
2024-07-15 7:36 ` [PATCH 14/15] mdadm/super1: fix coverity issue EVALUATION_ORDER Xiao Ni
2024-07-15 7:36 ` [PATCH 15/15] mdadm/super1: fix coverity issue RESOURCE_LEAK Xiao Ni
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=20240718091948.0000398e@linux.intel.com \
--to=mariusz.tkaczyk@linux.intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=ncroxon@redhat.com \
--cc=xni@redhat.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 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).