[for 26.04_linux-nvidia]: fs/ntfs3: fix mount failure on 64K page-size kernels#450
Conversation
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>
PR Validation ReportPatchscan ✅ No Missing FixesAll cherry-picked commits checked — no missing upstream fixes found. PR Lint ❌ Errors foundDetailsChecking 1 commits...
Cherry-pick digest:
┌──────────────┬──────────────────────────────────────────────────────────────────┬────────────┬─────────┬───────────────────────────┐
│ Local │ Referenced upstream / Patch subject │ Patch-ID │ Subject │ SoB chain │
├──────────────┼──────────────────────────────────────────────────────────────────┼────────────┼─────────┼───────────────────────────┤
│ 0ce2a315dced │ [SAUCE] fs/ntfs3: fix mount failure on 64k page-size kernels │ N/A │ N/A │ jamien, alexandr, jamien │
└──────────────┴──────────────────────────────────────────────────────────────────┴────────────┴─────────┴───────────────────────────┘
Lint results:
E: 0ce2a315dced ("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 ...)
|
nvmochs
left a comment
There was a problem hiding this comment.
LGTM!
Acked-by: Matthew R. Ochs <mochs@nvidia.com>
|
Looks good!
|
Boro reviewSummaryNo issues found across the reviewed commits. Findings: no problems found Latest watcher review: open review Kernel deb build: successful (download debs, 4 files) Head: This comment is maintained by nv-pr-bot. It is updated when the GitHub watcher publishes a newer review. |
|
I got this from codex: |
47b075c to
0ce2a31
Compare
I think this is a pre-existing bug in the log replay page-size adjustment path: one_page_buf is allocated before log_replay() may adopt the on-disk log page size, and the existing code does not resize it after that adjustment. This patch changes the initial 64K-kernel replay page size from PAGE_SIZE to DefaultLogPageSize, so it can make that pre-existing issue reachable on 64K kernels when replaying a log whose on-disk page size is larger than 4K. I think I'll need to send another fix to the mailing list... |
I see no further issues from me then. |
Summary
Backport linux-next commit
b7a9125cac8645245d2473c6c0a50e338280ad23to fix an
ntfs3mount failure on 64K page-size kernels.The original failure was reproduced by LTP
fsconfig01using the new mountAPI path:
fsopen("ntfs")fsconfig(FSCONFIG_CMD_CREATE)ntfs3driverOn 64K kernels, small NTFS volumes could fail with
EINVALbecauselog_replay()usedPAGE_SIZEfor the initial NTFS log page-size probe.For a 64K kernel this inflated the minimum accepted
$LogFilesize fromabout 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 tontfs_fix_post_read().Backport Provenance
The patch cherry-picked cleanly from linux-next.
b7a9125cac8645245d2473c6c0a50e338280ad2326.04_linux-nvidiacommit:0ce2a315dcedf6ba58e975d973ddefc9cb7b8a9aTest Methodology
Imagentfs3.kofsconfig01from LTP20260130LTP_SINGLE_FS_TYPE=ntfsPAGE_SIZE=4096PAGE_SIZE=65536LTP Results
fsconfig01ntfsResult26.04_linux-nvidia7.0.0-1010-nvidiaLTP_EXIT=026.04_linux-nvidia7.0.0-1010-nvidia-64kLTP_EXIT=0Validation Summary
The reported 64K
ntfs3failure is fixed on both target branches: LTPfsconfig01now passes forntfswithPAGE_SIZE=65536.The same LTP
fsconfig01ntfstest also passes on 4K kernels for bothtarget branches, so no regression was observed in the fixed
ntfs3code path.LP: https://bugs.launchpad.net/ubuntu/+source/linux-nvidia-7.0/+bug/2155467