mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Dominique Martinet <dominique.martinet@atmark-techno.com>
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com
Subject: Re: [musl] [PATCH] nftw: implement FTW_ACTIONRETVAL
Date: Tue, 13 Apr 2021 08:25:31 +0900	[thread overview]
Message-ID: <YHTW6/I5cSbnmp+2@atmark-techno.com> (raw)
In-Reply-To: <20210412141729.GL2546@brightrain.aerifal.cx>

Rich Felker wrote on Mon, Apr 12, 2021 at 10:17:30AM -0400:
> On Fri, Mar 26, 2021 at 02:44:56PM +0900, Dominique Martinet wrote:
> > nftw is sometimes used with e.g. FTW_SKIP_SUBTREE on linux which
> > requires special handling.
> > 
> > A similar patch was sent in 2018[1] and general feedbacks for nftw
> > seemed positive, but the original work's license was not clear so this
> > implementation was made without using it, looking at the linux man page
> > and comparing with glibc's behaviour through test programs.
> > 
> > [1] https://www.openwall.com/lists/musl/2018/12/16/1
> 
> Feedback for that submission as a whole was negative because it was
> just "throw in everything I found that systemd wanted", which is a
> policy discussion that's already been had and the answer is no.

I agree the original submission was pretty bad, and without any
follow-up to justify individual features I would not have taken anything
from it either.


> However that's not a judgement on any individual feature like
> FTW_ACTIONRETVAL, which could meet criteria for inclusion. I haven't
> gotten a good chance to look at this yet, but if you haven't already,
> could you post some supporting reasons for this (like widespread usage
> by applications that you've found)? That would help determine if it's
> appropriate.

I posted a quick note about users of the feature in the patch comments:
---
 - After checking there doesn't seem to be *that* many users, but there
 still are quite a few, which can be found through debian code search:
 https://codesearch.debian.net/search?q=FTW_SKIP_SUBTREE&literal=1&perpkg=1
 I'm personally interested in this for bpftool (in linux's source tree,
 tools/bpf/bpftool/perf.c ) which uses it to run through /proc/*/fd/*
 skipping unrelated directories, on alpine linux.
---

I would find that pretty hard to call it "widespread usage" (there are
14 distinct packages that use the feature according to the debian
codesearch, 15 if you search for FTW_ACTIONRETVAL instead), probably
because there aren't that many users of ntfw in the first place -- fts*
seems to be more popular, and people who want to do complex things such
as skipping based on pattern might also be enclined to reimplement it as
it is fairly straightforward to... 

For alpine itself, the only main existing patched package I could find
to accomodate for FTW_ACTIONRETVAL was aufs-tools, where the patch just
reimplemented another nftw with the feature for it (it looks like they
also based off musl's implementation); merging this here would allow
dropping that patch and simplify the package maintenance a bit moving
forward.
(There is another in "loolwsd", where they just define the values to
compile but do not implement the behaviour!! So they probably do not
care too much...)

There are other packages from the list that are packaged in alpine, it
looks like for example samba has a baked-in workaround that just skips
trying to use FTW_ACTIONRETVAL if the value is not defined, I assume
they handle it gracefully and the result is just less performant code
but I did not look further.



All in all I just had a particular usecase in mind (linux's bpftool) and
selfishly picked the least intrusive change (reworking bpftool to use
something else would be slightly more changes), thinking at the time others
would benefit from it before checking thoroughly.
Now there is more data I am really open to both ways of thinking (this
should be implemented in musl vs. this should be worked around in
alpine) and just bumped the thread yesterday to move forward in the
later case.


Thanks,
-- 
Dominique



      reply	other threads:[~2021-04-12 23:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26  5:44 Dominique Martinet
2021-04-12  5:53 ` [musl] " Dominique Martinet
2021-04-12  6:09 ` [musl] " Ariadne Conill
2021-04-12  6:45   ` Dominique Martinet
2021-04-12 14:17 ` Rich Felker
2021-04-12 23:25   ` Dominique Martinet [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=YHTW6/I5cSbnmp+2@atmark-techno.com \
    --to=dominique.martinet@atmark-techno.com \
    --cc=dalias@libc.org \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).