From: Theodore Ts'o <tytso@mit.edu>
To: Andreas Dilger <adilger@dilger.ca>
Cc: ? Wade <wadetregaskis@google.com>, linux-ext4@vger.kernel.org
Subject: Re: Patch adding e2p_feature_to_string
Date: Thu, 18 Dec 2014 22:21:27 -0500 [thread overview]
Message-ID: <20141219032127.GC3474@thunk.org> (raw)
In-Reply-To: <7F6D52D2-77D3-4F64-A1CB-DC43E3CD72D4@dilger.ca>
On Thu, Dec 18, 2014 at 02:58:38PM -0700, Andreas Dilger wrote:
>
> It is really a bad idea to be using a feature bit that isn't at least
> _registered_ in e2fsprogs, even if the full support isn't there, since
> you run a real risk of someone else using that feature bit for some
> completely different feature, and mass problems may result (e.g. e2fsck
> incorrectly thinking it understands the feature when it doesn't).
Well, it can happen if you are fuzz-testing. The other possibility is
that I happen to know that the version of e2fsprogs that Wade was
using is rather old, for hysterical reasons. (We should fix this, and
in fact there had been some suggestions that we fix this for other
reasons, but we've just not gotten around to it.)
> > I can do either, if you insist. What would you prefer:
> >
> > a) Statically defining the various FEATURE_foo strings, as you describe.
> > b) Duplicating the implementation of the two functions so that
> > e2p_feature2string() can retain its prior behaviour of returning a
> > string constant in the common cases.
A third possibiltiy is to change e2p_feature_to_string to only use the
passed-in buffer if it is given an unknown feature, but other times,
it will return a static constant string, just as e2p_feature2string
does today. That is, change the contract of e2p_feature_to_string
such that the buffer MAY be used by e2p_feature_to_string, instead of
MUST be used....
I believe I've seen other cases where the foo_r() version of a foo()
function works in this way; the passed-in buffer is used if it's
necessary for thread-safety, but it is not guaranteed that the buffer
is used; only that foo_r() is thread-safe.
Cheers,
- Ted
prev parent reply other threads:[~2014-12-19 3:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-17 19:27 Patch adding e2p_feature_to_string 👾 Wade
2014-12-17 20:30 ` Andreas Dilger
2014-12-18 0:03 ` 👾 Wade
2014-12-18 5:24 ` Andreas Dilger
2014-12-18 18:23 ` 👾 Wade
2014-12-18 21:58 ` Andreas Dilger
2014-12-19 3:21 ` Theodore Ts'o [this message]
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=20141219032127.GC3474@thunk.org \
--to=tytso@mit.edu \
--cc=adilger@dilger.ca \
--cc=linux-ext4@vger.kernel.org \
--cc=wadetregaskis@google.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).