public inbox for ntfs3@lists.linux.dev
 help / color / mirror / Atom feed
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
To: Dan Carpenter <error27@gmail.com>
Cc: <ntfs3@lists.linux.dev>
Subject: Re: [bug report] fs/ntfs3: add delayed-allocation (delalloc) support
Date: Wed, 15 Apr 2026 17:59:33 +0200	[thread overview]
Message-ID: <be2e2d0e-8ca6-4151-a78e-2b85f1bf1e93@paragon-software.com> (raw)
In-Reply-To: <adiR_6B7IpUDjGSh@stanley.mountain>

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


      reply	other threads:[~2026-04-15 15:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-10  6:00 [bug report] fs/ntfs3: add delayed-allocation (delalloc) support Dan Carpenter
2026-04-15 15:59 ` Konstantin Komarov [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=be2e2d0e-8ca6-4151-a78e-2b85f1bf1e93@paragon-software.com \
    --to=almaz.alexandrovich@paragon-software.com \
    --cc=error27@gmail.com \
    --cc=ntfs3@lists.linux.dev \
    /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