* [PATCH RESEND] fs/ntfs3: fix mount failure on 64K page-size kernels [not found] <20260424203111.77214-1-jamien@nvidia.com> @ 2026-05-19 19:42 ` Jamie Nguyen 2026-05-28 13:50 ` Konstantin Komarov 0 siblings, 1 reply; 2+ messages in thread From: Jamie Nguyen @ 2026-05-19 19:42 UTC (permalink / raw) To: Konstantin Komarov; +Cc: ntfs3, linux-kernel, Matthew R . Ochs, Jamie Nguyen 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: b46acd6a6a62 ("fs/ntfs3: Add NTFS journal") Signed-off-by: Jamie Nguyen <jamien@nvidia.com> Tested-by: Matthew R. Ochs <mochs@nvidia.com> --- fs/ntfs3/fslog.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c index 38934e6978ec..4a6cfa3441d9 100644 --- a/fs/ntfs3/fslog.c +++ b/fs/ntfs3/fslog.c @@ -1170,7 +1170,7 @@ static int read_log_page(struct ntfs_log *log, u32 vbo, goto out; if (page_buf->rhdr.sign != NTFS_FFFF_SIGNATURE) - ntfs_fix_post_read(&page_buf->rhdr, PAGE_SIZE, false); + ntfs_fix_post_read(&page_buf->rhdr, log->page_size, false); if (page_buf != *buffer) memcpy(*buffer, Add2Ptr(page_buf, page_off), bytes); @@ -3782,11 +3782,7 @@ int log_replay(struct ntfs_inode *ni, bool *initialized) log->l_size = log->orig_file_size = ni->vfs_inode.i_size; /* Get the size of page. NOTE: To replay we can use default page. */ -#if PAGE_SIZE >= DefaultLogPageSize && PAGE_SIZE <= DefaultLogPageSize * 2 log->page_size = norm_file_page(PAGE_SIZE, &log->l_size, true); -#else - log->page_size = norm_file_page(PAGE_SIZE, &log->l_size, false); -#endif if (!log->page_size) { err = -EINVAL; goto out; -- 2.43.0 ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH RESEND] fs/ntfs3: fix mount failure on 64K page-size kernels 2026-05-19 19:42 ` [PATCH RESEND] fs/ntfs3: fix mount failure on 64K page-size kernels Jamie Nguyen @ 2026-05-28 13:50 ` Konstantin Komarov 0 siblings, 0 replies; 2+ messages in thread From: Konstantin Komarov @ 2026-05-28 13:50 UTC (permalink / raw) To: Jamie Nguyen; +Cc: ntfs3, linux-kernel, Matthew R . Ochs On 5/19/26 21:42, Jamie Nguyen wrote: > 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: b46acd6a6a62 ("fs/ntfs3: Add NTFS journal") > Signed-off-by: Jamie Nguyen <jamien@nvidia.com> > Tested-by: Matthew R. Ochs <mochs@nvidia.com> > --- > fs/ntfs3/fslog.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/fs/ntfs3/fslog.c b/fs/ntfs3/fslog.c > index 38934e6978ec..4a6cfa3441d9 100644 > --- a/fs/ntfs3/fslog.c > +++ b/fs/ntfs3/fslog.c > @@ -1170,7 +1170,7 @@ static int read_log_page(struct ntfs_log *log, u32 vbo, > goto out; > > if (page_buf->rhdr.sign != NTFS_FFFF_SIGNATURE) > - ntfs_fix_post_read(&page_buf->rhdr, PAGE_SIZE, false); > + ntfs_fix_post_read(&page_buf->rhdr, log->page_size, false); > > if (page_buf != *buffer) > memcpy(*buffer, Add2Ptr(page_buf, page_off), bytes); > @@ -3782,11 +3782,7 @@ int log_replay(struct ntfs_inode *ni, bool *initialized) > log->l_size = log->orig_file_size = ni->vfs_inode.i_size; > > /* Get the size of page. NOTE: To replay we can use default page. */ > -#if PAGE_SIZE >= DefaultLogPageSize && PAGE_SIZE <= DefaultLogPageSize * 2 > log->page_size = norm_file_page(PAGE_SIZE, &log->l_size, true); > -#else > - log->page_size = norm_file_page(PAGE_SIZE, &log->l_size, false); > -#endif > if (!log->page_size) { > err = -EINVAL; > goto out; > -- > 2.43.0 > Hello, Queued for the next merge window, thanks. Regards, Konstantin ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-28 13:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20260424203111.77214-1-jamien@nvidia.com>
2026-05-19 19:42 ` [PATCH RESEND] fs/ntfs3: fix mount failure on 64K page-size kernels Jamie Nguyen
2026-05-28 13:50 ` Konstantin Komarov
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®