* [bug report] fs/ntfs3: add delayed-allocation (delalloc) support
@ 2026-04-10 6:00 Dan Carpenter
2026-04-15 15:59 ` Konstantin Komarov
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2026-04-10 6:00 UTC (permalink / raw)
To: Konstantin Komarov; +Cc: ntfs3
Hello Konstantin Komarov,
Commit 10d7c95af043 ("fs/ntfs3: add delayed-allocation (delalloc)
support") from Feb 16, 2026 (linux-next), leads to the following
Smatch static checker warning:
fs/ntfs3/frecord.c:3303 ni_allocate_da_blocks_locked()
error: uninitialized symbol 'err'.
fs/ntfs3/frecord.c
3268 int ni_allocate_da_blocks_locked(struct ntfs_inode *ni)
3269 {
3270 int err;
3271
3272 if (!ni->file.run_da.count)
3273 return 0;
3274
3275 if (is_sparsed(ni)) {
3276 CLST vcn, lcn, clen, alen;
3277 bool new;
3278
3279 /*
3280 * Sparse file allocates clusters in 'attr_data_get_block_locked'
3281 */
3282 while (run_get_entry(&ni->file.run_da, 0, &vcn, &lcn, &clen)) {
Do we always enter this loop for at least on iteration? Otherwise ...
3283 /* TODO: zero=true? */
3284 err = attr_data_get_block_locked(ni, vcn, clen, &lcn,
3285 &alen, &new, true,
3286 NULL, true);
3287 if (err)
3288 break;
3289 if (!new) {
3290 err = -EINVAL;
3291 break;
3292 }
3293 }
3294 } else {
3295 /*
3296 * Normal file allocates clusters in 'attr_set_size'
3297 */
3298 err = attr_set_size_ex(ni, ATTR_DATA, NULL, 0, &ni->file.run,
3299 ni->vfs_inode.i_size, &ni->i_valid,
3300 false, NULL, true);
3301 }
3302
--> 3303 return err;
err would be uninitialized
3304 }
This email is a free service from the Smatch-CI project [smatch.sf.net].
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [bug report] fs/ntfs3: add delayed-allocation (delalloc) support
2026-04-10 6:00 [bug report] fs/ntfs3: add delayed-allocation (delalloc) support Dan Carpenter
@ 2026-04-15 15:59 ` Konstantin Komarov
0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Komarov @ 2026-04-15 15:59 UTC (permalink / raw)
To: Dan Carpenter; +Cc: ntfs3
On 4/10/26 08:00, Dan Carpenter wrote:
> Hello Konstantin Komarov,
>
> Commit 10d7c95af043 ("fs/ntfs3: add delayed-allocation (delalloc)
> support") from Feb 16, 2026 (linux-next), leads to the following
> Smatch static checker warning:
>
> fs/ntfs3/frecord.c:3303 ni_allocate_da_blocks_locked()
> error: uninitialized symbol 'err'.
>
> fs/ntfs3/frecord.c
> 3268 int ni_allocate_da_blocks_locked(struct ntfs_inode *ni)
> 3269 {
> 3270 int err;
> 3271
> 3272 if (!ni->file.run_da.count)
> 3273 return 0;
> 3274
> 3275 if (is_sparsed(ni)) {
> 3276 CLST vcn, lcn, clen, alen;
> 3277 bool new;
> 3278
> 3279 /*
> 3280 * Sparse file allocates clusters in 'attr_data_get_block_locked'
> 3281 */
> 3282 while (run_get_entry(&ni->file.run_da, 0, &vcn, &lcn, &clen)) {
>
> Do we always enter this loop for at least on iteration? Otherwise ...
>
> 3283 /* TODO: zero=true? */
> 3284 err = attr_data_get_block_locked(ni, vcn, clen, &lcn,
> 3285 &alen, &new, true,
> 3286 NULL, true);
> 3287 if (err)
> 3288 break;
> 3289 if (!new) {
> 3290 err = -EINVAL;
> 3291 break;
> 3292 }
> 3293 }
> 3294 } else {
> 3295 /*
> 3296 * Normal file allocates clusters in 'attr_set_size'
> 3297 */
> 3298 err = attr_set_size_ex(ni, ATTR_DATA, NULL, 0, &ni->file.run,
> 3299 ni->vfs_inode.i_size, &ni->i_valid,
> 3300 false, NULL, true);
> 3301 }
> 3302
> --> 3303 return err;
>
> err would be uninitialized
>
> 3304 }
>
> This email is a free service from the Smatch-CI project [smatch.sf.net].
>
> regards,
> dan carpenter
Hello,
Thank you. The warning was fixed by the patch:
https://lore.kernel.org/ntfs3/20260415155413.26884-1-almaz.alexandrovich@paragon-software.com/
Regards,
Konstantin
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-04-15 15:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 6:00 [bug report] fs/ntfs3: add delayed-allocation (delalloc) support Dan Carpenter
2026-04-15 15:59 ` Konstantin Komarov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox