* [hch-misc:xfs-attr-cleanup 5/8] fs/xfs/libxfs/xfs_attr.c:1075:11: warning: variable 'error' is uninitialized when used here
@ 2023-12-19 12:57 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-12-19 12:57 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: oe-kbuild-all
tree: git://git.infradead.org/users/hch/misc.git xfs-attr-cleanup
head: fcf98eafb96221bd1bb0b4abb1fe5c8eff25284e
commit: e173532340de2953d2c918132c3c9bcf74d9399a [5/8] xfs: remove xfs_attr_shortform_lookup
config: i386-buildonly-randconfig-002-20231219 (https://download.01.org/0day-ci/archive/20231219/202312192042.O6TJSHFu-lkp@intel.com/config)
compiler: clang version 16.0.4 (https://github.com/llvm/llvm-project.git ae42196bc493ffe877a7e3dff8be32035dea4d07)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231219/202312192042.O6TJSHFu-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312192042.O6TJSHFu-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> fs/xfs/libxfs/xfs_attr.c:1075:11: warning: variable 'error' is uninitialized when used here [-Wuninitialized]
return error;
^~~~~
fs/xfs/libxfs/xfs_attr.c:1069:13: note: initialize the variable 'error' to silence this warning
int error;
^
= 0
1 warning generated.
vim +/error +1075 fs/xfs/libxfs/xfs_attr.c
e01b7eed5d0a9b fs/xfs/libxfs/xfs_attr.c Carlos Maiolino 2020-09-07 1059
^1da177e4c3f41 fs/xfs/xfs_attr.c Linus Torvalds 2005-04-16 1060 /*
^1da177e4c3f41 fs/xfs/xfs_attr.c Linus Torvalds 2005-04-16 1061 * Add a name to the shortform attribute list structure
^1da177e4c3f41 fs/xfs/xfs_attr.c Linus Torvalds 2005-04-16 1062 * This is the external routine.
^1da177e4c3f41 fs/xfs/xfs_attr.c Linus Torvalds 2005-04-16 1063 */
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1064 static int
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1065 xfs_attr_shortform_addname(
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1066 struct xfs_da_args *args)
^1da177e4c3f41 fs/xfs/xfs_attr.c Linus Torvalds 2005-04-16 1067 {
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1068 int newsize, forkoff;
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1069 int error;
^1da177e4c3f41 fs/xfs/xfs_attr.c Linus Torvalds 2005-04-16 1070
5a5881cdeec2c0 fs/xfs/xfs_attr.c Dave Chinner 2012-03-22 1071 trace_xfs_attr_sf_addname(args);
5a5881cdeec2c0 fs/xfs/xfs_attr.c Dave Chinner 2012-03-22 1072
e173532340de29 fs/xfs/libxfs/xfs_attr.c Christoph Hellwig 2023-12-17 1073 if (xfs_attr_sf_findname(args)) {
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1074 if (!(args->op_flags & XFS_DA_OP_REPLACE))
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 @1075 return error;
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1076
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1077 error = xfs_attr_sf_removename(args);
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1078 if (error)
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1079 return error;
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1080
7b38460dc8e4ea fs/xfs/libxfs/xfs_attr.c Darrick J. Wong 2018-04-17 1081 /*
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1082 * Since we have removed the old attr, clear XFS_DA_OP_REPLACE
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1083 * so that the new attr doesn't fit in shortform format, the
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1084 * leaf format add routine won't trip over the attr not being
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1085 * around.
7b38460dc8e4ea fs/xfs/libxfs/xfs_attr.c Darrick J. Wong 2018-04-17 1086 */
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1087 args->op_flags &= ~XFS_DA_OP_REPLACE;
e173532340de29 fs/xfs/libxfs/xfs_attr.c Christoph Hellwig 2023-12-17 1088 } else {
e173532340de29 fs/xfs/libxfs/xfs_attr.c Christoph Hellwig 2023-12-17 1089 if (args->op_flags & XFS_DA_OP_REPLACE)
e7f358dee4e5cf fs/xfs/libxfs/xfs_attr.c Dave Chinner 2022-05-12 1090 return error;
^1da177e4c3f41 fs/xfs/xfs_attr.c Linus Torvalds 2005-04-16 1091 }
^1da177e4c3f41 fs/xfs/xfs_attr.c Linus Torvalds 2005-04-16 1092
d8cc890d4095f1 fs/xfs/xfs_attr.c Nathan Scott 2005-11-02 1093 if (args->namelen >= XFS_ATTR_SF_ENTSIZE_MAX ||
d8cc890d4095f1 fs/xfs/xfs_attr.c Nathan Scott 2005-11-02 1094 args->valuelen >= XFS_ATTR_SF_ENTSIZE_MAX)
2451337dd04390 fs/xfs/libxfs/xfs_attr.c Dave Chinner 2014-06-25 1095 return -ENOSPC;
d8cc890d4095f1 fs/xfs/xfs_attr.c Nathan Scott 2005-11-02 1096
e01b7eed5d0a9b fs/xfs/libxfs/xfs_attr.c Carlos Maiolino 2020-09-07 1097 newsize = xfs_attr_sf_totsize(args->dp);
e01b7eed5d0a9b fs/xfs/libxfs/xfs_attr.c Carlos Maiolino 2020-09-07 1098 newsize += xfs_attr_sf_entsize_byname(args->namelen, args->valuelen);
d8cc890d4095f1 fs/xfs/xfs_attr.c Nathan Scott 2005-11-02 1099
d8cc890d4095f1 fs/xfs/xfs_attr.c Nathan Scott 2005-11-02 1100 forkoff = xfs_attr_shortform_bytesfit(args->dp, newsize);
d8cc890d4095f1 fs/xfs/xfs_attr.c Nathan Scott 2005-11-02 1101 if (!forkoff)
2451337dd04390 fs/xfs/libxfs/xfs_attr.c Dave Chinner 2014-06-25 1102 return -ENOSPC;
d8cc890d4095f1 fs/xfs/xfs_attr.c Nathan Scott 2005-11-02 1103
d8cc890d4095f1 fs/xfs/xfs_attr.c Nathan Scott 2005-11-02 1104 xfs_attr_shortform_add(args, forkoff);
d99831ff393ff2 fs/xfs/xfs_attr.c Eric Sandeen 2014-06-22 1105 return 0;
^1da177e4c3f41 fs/xfs/xfs_attr.c Linus Torvalds 2005-04-16 1106 }
^1da177e4c3f41 fs/xfs/xfs_attr.c Linus Torvalds 2005-04-16 1107
:::::: The code at line 1075 was first introduced by commit
:::::: e7f358dee4e5cf1ce8b11ff2e65d5ccb1ced24db xfs: use XFS_DA_OP flags in deferred attr ops
:::::: TO: Dave Chinner <dchinner@redhat.com>
:::::: CC: Dave Chinner <david@fromorbit.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-19 12:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-19 12:57 [hch-misc:xfs-attr-cleanup 5/8] fs/xfs/libxfs/xfs_attr.c:1075:11: warning: variable 'error' is uninitialized when used here kernel test robot
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.