From: Dan Williams <dan.j.williams@intel.com>
To: "Wojcik, Artur" <artur.wojcik@intel.com>
Cc: Neil Brown <neilb@suse.de>, Andre Noll <maan@systemlinux.org>,
"linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
"Ciechanowski, Ed" <ed.ciechanowski@intel.com>
Subject: Re: [patch 0/1][mdadm] Fix needed to enable RAID volumes on SAS devices (version 2).
Date: Wed, 09 Dec 2009 11:12:55 -0700 [thread overview]
Message-ID: <4B1FE8A7.9090806@intel.com> (raw)
In-Reply-To: <1260380511.27877.25.camel@awojcik-linux>
Wojcik, Artur wrote:
>> And I don't like the introduction of a new header file just to store one or 2
>> definitions. Just put new definitions in mdadm.h Keep It Simple.
>
> Sorry but I don't agree. At the moment the source code of mdadm/mdmon is
> not simple.
Adding a new header file for a few definitions does not reduce complexity.
> It's quite complicated. It is hard to analyze how the
> control flows and there's a lot of data and code redundancy in it. In my
> opinion "refactorization" is what this code needs. Splitting code into
> files would be helpful, too.
The current file split is pretty simple and self explanatory. Each
major operating mode of mdadm has its own file.
I will say that there are some long functions like Assemble() that could
use some helper routines to split the major stages. If only to add
documentation points and clarify the current working set of parameters.
That being said I have only had to touch Assemble.c a handful of
times, so the cost-benefit ratio of doing this refactoring never became < 1.
If you find some redundant code that would be a good starting point for
simplification patches.
>> I am perfectly happy with making 'buf' larger as appropriate, even making it
>> PATH_MAX in some cases.
>> I would be happy with more use of asprinf.
>> I would be happy adding checks before certain critical sprintf calls that
>> the result will not exceed the buffer.
>
> I did not use asprintf function, because it's GNU specific. I had an
> impression that one may try to build mdmdm using non-GNU toolchain.
It is safe to assume that mdadm will always run on a system with glibc,
uclibc, or an equivalent library that has an asprintf() implementation.
--
Dan
next prev parent reply other threads:[~2009-12-09 18:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-13 10:43 [patch 1/1][mdadm] Fix needed to enable RAID device creation on SAS devices Wojcik, Artur
2009-11-13 19:35 ` Andre Noll
2009-11-30 15:12 ` [patch 0/1][mdadm] Fix needed to enable RAID volumes on SAS devices (version 2) Artur Wojcik
2009-12-08 5:37 ` Neil Brown
2009-12-09 17:41 ` Artur Wojcik
2009-12-09 18:12 ` Dan Williams [this message]
2009-11-30 15:12 ` [patch 1/1][mdadm] " Artur Wojcik
2009-11-30 19:56 ` Dan Williams
2009-12-01 11:52 ` Artur Wojcik
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=4B1FE8A7.9090806@intel.com \
--to=dan.j.williams@intel.com \
--cc=artur.wojcik@intel.com \
--cc=ed.ciechanowski@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=maan@systemlinux.org \
--cc=neilb@suse.de \
/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).