mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Josh Law <objecting@objecting.org>
To: David Gow <david@davidgow.net>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Brendan Higgins <brendan.higgins@linux.dev>,
	Rae Moar <raemoar63@gmail.com>,
	linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 0/8] lib/glob: bug fixes, new features, and tests
Date: Wed, 18 Mar 2026 15:54:10 +0000	[thread overview]
Message-ID: <09BE9997-CA39-4BB6-8271-4767C6BC2943@objecting.org> (raw)
In-Reply-To: <6522d194-12f1-49d2-ba91-ef3e26b49817@davidgow.net>



On 18 March 2026 07:19:53 GMT, David Gow <david@davidgow.net> wrote:
>Le 18/03/2026 à 12:32 AM, Josh Law a écrit :
>> 
>> 
>> On 17 March 2026 07:19:47 GMT, David Gow <david@davidgow.net> wrote:
>>> Hi Josh,
>>> 
>>> Le 16/03/2026 à 5:17 AM, Josh Law a écrit :
>>>> Bug fixes, extensions, and test coverage for lib/glob.c:
>>>> 
>>>> Patches 1-3 fix corner cases in the existing glob_match():
>>>>     - Inverted character class ranges like [z-a] are now normalized
>>>>       instead of silently failing to match.
>>>>     - A trailing backslash is treated as a literal '\' rather than
>>>>       reading past the end of the pattern string.
>>>>     - [^...] is accepted as an alias for [!...] to match the
>>>>       regex-style negation syntax documented in glob(7).
>>>> 
>>>> Patches 4-5 add two new utility functions:
>>>>     - glob_match_nocase() for case-insensitive matching, useful for
>>>>       subsystems like ATA that need case-folded denylist comparisons.
>>>>     - glob_validate() for checking pattern syntax before use, so
>>>>       callers can reject malformed patterns early with a clear error.
>>>> 
>>>> Patches 6-7 add kunit test coverage:
>>>>     - 47 new test cases for glob_match covering escapes, inverted
>>>>       ranges, caret negation, edge cases, and unclosed brackets.
>>>>     - 11 test cases for glob_match_nocase.
>>>>     - 17 test cases for glob_validate.
>>>> 
>>>> Patch 8 adds a real in-tree caller for glob_validate() in the kunit
>>>> executor, validating user-provided filter_glob patterns and returning
>>>> -EINVAL for malformed ones.
>>>> 
>>>> Changes since v3:
>>>>     - Resend: v3 accidentally included stale v2 patch files in the
>>>>       same email thread.  No code changes from v3.
>>>> 
>>>> Changes since v2:
>>>>     - Fixed missing '^' in __glob_match metacharacter comment (patch 4).
>>>>     - Dropped unnecessary braces in glob_validate case '[' (patch 5).
>>>>     - Added real-world example to glob_validate() commit message (patch 5).
>>>> 
>>>> Changes since v1:
>>>>     - Added patch 8 (kunit executor caller for glob_validate).
>>>>     - Updated glob_match_nocase() commit message to reference the ATA
>>>>       denylist as the intended caller (follow-up patch).
>>>> 
>>>> Josh Law (8):
>>>>     lib/glob: normalize inverted character class ranges
>>>>     lib/glob: treat trailing backslash as literal character
>>>>     lib/glob: accept [^...] as character class negation syntax
>>>>     lib/glob: add case-insensitive glob_match_nocase()
>>>>     lib/glob: add glob_validate() for pattern syntax checking
>>>>     lib/tests: add glob test cases for escapes, edge cases, and new
>>>>       features
>>>>     lib/tests: add kunit tests for glob_match_nocase() and glob_validate()
>>>>     kunit: validate glob filter patterns before use
>>>> 
>>>>    include/linux/glob.h   |   2 +
>>>>    lib/glob.c             | 123 ++++++++++++++++++++++++++++++++++++----
>>>>    lib/kunit/executor.c   |  13 +++++
>>>>    lib/tests/glob_kunit.c | 124 +++++++++++++++++++++++++++++++++++++++++
>>>>    4 files changed, 252 insertions(+), 10 deletions(-)
>>>> 
>>> 
>>> Thanks: always good to have better test coverage (and those are some nasty corner cases!)
>>> 
>>> Series is:
>>> 
>>> Acked-by: David Gow <david@davidgow.net>
>>> Tested-by: David Gow <david@davidgow.net>
>>> 
>>> I'm making the assumption that this is going in via mm-nonmm, not the kselftest/kunit tree, as it has dependencies in that branch.
>>> 
>>> Cheers,
>>> -- David
>>> 
>> 
>> 
>> Also, David? You mean the *ENTIRE* series as in the code too (the new functions) Or just your kunit changes
>> 
>
>I only really need to Ack the KUnit changes, but I did test the entire series, so feel free to apply it to all of them.
>
>Cheers,
>-- David
>


Hello David, So the new functions are perfectly fine? I mean code review wise I think they are, and I have tested them with a stash driver..

So I guess also


Tested-by: Josh Law <objecting@objecting.org>

  reply	other threads:[~2026-03-18 15:54 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-15 21:17 Josh Law
2026-03-15 21:18 ` [PATCH v4 1/8] lib/glob: normalize inverted character class ranges Josh Law
2026-03-15 21:18 ` [PATCH v4 2/8] lib/glob: treat trailing backslash as literal character Josh Law
2026-03-15 21:18 ` [PATCH v4 3/8] lib/glob: accept [^...] as character class negation syntax Josh Law
2026-03-15 21:18 ` [PATCH v4 4/8] lib/glob: add case-insensitive glob_match_nocase() Josh Law
2026-03-15 21:18 ` [PATCH v4 5/8] lib/glob: add glob_validate() for pattern syntax checking Josh Law
2026-03-15 21:18 ` [PATCH v4 6/8] lib/tests: add glob test cases for escapes, edge cases, and new features Josh Law
2026-03-15 21:18 ` [PATCH v4 7/8] lib/tests: add kunit tests for glob_match_nocase() and glob_validate() Josh Law
2026-03-15 21:18 ` [PATCH v4 8/8] kunit: validate glob filter patterns before use Josh Law
2026-03-17  7:19 ` [PATCH v4 0/8] lib/glob: bug fixes, new features, and tests David Gow
2026-03-17  7:30   ` Josh Law
2026-03-17 16:32   ` Josh Law
2026-03-18  7:19     ` David Gow
2026-03-18 15:54       ` Josh Law [this message]
2026-03-19 22:23       ` Josh Law

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=09BE9997-CA39-4BB6-8271-4767C6BC2943@objecting.org \
    --to=objecting@objecting.org \
    --cc=akpm@linux-foundation.org \
    --cc=brendan.higgins@linux.dev \
    --cc=david@davidgow.net \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=raemoar63@gmail.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

all inboxes | Powered by JetHome®