* [bug report] ntfs: add reparse and ea operations
@ 2026-04-10 6:47 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2026-04-10 6:47 UTC (permalink / raw)
To: Namjae Jeon; +Cc: linux-fsdevel
Hello Namjae Jeon,
Commit fc053f05ca28 ("ntfs: add reparse and ea operations") from Feb
13, 2026 (linux-next), leads to the following Smatch static checker
warning:
fs/ntfs/ea.c:444 ntfs_ea_set_wsl_inode() error: uninitialized symbol 'err'.
fs/ntfs/namei.c:651 __ntfs_create() error: uninitialized symbol 'ea_size'.
fs/ntfs/ea.c
405 int ntfs_ea_set_wsl_inode(struct inode *inode, dev_t rdev, __le16 *ea_size,
406 unsigned int flags)
407 {
408 __le32 v;
409 int err;
410
411 if (flags & NTFS_EA_UID) {
412 /* Store uid to lxuid EA */
413 v = cpu_to_le32(i_uid_read(inode));
414 err = ntfs_set_ea(inode, "$LXUID", sizeof("$LXUID") - 1, &v,
415 sizeof(v), 0, ea_size);
416 if (err)
417 return err;
418 }
419
420 if (flags & NTFS_EA_GID) {
421 /* Store gid to lxgid EA */
422 v = cpu_to_le32(i_gid_read(inode));
423 err = ntfs_set_ea(inode, "$LXGID", sizeof("$LXGID") - 1, &v,
424 sizeof(v), 0, ea_size);
425 if (err)
426 return err;
427 }
428
429 if (flags & NTFS_EA_MODE) {
430 /* Store mode to lxmod EA */
431 v = cpu_to_le32(inode->i_mode);
432 err = ntfs_set_ea(inode, "$LXMOD", sizeof("$LXMOD") - 1, &v,
433 sizeof(v), 0, ea_size);
434 if (err)
435 return err;
436 }
437
438 if (rdev) {
err needs to be initialized if rdev is false.
439 v = cpu_to_le32(rdev);
440 err = ntfs_set_ea(inode, "$LXDEV", sizeof("$LXDEV") - 1, &v, sizeof(v),
441 0, ea_size);
442 }
443
--> 444 return err;
^^^^^^^^^^^
Also Smatch thinks that this function can return success without setting
ea_size.
445 }
This email is a free service from the Smatch-CI project [smatch.sf.net].
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-04-10 6:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-10 6:47 [bug report] ntfs: add reparse and ea operations Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.