From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 26034 invoked from network); 12 Apr 2021 23:26:02 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 12 Apr 2021 23:26:02 -0000 Received: (qmail 7658 invoked by uid 550); 12 Apr 2021 23:25:58 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 7631 invoked from network); 12 Apr 2021 23:25:57 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=rw8MnNHB9I5UDJ0pWOhXyHyDeApl6LXC6qjPYTKfD3Q=; b=JV5erWW+3QKfN4Duy/7lnTtp0Q5J3nTKaEebbnd68rU/3h/TDy1rPoBu03njCRkRkA yWsQHysrt5+lId4BsWgLlhboHA6I8MSqsSkcnif4RVUZyqDpqIOEQ1oFlUfft16g0VRS Q7FFL9NjKx7X9LHu4EeRg4ouywRjClCMHwcPXMB6Lr7mzfvJeN7RyprmVbaFynIzOKQ7 8k/CJ9DGa/gqzulsXUe/9u8rG+STMbX7NiEH0PCdc9ssfb0TgL3vJt199skgrn84H10u IuaMZ0+BgLfroUQjjh4GuWufo6E+JBpRrG7WI89SNmkxuYa8EpRwm2KFu9SM8d3lMjCv 0qPA== X-Gm-Message-State: AOAM533zl55oS7aM/j8QKPwhOzofxEjKLQ8JGWrrGPaoXXPKrHD8egrR +CflXCUAX0hW1IPqvw1NoIdVLXWV2IMmsRUdW/pB7wcU697YwYcxPZS72ASm8fFN5Up5vV2HdnE NV2pL37f+cJE75RaTTEQdYw== X-Received: by 2002:a63:ee54:: with SMTP id n20mr12210091pgk.415.1618269943902; Mon, 12 Apr 2021 16:25:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwRwL35nuJdx3RMiRdagirIcgxeup103OZEDdAQAy4tMK5xUiPzcmSCRQBobaGwHs/Z9B3x3A== X-Received: by 2002:a63:ee54:: with SMTP id n20mr12210066pgk.415.1618269943525; Mon, 12 Apr 2021 16:25:43 -0700 (PDT) Date: Tue, 13 Apr 2021 08:25:31 +0900 From: Dominique Martinet To: Rich Felker Cc: musl@lists.openwall.com Message-ID: References: <20210326054456.899700-1-dominique.martinet@atmark-techno.com> <20210412141729.GL2546@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210412141729.GL2546@brightrain.aerifal.cx> Subject: Re: [musl] [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[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