Re: lib: treat ntfs3 as ntfs in filesystem skiplists

[email protected]
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi XiaoLei,

On Thu Jun 4 19:01:38 2026 +0800, XiaoLei Wu wrote:
> lib: treat ntfs3 as ntfs in filesystem skiplists

> +       if (!strcmp(fs_type, "ntfs3"))
> +               fs_type = "ntfs";
> +
>         if (!skiplist)
>                 return 0;
> 
>         for (i = 0; skiplist[i]; i++) {
>                 if (!strcmp(fs_type, skiplist[i]))
>                         return 1;

The mapping is one-directional: ntfs3 is remapped to ntfs before the
loop, so a skiplist containing "ntfs3" (without "ntfs") will no longer
match.

For example, a test calling:

  tst_get_supported_fs_types((const char *const []){ "ntfs3", NULL });

expects ntfs3 to be excluded, but after this change the lookup
compares "ntfs" against "ntfs3" in the list and returns 0, so ntfs3
is not skipped.

No test in the tree has this pattern today, so there is no immediate
regression. But the API contract of tst_fs_in_skiplist has changed
silently: passing "ntfs3" in a skiplist no longer skips ntfs3.

Is that intentional? If the design decision is "callers must use
'ntfs' to cover both drivers", then a code comment on
tst_fs_in_skiplist (and perhaps on tst_get_supported_fs_types) to
that effect would make the contract clear and prevent future callers
from hitting this silently.

Alternatively, normalising on both sides of the comparison would
preserve the old contract while adding the new ntfs-covers-ntfs3
behaviour:

  for (i = 0; skiplist[i]; i++) {
          const char *entry = skiplist[i];
          if (!strcmp(entry, "ntfs3"))
                  entry = "ntfs";
          if (!strcmp(fs_type, entry))
                  return 1;
  }

Verdict: Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.