Date: Tue, 13 Apr 2021 08:25:31 +0900 From: Dominique Martinet <dominique.martinet@...ark-techno.com> To: Rich Felker <dalias@...c.org> Cc: musl@...ts.openwall.com Subject: Re: [PATCH] nftw: implement FTW_ACTIONRETVAL 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 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. > > > >  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
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.