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 attrib operations
Date: Wed, 15 Apr 2026 18:00:38 +0200 [thread overview]
Message-ID: <bef2feea-86fe-4bb3-b749-4b65956ff865@paragon-software.com> (raw)
In-Reply-To: <adjNvTr_3bZmmPfJ@stanley.mountain>
On 4/10/26 12:15, Dan Carpenter wrote:
> Hello Konstantin Komarov,
>
> Commit be71b5cba2e6 ("fs/ntfs3: Add attrib operations") from Aug 13,
> 2021 (linux-next), leads to the following Smatch static checker
> warning:
>
> fs/ntfs3/attrib.c:176 attr_allocate_clusters()
> error: we previously assumed 'pre_alloc' could be null (see line 167)
>
> fs/ntfs3/attrib.c
> 160 int attr_allocate_clusters(struct ntfs_sb_info *sbi, struct runs_tree *run,
> 161 struct runs_tree *run_da, CLST vcn, CLST lcn,
> 162 CLST len, CLST *pre_alloc, enum ALLOCATE_OPT opt,
> 163 CLST *alen, const size_t fr, CLST *new_lcn,
> 164 CLST *new_len)
> 165 {
> 166 int err;
> 167 CLST flen, vcn0 = vcn, pre = pre_alloc ? *pre_alloc : 0;
> 168 size_t cnt = run->count;
> 169
> 170 for (;;) {
> 171 err = ntfs_look_for_free_space(sbi, lcn, len + pre, &lcn, &flen,
> 172 opt);
> 173
> 174 if (err == -ENOSPC && pre) {
> 175 pre = 0;
> --> 176 if (*pre_alloc)
>
> I'm not sure why warnings from 2021 are showing up as new warnings but
> presumably this should be:
>
> if (pre_alloc)
> *pre_alloc = 0;
>
> 177 *pre_alloc = 0;
> 178 continue;
> 179 }
> 180
> 181 if (err == -ENOSPC && new_len && vcn - vcn0) {
> 182 /* Keep already allocated clusters. */
> 183 *alen = vcn - vcn0;
>
> This email is a free service from the Smatch-CI project [smatch.sf.net].
>
> regards,
> dan carpenter
Hello,
Thanks. The warning was fixed in the patch:
https://lore.kernel.org/ntfs3/20260415155413.26884-1-almaz.alexandrovich@paragon-software.com/
Regards,
Konstantin
next prev parent reply other threads:[~2026-04-15 16:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-10 10:15 [bug report] fs/ntfs3: Add attrib operations Dan Carpenter
2026-04-15 16:00 ` Konstantin Komarov [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-07-25 11:45 Dan Carpenter
2021-08-24 9:53 Dan Carpenter
2021-08-24 9:42 Dan Carpenter
2021-08-24 10:49 ` Kari Argillander
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=bef2feea-86fe-4bb3-b749-4b65956ff865@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