From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: "Miguel García" <miguelgarciaroman8@gmail.com>,
"Sasha Levin" <sashal@kernel.org>
Subject: Re: [PATCH 6.1.y] fs/ntfs3: Change new sparse cluster processing
Date: Thu, 20 Mar 2025 12:03:58 -0400 [thread overview]
Message-ID: <20250320111323-b39cad62593c7f87@stable.kernel.org> (raw)
In-Reply-To: <20250319145436.79713-1-miguelgarciaroman8@gmail.com>
[ Sasha's backport helper bot ]
Hi,
✅ All tests passed successfully. No issues detected.
No action required from the submitter.
The upstream commit SHA1 provided is correct: c380b52f6c5702cc4bdda5e6d456d6c19a201a0b
WARNING: Author mismatch between patch and upstream commit:
Backport author: <miguelgarciaroman8@gmail.com>
Commit author: Konstantin Komarov<almaz.alexandrovich@paragon-software.com>
Status in newer kernel trees:
6.13.y | Present (exact SHA1)
6.12.y | Present (exact SHA1)
6.6.y | Present (exact SHA1)
Note: The patch differs from the upstream commit:
---
1: c380b52f6c570 ! 1: 0897865442ea4 fs/ntfs3: Change new sparse cluster processing
@@ Metadata
## Commit message ##
fs/ntfs3: Change new sparse cluster processing
+ commit c380b52f6c5702cc4bdda5e6d456d6c19a201a0b upstream.
+
+ This patch is a backport.
Remove ntfs_sparse_cluster.
Zero clusters in attr_allocate_clusters.
Fixes xfstest generic/263
+ The fix has been verified by executing the syzkaller reproducer test case.
+
+ Bug: https://syzkaller.appspot.com/bug?extid=f3e5d0948a1837ed1bb0
+ Reported-by: syzbot+f3e5d0948a1837ed1bb0@syzkaller.appspotmail.com
+ Cc: <stable@vger.kernel.org>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
+ Signed-off-by: Miguel Garcia Roman <miguelgarciaroman8@gmail.com>
+ (cherry picked from commit c380b52f6c5702cc4bdda5e6d456d6c19a201a0b)
## fs/ntfs3/attrib.c ##
@@ fs/ntfs3/attrib.c: static int run_deallocate_ex(struct ntfs_sb_info *sbi, struct runs_tree *run,
@@ fs/ntfs3/attrib.c: int attr_data_get_block(struct ntfs_inode *ni, CLST vcn, CLST
struct mft_inode *mi, *mi_b;
- CLST hint, svcn, to_alloc, evcn1, next_svcn, asize, end;
+ CLST hint, svcn, to_alloc, evcn1, next_svcn, asize, end, vcn0, alen;
-+ unsigned fr;
++ unsigned int fr;
u64 total_size;
- u32 clst_per_frame;
- bool ok;
@@ fs/ntfs3/file.c: static int ntfs_zero_range(struct inode *inode, u64 vbo, u64 vb
-{
- struct address_space *mapping = inode->i_mapping;
- struct ntfs_sb_info *sbi = inode->i_sb->s_fs_info;
-- u8 cluster_bits = sbi->cluster_bits;
-- u64 vbo = (u64)vcn << cluster_bits;
-- u64 bytes = (u64)len << cluster_bits;
+- u64 vbo = (u64)vcn << sbi->cluster_bits;
+- u64 bytes = (u64)len << sbi->cluster_bits;
- u32 blocksize = 1 << inode->i_blkbits;
- pgoff_t idx0 = page0 ? page0->index : -1;
- loff_t vbo_clst = vbo & sbi->cluster_mask_inv;
@@ fs/ntfs3/file.c: static int ntfs_zero_range(struct inode *inode, u64 vbo, u64 vb
-
- zero_user_segment(page, from, to);
-
-- if (!partial)
-- SetPageUptodate(page);
-- flush_dcache_page(page);
-- set_page_dirty(page);
+- if (!partial) {
+- if (!PageUptodate(page))
+- SetPageUptodate(page);
+- set_page_dirty(page);
+- }
-
- if (idx != idx0) {
- unlock_page(page);
@@ fs/ntfs3/file.c: static int ntfs_zero_range(struct inode *inode, u64 vbo, u64 vb
- }
- cond_resched();
- }
+- mark_inode_dirty(inode);
-}
-
/*
@@ fs/ntfs3/file.c: static long ntfs_fallocate(struct file *file, int mode, loff_t
u32 frame_size;
loff_t mask, vbo_a, end_a, tmp;
-- err = filemap_write_and_wait_range(mapping, vbo, LLONG_MAX);
+- err = filemap_write_and_wait_range(mapping, vbo, end - 1);
+- if (err)
+- goto out;
+-
+- err = filemap_write_and_wait_range(mapping, end, LLONG_MAX);
+ err = filemap_write_and_wait_range(mapping, vbo_down,
+ LLONG_MAX);
if (err)
@@ fs/ntfs3/file.c: static long ntfs_fallocate(struct file *file, int mode, loff_t
goto out;
if (is_supported_holes) {
-- CLST vcn_v = bytes_to_cluster(sbi, ni->i_valid);
+- CLST vcn_v = ni->i_valid >> sbi->cluster_bits;
CLST vcn = vbo >> sbi->cluster_bits;
CLST cend = bytes_to_cluster(sbi, end);
+ CLST cend_v = bytes_to_cluster(sbi, ni->i_valid);
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.1.y | Success | Success |
prev parent reply other threads:[~2025-03-20 16:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-19 14:54 [PATCH 6.1.y] fs/ntfs3: Change new sparse cluster processing Miguel García
2025-03-19 17:57 ` Sasha Levin
2025-03-20 16:03 ` Sasha Levin [this message]
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=20250320111323-b39cad62593c7f87@stable.kernel.org \
--to=sashal@kernel.org \
--cc=miguelgarciaroman8@gmail.com \
--cc=stable@vger.kernel.org \
/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