Skip to content

[for 26.04_linux-nvidia-bos]: fs/ntfs3: fix mount failure on 64K page-size kernels#451

Closed
jamieNguyenNVIDIA wants to merge 1 commit into
NVIDIA:26.04_linux-nvidia-bosfrom
jamieNguyenNVIDIA:26.04_linux-nvidia-bos
Closed

[for 26.04_linux-nvidia-bos]: fs/ntfs3: fix mount failure on 64K page-size kernels#451
jamieNguyenNVIDIA wants to merge 1 commit into
NVIDIA:26.04_linux-nvidia-bosfrom
jamieNguyenNVIDIA:26.04_linux-nvidia-bos

Conversation

@jamieNguyenNVIDIA
Copy link
Copy Markdown
Collaborator

@jamieNguyenNVIDIA jamieNguyenNVIDIA commented Jun 4, 2026

Summary

Backport linux-next commit b7a9125cac8645245d2473c6c0a50e338280ad23
to fix an ntfs3 mount failure on 64K page-size kernels.

The original failure was reproduced by LTP fsconfig01 using the new mount
API path:

  • fsopen("ntfs")
  • fsconfig(FSCONFIG_CMD_CREATE)
  • kernel ntfs3 driver

On 64K kernels, small NTFS volumes could fail with EINVAL because
log_replay() used PAGE_SIZE for the initial NTFS log page-size probe.
For a 64K kernel this inflated the minimum accepted $LogFile size from
about 200 KiB to about 3.2 MiB. A 300 MiB NTFS filesystem, such as the one
created by LTP fsconfig01, has a smaller log file and was rejected.

The fix makes the initial probe use the NTFS default log page size and makes
read_log_page() pass the actual log page size to ntfs_fix_post_read().

Backport Provenance

The patch cherry-picked cleanly from linux-next.

  • Upstream commit: b7a9125cac8645245d2473c6c0a50e338280ad23
  • 26.04_linux-nvidia-bos commit: 1eeabccaa766806f47ca672795ba092204876904

Test Methodology

  • Test execution: QEMU/KVM aarch64 guest
  • Kernel under test: locally built target branch Image
  • Filesystem module under test: matching locally built ntfs3.ko
  • Test binary: LTP fsconfig01 from LTP 20260130
  • Test mode: LTP_SINGLE_FS_TYPE=ntfs
  • Test device: fresh 300 MiB virtio disk per run
  • Guest page-size assertion:
    • 4K runs verified PAGE_SIZE=4096
    • 64K runs verified PAGE_SIZE=65536

LTP Results

Branch Kernel Page Size LTP fsconfig01 ntfs Result
26.04_linux-nvidia-bos 7.0.0-2008-nvidia-bos 4K PASS: passed 1, failed 0, LTP_EXIT=0
26.04_linux-nvidia-bos 7.0.0-2008-nvidia-bos-64k 64K PASS: passed 1, failed 0, LTP_EXIT=0

Validation Summary

The reported 64K ntfs3 failure is fixed on both target branches: LTP
fsconfig01 now passes for ntfs with PAGE_SIZE=65536.

The same LTP fsconfig01 ntfs test also passes on 4K kernels for both
target branches, so no regression was observed in the fixed ntfs3 code path.

LP: https://bugs.launchpad.net/ubuntu/+source/linux-nvidia-7.0/+bug/2155467

On 64K page-size kernels, mounting NTFS volumes smaller than ~650 MB
fails with EINVAL. The issue is in log_replay(): the initial log page
size probe uses PAGE_SIZE (65536) instead of DefaultLogPageSize (4096)
when PAGE_SIZE exceeds DefaultLogPageSize * 2.

This makes norm_file_page() require the $LogFile to be at least
50 * 65536 = 3.2 MB, but mkfs.ntfs creates a $LogFile of only ~1.5 MB
for a typical 300 MB volume. norm_file_page() returns 0 and the mount
is rejected with EINVAL.

On 4K kernels the #if guard evaluates to true, so use_default=true is
passed and DefaultLogPageSize (4096) is used, requiring only ~200 KB.
This path works fine.

Fix this by always passing use_default=true, which forces the initial
probe to use DefaultLogPageSize regardless of the kernel's PAGE_SIZE.
This is safe because, after reading the on-disk restart area, log_replay()
already re-adjusts log->page_size to match the volume's actual
sys_page_size.

Also fix read_log_page() to pass log->page_size instead of PAGE_SIZE to
ntfs_fix_post_read(), matching the actual buffer size.

Fixes: b46acd6 ("fs/ntfs3: Add NTFS journal")
Tested-by: Matthew R. Ochs <mochs@nvidia.com>
Signed-off-by: Jamie Nguyen <jamien@nvidia.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
(cherry picked from commit b7a9125cac8645245d2473c6c0a50e338280ad23 linux-next)
Signed-off-by: Jamie Nguyen <jamien@nvidia.com>
@nirmoy nirmoy added the help wanted Extra attention is needed label Jun 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 4, 2026

PR Validation Report

Patchscan ✅ No Missing Fixes

All cherry-picked commits checked — no missing upstream fixes found.

PR Lint ❌ Errors found

Details
Checking 1 commits...

Cherry-pick digest:
┌──────────────┬──────────────────────────────────────────────────────────────────┬────────────┬─────────┬───────────────────────────┐
│ Local        │ Referenced upstream / Patch subject                              │ Patch-ID   │ Subject │ SoB chain                 │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 1eeabccaa766 │ [SAUCE] fs/ntfs3: fix mount failure on 64k page-size kernels     │ N/A        │ N/A     │ jamien, alexandr, jamien  │
└──────────────┴──────────────────────────────────────────────────────────────────┴────────────┴─────────┴───────────────────────────┘

Lint results:
E: 1eeabccaa766 ("fs/ntfs3: fix mount failure on 64K page-size kerne"): not SAUCE/UBUNTU/Revert but has no upstream reference trailer (cherry picked from commit ... or backported from ...)

Copy link
Copy Markdown
Collaborator

@nvmochs nvmochs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Acked-by: Matthew R. Ochs <mochs@nvidia.com>

@nirmoy
Copy link
Copy Markdown
Collaborator

nirmoy commented Jun 4, 2026

Boro review

Summary

No issues found across the reviewed commits.

Findings: no problems found

Latest watcher review: open review

Kernel deb build: successful (download debs, 4 files)

Head: 1eeabccaa766

This comment is maintained by nv-pr-bot. It is updated when the GitHub watcher publishes a newer review.

@sforshee
Copy link
Copy Markdown
Collaborator

sforshee commented Jun 4, 2026

Looks good!

Acked-by: Seth Forshee <sforshee@nvidia.com>

@nirmoy nirmoy added has_2_acks and removed help wanted Extra attention is needed has_1_ack labels Jun 4, 2026
@jamieNguyenNVIDIA jamieNguyenNVIDIA force-pushed the 26.04_linux-nvidia-bos branch from 3f0b466 to 1eeabcc Compare June 4, 2026 21:29
@clsotog
Copy link
Copy Markdown
Collaborator

clsotog commented Jun 4, 2026

Acked-by: Carol L Soto <csoto@nvidia.com>

@nvmochs
Copy link
Copy Markdown
Collaborator

nvmochs commented Jun 4, 2026

@nvmochs nvmochs closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants