Re: [PATCH v3 7/7] media: subdev: rename v4l2_subdev_pad_config.try_* fields
by kernel test robot
Hi Tomi,
I love your patch! Yet something to improve:
[auto build test ERROR on media-tree/master]
[also build test ERROR on tegra/for-next v5.17-rc3]
[cannot apply to next-20220208]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Tomi-Valkeinen/v4l-subdev-active...
base: git://linuxtv.org/media_tree.git master
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220209/202202090347.nNP3NUjy-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/8283dea08111c6a813e9340d735c158df...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Tomi-Valkeinen/v4l-subdev-active-state/20220208-002350
git checkout 8283dea08111c6a813e9340d735c158df3fcbe5f
# save the config file to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/staging/media/atomisp/pci/atomisp_file.c: In function 'file_input_set_fmt':
>> drivers/staging/media/atomisp/pci/atomisp_file.c:116:17: error: 'struct v4l2_subdev_pad_config' has no member named 'try_fmt'
116 | sd_state->pads->try_fmt = *fmt;
| ^~
--
drivers/staging/media/atomisp/pci/atomisp_tpg.c: In function 'tpg_set_fmt':
>> drivers/staging/media/atomisp/pci/atomisp_tpg.c:50:17: error: 'struct v4l2_subdev_pad_config' has no member named 'try_fmt'
50 | sd_state->pads->try_fmt = *fmt;
| ^~
--
drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c: In function 'mt9m114_set_fmt':
>> drivers/staging/media/atomisp/i2c/atomisp-mt9m114.c:757:17: error: 'struct v4l2_subdev_pad_config' has no member named 'try_fmt'
757 | sd_state->pads->try_fmt = *fmt;
| ^~
--
drivers/staging/media/atomisp/i2c/atomisp-gc2235.c: In function 'gc2235_set_fmt':
>> drivers/staging/media/atomisp/i2c/atomisp-gc2235.c:735:17: error: 'struct v4l2_subdev_pad_config' has no member named 'try_fmt'
735 | sd_state->pads->try_fmt = *fmt;
| ^~
--
drivers/staging/media/atomisp/i2c/atomisp-ov2722.c: In function 'ov2722_set_fmt':
>> drivers/staging/media/atomisp/i2c/atomisp-ov2722.c:840:17: error: 'struct v4l2_subdev_pad_config' has no member named 'try_fmt'
840 | sd_state->pads->try_fmt = *fmt;
| ^~
--
drivers/staging/media/atomisp/i2c/atomisp-ov2680.c: In function 'ov2680_set_fmt':
>> drivers/staging/media/atomisp/i2c/atomisp-ov2680.c:857:17: error: 'struct v4l2_subdev_pad_config' has no member named 'try_fmt'
857 | sd_state->pads->try_fmt = *fmt;
| ^~
--
drivers/staging/media/atomisp/i2c/atomisp-gc0310.c: In function 'gc0310_set_fmt':
>> drivers/staging/media/atomisp/i2c/atomisp-gc0310.c:933:17: error: 'struct v4l2_subdev_pad_config' has no member named 'try_fmt'
933 | sd_state->pads->try_fmt = *fmt;
| ^~
--
drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c: In function 'ov5693_set_fmt':
>> drivers/staging/media/atomisp/i2c/ov5693/atomisp-ov5693.c:1611:17: error: 'struct v4l2_subdev_pad_config' has no member named 'try_fmt'
1611 | sd_state->pads->try_fmt = *fmt;
| ^~
vim +116 drivers/staging/media/atomisp/pci/atomisp_file.c
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_file.c Mauro Carvalho Chehab 2020-04-19 105
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_file.c Mauro Carvalho Chehab 2020-04-19 106 static int file_input_set_fmt(struct v4l2_subdev *sd,
0d346d2a6f54f0 drivers/staging/media/atomisp/pci/atomisp_file.c Tomi Valkeinen 2021-06-10 107 struct v4l2_subdev_state *sd_state,
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_file.c Mauro Carvalho Chehab 2020-04-19 108 struct v4l2_subdev_format *format)
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_file.c Mauro Carvalho Chehab 2020-04-19 109 {
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_file.c Mauro Carvalho Chehab 2020-04-19 110 struct v4l2_mbus_framefmt *fmt = &format->format;
bdfe0beb95eebc drivers/staging/media/atomisp/pci/atomisp2/atomisp_file.c Mauro Carvalho Chehab 2020-04-19 111
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_file.c Mauro Carvalho Chehab 2020-04-19 112 if (format->pad)
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_file.c Mauro Carvalho Chehab 2020-04-19 113 return -EINVAL;
0d346d2a6f54f0 drivers/staging/media/atomisp/pci/atomisp_file.c Tomi Valkeinen 2021-06-10 114 file_input_get_fmt(sd, sd_state, format);
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_file.c Mauro Carvalho Chehab 2020-04-19 115 if (format->which == V4L2_SUBDEV_FORMAT_TRY)
0d346d2a6f54f0 drivers/staging/media/atomisp/pci/atomisp_file.c Tomi Valkeinen 2021-06-10 @116 sd_state->pads->try_fmt = *fmt;
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_file.c Mauro Carvalho Chehab 2020-04-19 117 return 0;
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_file.c Mauro Carvalho Chehab 2020-04-19 118 }
ad85094b293e40 drivers/staging/media/atomisp/pci/atomisp2/atomisp_file.c Mauro Carvalho Chehab 2020-04-19 119
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
[peterz-queue:sched/core 32/32] arch/arm64/include/asm/preempt.h:85:1: error: type defaults to 'int' in declaration of 'DECLARE_STATIC_KEY_TRUE'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git sched/core
head: ac7695a93a578befdcf4900a90860bf19e057e1b
commit: ac7695a93a578befdcf4900a90860bf19e057e1b [32/32] arm64: support PREEMPT_DYNAMIC
config: arm64-randconfig-s031-20220208 (https://download.01.org/0day-ci/archive/20220208/202202081918.RDLHzFHh-lk...)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?...
git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
git fetch --no-tags peterz-queue sched/core
git checkout ac7695a93a578befdcf4900a90860bf19e057e1b
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arm64 prepare
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
In file included from include/linux/preempt.h:78,
from include/linux/smp.h:110,
from include/linux/lockdep.h:14,
from include/linux/mutex.h:17,
from include/linux/kernfs.h:11,
from include/linux/sysfs.h:16,
from include/linux/kobject.h:20,
from include/linux/of.h:17,
from include/linux/irqdomain.h:35,
from include/linux/acpi.h:13,
from include/acpi/apei.h:9,
from include/acpi/ghes.h:5,
from include/linux/arm_sdei.h:8,
from arch/arm64/kernel/asm-offsets.c:10:
>> arch/arm64/include/asm/preempt.h:85:1: warning: data definition has no type or storage class
85 | DECLARE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched);
| ^~~~~~~~~~~~~~~~~~~~~~~
>> arch/arm64/include/asm/preempt.h:85:1: error: type defaults to 'int' in declaration of 'DECLARE_STATIC_KEY_TRUE' [-Werror=implicit-int]
>> arch/arm64/include/asm/preempt.h:85:1: warning: parameter names (without types) in function declaration
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:121: arch/arm64/kernel/asm-offsets.s] Error 1
make[2]: Target '__build' not remade because of errors.
make[1]: *** [Makefile:1191: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:219: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +85 arch/arm64/include/asm/preempt.h
84
> 85 DECLARE_STATIC_KEY_TRUE(sk_dynamic_irqentry_exit_cond_resched);
86 void dynamic_preempt_schedule(void);
87 #define __preempt_schedule() dynamic_preempt_schedule()
88 void dynamic_preempt_schedule_notrace(void);
89 #define __preempt_schedule_notrace() dynamic_preempt_schedule_notrace()
90
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
Re: [PATCH 1/3] pwm: driver for qualcomm ipq6018 pwm block
by kernel test robot
Hi Baruch,
I love your patch! Perhaps something to improve:
[auto build test WARNING on thierry-reding-pwm/for-next]
[also build test WARNING on robh/for-next v5.17-rc3 next-20220207]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Baruch-Siach/pwm-driver-for-qual...
base: https://git.kernel.org/pub/scm/linux/kernel/git/thierry.reding/linux-pwm.git for-next
config: hexagon-allyesconfig (https://download.01.org/0day-ci/archive/20220208/202202080410.R0qwqtXx-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0d8850ae2cae85d49bea6ae0799fa41c7202c05c)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/71e449eb6d19b141b4527caae529e16c5...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Baruch-Siach/pwm-driver-for-qualcomm-ipq6018-pwm-block/20220207-175605
git checkout 71e449eb6d19b141b4527caae529e16c52bcfeea
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/pwm/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/pwm/pwm-ipq.c:122:11: warning: result of comparison of constant 16000000000 with expression of type 'unsigned long' is always false [-Wtautological-constant-out-of-range-compare]
if (rate > 16ULL * GIGA)
~~~~ ^ ~~~~~~~~~~~~
1 warning generated.
vim +122 drivers/pwm/pwm-ipq.c
99
100 static int ipq_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
101 const struct pwm_state *state)
102 {
103 struct ipq_pwm_chip *ipq_chip = ipq_pwm_from_chip(chip);
104 unsigned int pre_div, pwm_div, best_pre_div, best_pwm_div;
105 unsigned long rate = clk_get_rate(ipq_chip->clk);
106 u64 period_ns, duty_ns, period_rate;
107 u64 min_diff;
108
109 if (state->polarity != PWM_POLARITY_NORMAL)
110 return -EINVAL;
111
112 if (state->period < DIV64_U64_ROUND_UP(NSEC_PER_SEC, rate))
113 return -ERANGE;
114
115 period_ns = min(state->period, IPQ_PWM_MAX_PERIOD_NS);
116 duty_ns = min(state->duty_cycle, period_ns);
117
118 /*
119 * period_ns is 1G or less. As long as rate is less than 16 GHz,
120 * period_rate does not overflow. Make that explicit.
121 */
> 122 if (rate > 16ULL * GIGA)
123 return -EINVAL;
124 period_rate = period_ns * rate;
125 best_pre_div = IPQ_PWM_MAX_DIV;
126 best_pwm_div = IPQ_PWM_MAX_DIV;
127 /*
128 * We don't need to consider pre_div values smaller than
129 *
130 * period_rate
131 * pre_div_min := ------------------------------------
132 * NSEC_PER_SEC * (IPQ_PWM_MAX_DIV + 1)
133 *
134 * because pre_div = pre_div_min results in a better
135 * approximation.
136 */
137 pre_div = div64_u64(period_rate,
138 (u64)NSEC_PER_SEC * (IPQ_PWM_MAX_DIV + 1));
139 min_diff = period_rate;
140
141 for (; pre_div <= IPQ_PWM_MAX_DIV; pre_div++) {
142 u64 remainder;
143
144 pwm_div = div64_u64_rem(period_rate,
145 (u64)NSEC_PER_SEC * (pre_div + 1), &remainder);
146 /* pwm_div is unsigned; the check below catches underflow */
147 pwm_div--;
148
149 /*
150 * Swapping values for pre_div and pwm_div produces the same
151 * period length. So we can skip all settings with pre_div >
152 * pwm_div which results in bigger constraints for selecting
153 * the duty_cycle than with the two values swapped.
154 */
155 if (pre_div > pwm_div)
156 break;
157
158 /*
159 * Make sure we can do 100% duty cycle where
160 * hi_dur == pwm_div + 1
161 */
162 if (pwm_div > IPQ_PWM_MAX_DIV - 1)
163 continue;
164
165 if (remainder < min_diff) {
166 best_pre_div = pre_div;
167 best_pwm_div = pwm_div;
168 min_diff = remainder;
169
170 if (min_diff == 0) /* bingo */
171 break;
172 }
173 }
174
175 /* config divider values for the closest possible frequency */
176 config_div_and_duty(pwm, best_pre_div, best_pwm_div,
177 rate, duty_ns, state->enabled);
178
179 return 0;
180 }
181
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
drivers/md/raid5.c:7055:9: sparse: sparse: cast removes address space '__percpu' of expression
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 555f3d7be91a873114c9656069f1a9fa476ec41a
commit: 770b1d216d7371c94c88713824da4be4bc39a4e0 md/raid5: play nice with PREEMPT_RT
date: 5 weeks ago
config: x86_64-rhel-8.3-kselftests (https://download.01.org/0day-ci/archive/20220209/202202090233.p7b36fBL-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 770b1d216d7371c94c88713824da4be4bc39a4e0
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=x86_64 SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/md/raid5.c: note: in included file:
drivers/md/raid5.h:271:14: sparse: sparse: array of flexible structures
drivers/md/raid5.c:641:40: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:641:40: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:641:40: sparse: struct md_rdev *
drivers/md/raid5.c:643:32: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:643:32: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:643:32: sparse: struct md_rdev *
drivers/md/raid5.c:667:40: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:667:40: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:667:40: sparse: struct md_rdev *
drivers/md/raid5.c:669:32: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:669:32: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:669:32: sparse: struct md_rdev *
drivers/md/raid5.c:1101:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:1101:25: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:1101:25: sparse: struct md_rdev *
drivers/md/raid5.c:1103:24: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:1103:24: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:1103:24: sparse: struct md_rdev *
drivers/md/raid5.c:3563:32: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:3563:32: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:3563:32: sparse: struct md_rdev *
drivers/md/raid5.c:3689:48: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:3689:48: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:3689:48: sparse: struct md_rdev *
drivers/md/raid5.c:3696:32: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:3696:32: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:3696:32: sparse: struct md_rdev *
drivers/md/raid5.c:3718:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:3718:16: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:3718:16: sparse: struct md_rdev *
drivers/md/raid5.c:4646:24: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:4646:24: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:4646:24: sparse: struct md_rdev *
drivers/md/raid5.c:4657:32: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:4657:32: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:4657:32: sparse: struct md_rdev *
drivers/md/raid5.c:4704:49: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:4704:49: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:4704:49: sparse: struct md_rdev *
drivers/md/raid5.c:4717:49: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:4717:49: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:4717:49: sparse: struct md_rdev *
drivers/md/raid5.c:4726:49: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:4726:49: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:4726:49: sparse: struct md_rdev *
drivers/md/raid5.c:4748:40: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:4748:40: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:4748:40: sparse: struct md_rdev *
drivers/md/raid5.c:5419:16: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:5419:16: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:5419:16: sparse: struct md_rdev *
drivers/md/raid5.c:5422:24: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:5422:24: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:5422:24: sparse: struct md_rdev *
>> drivers/md/raid5.c:7055:9: sparse: sparse: cast removes address space '__percpu' of expression
>> drivers/md/raid5.c:7055:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct lockdep_map *lock @@ got struct lockdep_map [noderef] __percpu * @@
drivers/md/raid5.c:7055:9: sparse: expected struct lockdep_map *lock
drivers/md/raid5.c:7055:9: sparse: got struct lockdep_map [noderef] __percpu *
>> drivers/md/raid5.c:7055:9: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct local_lock_t [usertype] *l @@ got struct local_lock_t [noderef] __percpu * @@
drivers/md/raid5.c:7055:9: sparse: expected struct local_lock_t [usertype] *l
drivers/md/raid5.c:7055:9: sparse: got struct local_lock_t [noderef] __percpu *
drivers/md/raid5.c:7808:40: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:7808:40: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:7808:40: sparse: struct md_rdev *
drivers/md/raid5.c:8021:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:8021:25: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:8021:25: sparse: struct md_rdev *
drivers/md/raid5.c:8037:25: sparse: sparse: incompatible types in comparison expression (different address spaces):
drivers/md/raid5.c:8037:25: sparse: struct md_rdev [noderef] __rcu *
drivers/md/raid5.c:8037:25: sparse: struct md_rdev *
drivers/md/raid5.c:1476:16: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:1476:39: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:2208:54: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:2419:16: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:2421:9: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:2422:9: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:7031:23: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:7031:23: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:7032:9: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:7033:16: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:7034:9: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:7039:34: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:7040:17: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:7041:22: sparse: sparse: dereference of noderef expression
drivers/md/raid5.c:97:9: sparse: sparse: context imbalance in 'raid5_quiesce' - different lock contexts for basic block
vim +/__percpu +7055 drivers/md/raid5.c
7036
7037 static int alloc_scratch_buffer(struct r5conf *conf, struct raid5_percpu *percpu)
7038 {
7039 if (conf->level == 6 && !percpu->spare_page) {
7040 percpu->spare_page = alloc_page(GFP_KERNEL);
7041 if (!percpu->spare_page)
7042 return -ENOMEM;
7043 }
7044
7045 if (scribble_alloc(percpu,
7046 max(conf->raid_disks,
7047 conf->previous_raid_disks),
7048 max(conf->chunk_sectors,
7049 conf->prev_chunk_sectors)
7050 / RAID5_STRIPE_SECTORS(conf))) {
7051 free_scratch_buffer(conf, percpu);
7052 return -ENOMEM;
7053 }
7054
> 7055 local_lock_init(&percpu->lock);
7056 return 0;
7057 }
7058
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week
Re: [PATCH] ksmbd: fix racy issue from using ->d_parent and ->d_name
by kernel test robot
Hi Namjae,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.17-rc3 next-20220208]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Namjae-Jeon/ksmbd-fix-racy-issue...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 555f3d7be91a873114c9656069f1a9fa476ec41a
config: i386-allyesconfig (https://download.01.org/0day-ci/archive/20220209/202202090207.MiyIsofZ-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project e8bff9ae54a55b4dbfeb6ba55f723abbd81bf494)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/f4cb65c1c670f5332092a7eb75d569bbd...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Namjae-Jeon/ksmbd-fix-racy-issue-from-using-d_parent-and-d_name/20220208-092438
git checkout f4cb65c1c670f5332092a7eb75d569bbd4e46a5f
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash fs/ksmbd/
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> fs/ksmbd/vfs.c:654:6: warning: variable 'old_dentry' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (d_is_symlink(new_path.dentry)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ksmbd/vfs.c:719:7: note: uninitialized use occurs here
dput(old_dentry);
^~~~~~~~~~
fs/ksmbd/vfs.c:654:2: note: remove the 'if' if its condition is always false
if (d_is_symlink(new_path.dentry)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ksmbd/vfs.c:604:27: note: initialize the variable 'old_dentry' to silence this warning
struct dentry *old_dentry, *new_dentry, *trap;
^
= NULL
>> fs/ksmbd/vfs.c:654:6: warning: variable 'new_dentry' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (d_is_symlink(new_path.dentry)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ksmbd/vfs.c:717:7: note: uninitialized use occurs here
dput(new_dentry);
^~~~~~~~~~
fs/ksmbd/vfs.c:654:2: note: remove the 'if' if its condition is always false
if (d_is_symlink(new_path.dentry)) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fs/ksmbd/vfs.c:604:40: note: initialize the variable 'new_dentry' to silence this warning
struct dentry *old_dentry, *new_dentry, *trap;
^
= NULL
2 warnings generated.
vim +654 fs/ksmbd/vfs.c
600
601 int ksmbd_vfs_rename(struct ksmbd_work *work, struct path *path, char *newname,
602 int flags)
603 {
604 struct dentry *old_dentry, *new_dentry, *trap;
605 struct path old_path, new_path;
606 struct qstr old_last, new_last;
607 struct renamedata rd;
608 struct filename *from, *to;
609 struct ksmbd_share_config *share_conf = work->tcon->share_conf;
610 struct ksmbd_file *parent_fp;
611 int old_type, new_type;
612 int err, lookup_flags = LOOKUP_NO_SYMLINKS;
613 char *pathname, *abs_oldname;
614
615 if (ksmbd_override_fsids(work))
616 return -ENOMEM;
617
618 pathname = kmalloc(PATH_MAX, GFP_KERNEL);
619 if (!pathname) {
620 ksmbd_revert_fsids(work);
621 return -ENOMEM;
622 }
623
624 abs_oldname = d_path(path, pathname, PATH_MAX);
625 if (IS_ERR(abs_oldname)) {
626 err = -EINVAL;
627 goto free_pathname;
628 }
629
630 from = getname_kernel(abs_oldname);
631 if (IS_ERR(from)) {
632 err = PTR_ERR(from);
633 goto free_pathname;
634 }
635
636 to = getname_kernel(newname);
637 if (IS_ERR(to)) {
638 err = PTR_ERR(to);
639 goto putname_from;
640 }
641
642 err = filename_parentat(AT_FDCWD, from, lookup_flags, &old_path,
643 &old_last, &old_type);
644 if (err)
645 goto putnames;
646
647 err = vfs_path_parent_lookup(share_conf->vfs_path.dentry,
648 share_conf->vfs_path.mnt, to,
649 lookup_flags | LOOKUP_BENEATH,
650 &new_path, &new_last, &new_type);
651 if (err)
652 goto out1;
653
> 654 if (d_is_symlink(new_path.dentry)) {
655 err = -EACCES;
656 goto out4;
657 }
658
659 trap = lock_rename(old_path.dentry, new_path.dentry);
660 old_dentry = __lookup_hash(&old_last, old_path.dentry, 0);
661 if (IS_ERR(old_dentry)) {
662 err = PTR_ERR(old_dentry);
663 goto out2;
664 }
665 if (d_is_negative(old_dentry)) {
666 err = -ENOENT;
667 goto out3;
668 }
669
670 new_dentry = __lookup_hash(&new_last, new_path.dentry,
671 LOOKUP_RENAME_TARGET);
672 if (IS_ERR(new_dentry)) {
673 err = PTR_ERR(new_dentry);
674 goto out3;
675 }
676
677 if (d_is_symlink(new_dentry)) {
678 err = -EACCES;
679 goto out4;
680 }
681
682 if ((flags & RENAME_NOREPLACE) && d_is_positive(new_dentry)) {
683 err = -EEXIST;
684 goto out4;
685 }
686
687 if (old_dentry == trap) {
688 err = -EINVAL;
689 goto out4;
690 }
691
692 if (new_dentry == trap) {
693 err = -ENOTEMPTY;
694 goto out4;
695 }
696
697 parent_fp = ksmbd_lookup_fd_inode(old_path.dentry->d_inode);
698 if (parent_fp) {
699 if (parent_fp->daccess & FILE_DELETE_LE) {
700 pr_err("parent dir is opened with delete access\n");
701 err = -ESHARE;
702 goto out4;
703 }
704 }
705
706 rd.old_mnt_userns = mnt_user_ns(old_path.mnt),
707 rd.old_dir = old_path.dentry->d_inode,
708 rd.old_dentry = old_dentry,
709 rd.new_mnt_userns = mnt_user_ns(new_path.mnt),
710 rd.new_dir = new_path.dentry->d_inode,
711 rd.new_dentry = new_dentry,
712 rd.flags = flags,
713 err = vfs_rename(&rd);
714 if (err)
715 ksmbd_debug(VFS, "vfs_rename failed err %d\n", err);
716 out4:
717 dput(new_dentry);
718 out3:
719 dput(old_dentry);
720 out2:
721 unlock_rename(new_path.dentry, old_path.dentry);
722 path_put(&new_path);
723 out1:
724 path_put(&old_path);
725
726 putnames:
727 putname(to);
728 putname_from:
729 putname(from);
730 free_pathname:
731 kfree(pathname);
732 ksmbd_revert_fsids(work);
733 return err;
734 }
735
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
7 months, 1 week