All of lore.kernel.org
 help / color / mirror / Atom feed
* fs/notify/fanotify/fanotify_user.c:1233:20-23: ERROR: invalid reference to the index variable of the iterator on line 1219
@ 2024-01-19 20:16 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2024-01-19 20:16 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Amir Goldstein <amir73il@gmail.com>
CC: Jan Kara <jack@suse.cz>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   556e2d17cae620d549c5474b1ece053430cd50bc
commit: 30ad1938326bf9303ca38090339d948975a626f5 fanotify: allow "weak" fsid when watching a single filesystem
date:   7 weeks ago
:::::: branch date: 2 hours ago
:::::: commit date: 7 weeks ago
config: hexagon-randconfig-r061-20240117 (https://download.01.org/0day-ci/archive/20240120/202401200402.hYIvCgSX-lkp@intel.com/config)
compiler: clang version 18.0.0git (https://github.com/llvm/llvm-project 9bde5becb44ea071f5e1fa1f5d4071dc8788b18c)

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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202401200402.hYIvCgSX-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/notify/fanotify/fanotify_user.c:1233:20-23: ERROR: invalid reference to the index variable of the iterator on line 1219

vim +1233 fs/notify/fanotify/fanotify_user.c

30ad1938326bf93 Amir Goldstein 2023-11-30  1200  
30ad1938326bf93 Amir Goldstein 2023-11-30  1201  static int fanotify_set_mark_fsid(struct fsnotify_group *group,
30ad1938326bf93 Amir Goldstein 2023-11-30  1202  				  struct fsnotify_mark *mark,
30ad1938326bf93 Amir Goldstein 2023-11-30  1203  				  struct fan_fsid *fsid)
30ad1938326bf93 Amir Goldstein 2023-11-30  1204  {
30ad1938326bf93 Amir Goldstein 2023-11-30  1205  	struct fsnotify_mark_connector *conn;
30ad1938326bf93 Amir Goldstein 2023-11-30  1206  	struct fsnotify_mark *old;
30ad1938326bf93 Amir Goldstein 2023-11-30  1207  	struct super_block *old_sb = NULL;
30ad1938326bf93 Amir Goldstein 2023-11-30  1208  
30ad1938326bf93 Amir Goldstein 2023-11-30  1209  	FANOTIFY_MARK(mark)->fsid = fsid->id;
30ad1938326bf93 Amir Goldstein 2023-11-30  1210  	mark->flags |= FSNOTIFY_MARK_FLAG_HAS_FSID;
30ad1938326bf93 Amir Goldstein 2023-11-30  1211  	if (fsid->weak)
30ad1938326bf93 Amir Goldstein 2023-11-30  1212  		mark->flags |= FSNOTIFY_MARK_FLAG_WEAK_FSID;
30ad1938326bf93 Amir Goldstein 2023-11-30  1213  
30ad1938326bf93 Amir Goldstein 2023-11-30  1214  	/* First mark added will determine if group is single or multi fsid */
30ad1938326bf93 Amir Goldstein 2023-11-30  1215  	if (list_empty(&group->marks_list))
30ad1938326bf93 Amir Goldstein 2023-11-30  1216  		return 0;
30ad1938326bf93 Amir Goldstein 2023-11-30  1217  
30ad1938326bf93 Amir Goldstein 2023-11-30  1218  	/* Find sb of an existing mark */
30ad1938326bf93 Amir Goldstein 2023-11-30 @1219  	list_for_each_entry(old, &group->marks_list, g_list) {
30ad1938326bf93 Amir Goldstein 2023-11-30  1220  		conn = READ_ONCE(old->connector);
30ad1938326bf93 Amir Goldstein 2023-11-30  1221  		if (!conn)
30ad1938326bf93 Amir Goldstein 2023-11-30  1222  			continue;
30ad1938326bf93 Amir Goldstein 2023-11-30  1223  		old_sb = fsnotify_connector_sb(conn);
30ad1938326bf93 Amir Goldstein 2023-11-30  1224  		if (old_sb)
30ad1938326bf93 Amir Goldstein 2023-11-30  1225  			break;
30ad1938326bf93 Amir Goldstein 2023-11-30  1226  	}
30ad1938326bf93 Amir Goldstein 2023-11-30  1227  
30ad1938326bf93 Amir Goldstein 2023-11-30  1228  	/* Only detached marks left? */
30ad1938326bf93 Amir Goldstein 2023-11-30  1229  	if (!old_sb)
30ad1938326bf93 Amir Goldstein 2023-11-30  1230  		return 0;
30ad1938326bf93 Amir Goldstein 2023-11-30  1231  
30ad1938326bf93 Amir Goldstein 2023-11-30  1232  	/* Do not allow mixing of marks with weak and strong fsid */
30ad1938326bf93 Amir Goldstein 2023-11-30 @1233  	if ((mark->flags ^ old->flags) & FSNOTIFY_MARK_FLAG_WEAK_FSID)
30ad1938326bf93 Amir Goldstein 2023-11-30  1234  		return -EXDEV;
30ad1938326bf93 Amir Goldstein 2023-11-30  1235  
30ad1938326bf93 Amir Goldstein 2023-11-30  1236  	/* Allow mixing of marks with strong fsid from different fs */
30ad1938326bf93 Amir Goldstein 2023-11-30  1237  	if (!fsid->weak)
30ad1938326bf93 Amir Goldstein 2023-11-30  1238  		return 0;
30ad1938326bf93 Amir Goldstein 2023-11-30  1239  
30ad1938326bf93 Amir Goldstein 2023-11-30  1240  	/* Do not allow mixing marks with weak fsid from different fs */
30ad1938326bf93 Amir Goldstein 2023-11-30  1241  	if (old_sb != fsid->sb)
30ad1938326bf93 Amir Goldstein 2023-11-30  1242  		return -EXDEV;
30ad1938326bf93 Amir Goldstein 2023-11-30  1243  
30ad1938326bf93 Amir Goldstein 2023-11-30  1244  	/* Do not allow mixing marks from different btrfs sub-volumes */
30ad1938326bf93 Amir Goldstein 2023-11-30  1245  	if (!fanotify_fsid_equal(&FANOTIFY_MARK(old)->fsid,
30ad1938326bf93 Amir Goldstein 2023-11-30  1246  				 &FANOTIFY_MARK(mark)->fsid))
30ad1938326bf93 Amir Goldstein 2023-11-30  1247  		return -EXDEV;
30ad1938326bf93 Amir Goldstein 2023-11-30  1248  
30ad1938326bf93 Amir Goldstein 2023-11-30  1249  	return 0;
30ad1938326bf93 Amir Goldstein 2023-11-30  1250  }
30ad1938326bf93 Amir Goldstein 2023-11-30  1251  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* fs/notify/fanotify/fanotify_user.c:1233:20-23: ERROR: invalid reference to the index variable of the iterator on line 1219
@ 2024-09-30 19:24 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2024-09-30 19:24 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Amir Goldstein <amir73il@gmail.com>
CC: Jan Kara <jack@suse.cz>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9852d85ec9d492ebef56dc5f229416c925758edc
commit: 30ad1938326bf9303ca38090339d948975a626f5 fanotify: allow "weak" fsid when watching a single filesystem
date:   10 months ago
:::::: branch date: 21 hours ago
:::::: commit date: 10 months ago
config: nios2-randconfig-r062-20240930 (https://download.01.org/0day-ci/archive/20241001/202410010308.raeIz7Hp-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 14.1.0

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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202410010308.raeIz7Hp-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/notify/fanotify/fanotify_user.c:1233:20-23: ERROR: invalid reference to the index variable of the iterator on line 1219

vim +1233 fs/notify/fanotify/fanotify_user.c

30ad1938326bf9 Amir Goldstein 2023-11-30  1200  
30ad1938326bf9 Amir Goldstein 2023-11-30  1201  static int fanotify_set_mark_fsid(struct fsnotify_group *group,
30ad1938326bf9 Amir Goldstein 2023-11-30  1202  				  struct fsnotify_mark *mark,
30ad1938326bf9 Amir Goldstein 2023-11-30  1203  				  struct fan_fsid *fsid)
30ad1938326bf9 Amir Goldstein 2023-11-30  1204  {
30ad1938326bf9 Amir Goldstein 2023-11-30  1205  	struct fsnotify_mark_connector *conn;
30ad1938326bf9 Amir Goldstein 2023-11-30  1206  	struct fsnotify_mark *old;
30ad1938326bf9 Amir Goldstein 2023-11-30  1207  	struct super_block *old_sb = NULL;
30ad1938326bf9 Amir Goldstein 2023-11-30  1208  
30ad1938326bf9 Amir Goldstein 2023-11-30  1209  	FANOTIFY_MARK(mark)->fsid = fsid->id;
30ad1938326bf9 Amir Goldstein 2023-11-30  1210  	mark->flags |= FSNOTIFY_MARK_FLAG_HAS_FSID;
30ad1938326bf9 Amir Goldstein 2023-11-30  1211  	if (fsid->weak)
30ad1938326bf9 Amir Goldstein 2023-11-30  1212  		mark->flags |= FSNOTIFY_MARK_FLAG_WEAK_FSID;
30ad1938326bf9 Amir Goldstein 2023-11-30  1213  
30ad1938326bf9 Amir Goldstein 2023-11-30  1214  	/* First mark added will determine if group is single or multi fsid */
30ad1938326bf9 Amir Goldstein 2023-11-30  1215  	if (list_empty(&group->marks_list))
30ad1938326bf9 Amir Goldstein 2023-11-30  1216  		return 0;
30ad1938326bf9 Amir Goldstein 2023-11-30  1217  
30ad1938326bf9 Amir Goldstein 2023-11-30  1218  	/* Find sb of an existing mark */
30ad1938326bf9 Amir Goldstein 2023-11-30 @1219  	list_for_each_entry(old, &group->marks_list, g_list) {
30ad1938326bf9 Amir Goldstein 2023-11-30  1220  		conn = READ_ONCE(old->connector);
30ad1938326bf9 Amir Goldstein 2023-11-30  1221  		if (!conn)
30ad1938326bf9 Amir Goldstein 2023-11-30  1222  			continue;
30ad1938326bf9 Amir Goldstein 2023-11-30  1223  		old_sb = fsnotify_connector_sb(conn);
30ad1938326bf9 Amir Goldstein 2023-11-30  1224  		if (old_sb)
30ad1938326bf9 Amir Goldstein 2023-11-30  1225  			break;
30ad1938326bf9 Amir Goldstein 2023-11-30  1226  	}
30ad1938326bf9 Amir Goldstein 2023-11-30  1227  
30ad1938326bf9 Amir Goldstein 2023-11-30  1228  	/* Only detached marks left? */
30ad1938326bf9 Amir Goldstein 2023-11-30  1229  	if (!old_sb)
30ad1938326bf9 Amir Goldstein 2023-11-30  1230  		return 0;
30ad1938326bf9 Amir Goldstein 2023-11-30  1231  
30ad1938326bf9 Amir Goldstein 2023-11-30  1232  	/* Do not allow mixing of marks with weak and strong fsid */
30ad1938326bf9 Amir Goldstein 2023-11-30 @1233  	if ((mark->flags ^ old->flags) & FSNOTIFY_MARK_FLAG_WEAK_FSID)
30ad1938326bf9 Amir Goldstein 2023-11-30  1234  		return -EXDEV;
30ad1938326bf9 Amir Goldstein 2023-11-30  1235  
30ad1938326bf9 Amir Goldstein 2023-11-30  1236  	/* Allow mixing of marks with strong fsid from different fs */
30ad1938326bf9 Amir Goldstein 2023-11-30  1237  	if (!fsid->weak)
30ad1938326bf9 Amir Goldstein 2023-11-30  1238  		return 0;
30ad1938326bf9 Amir Goldstein 2023-11-30  1239  
30ad1938326bf9 Amir Goldstein 2023-11-30  1240  	/* Do not allow mixing marks with weak fsid from different fs */
30ad1938326bf9 Amir Goldstein 2023-11-30  1241  	if (old_sb != fsid->sb)
30ad1938326bf9 Amir Goldstein 2023-11-30  1242  		return -EXDEV;
30ad1938326bf9 Amir Goldstein 2023-11-30  1243  
30ad1938326bf9 Amir Goldstein 2023-11-30  1244  	/* Do not allow mixing marks from different btrfs sub-volumes */
30ad1938326bf9 Amir Goldstein 2023-11-30  1245  	if (!fanotify_fsid_equal(&FANOTIFY_MARK(old)->fsid,
30ad1938326bf9 Amir Goldstein 2023-11-30  1246  				 &FANOTIFY_MARK(mark)->fsid))
30ad1938326bf9 Amir Goldstein 2023-11-30  1247  		return -EXDEV;
30ad1938326bf9 Amir Goldstein 2023-11-30  1248  
30ad1938326bf9 Amir Goldstein 2023-11-30  1249  	return 0;
30ad1938326bf9 Amir Goldstein 2023-11-30  1250  }
30ad1938326bf9 Amir Goldstein 2023-11-30  1251  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* fs/notify/fanotify/fanotify_user.c:1233:20-23: ERROR: invalid reference to the index variable of the iterator on line 1219
@ 2024-11-18 15:08 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2024-11-18 15:08 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Amir Goldstein <amir73il@gmail.com>
CC: Jan Kara <jack@suse.cz>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   adc218676eef25575469234709c2d87185ca223a
commit: 30ad1938326bf9303ca38090339d948975a626f5 fanotify: allow "weak" fsid when watching a single filesystem
date:   12 months ago
:::::: branch date: 17 hours ago
:::::: commit date: 12 months ago
config: i386-randconfig-054-20241118 (https://download.01.org/0day-ci/archive/20241118/202411182345.toGcRvhZ-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202411182345.toGcRvhZ-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/notify/fanotify/fanotify_user.c:1233:20-23: ERROR: invalid reference to the index variable of the iterator on line 1219

vim +1233 fs/notify/fanotify/fanotify_user.c

30ad1938326bf9 Amir Goldstein 2023-11-30  1200  
30ad1938326bf9 Amir Goldstein 2023-11-30  1201  static int fanotify_set_mark_fsid(struct fsnotify_group *group,
30ad1938326bf9 Amir Goldstein 2023-11-30  1202  				  struct fsnotify_mark *mark,
30ad1938326bf9 Amir Goldstein 2023-11-30  1203  				  struct fan_fsid *fsid)
30ad1938326bf9 Amir Goldstein 2023-11-30  1204  {
30ad1938326bf9 Amir Goldstein 2023-11-30  1205  	struct fsnotify_mark_connector *conn;
30ad1938326bf9 Amir Goldstein 2023-11-30  1206  	struct fsnotify_mark *old;
30ad1938326bf9 Amir Goldstein 2023-11-30  1207  	struct super_block *old_sb = NULL;
30ad1938326bf9 Amir Goldstein 2023-11-30  1208  
30ad1938326bf9 Amir Goldstein 2023-11-30  1209  	FANOTIFY_MARK(mark)->fsid = fsid->id;
30ad1938326bf9 Amir Goldstein 2023-11-30  1210  	mark->flags |= FSNOTIFY_MARK_FLAG_HAS_FSID;
30ad1938326bf9 Amir Goldstein 2023-11-30  1211  	if (fsid->weak)
30ad1938326bf9 Amir Goldstein 2023-11-30  1212  		mark->flags |= FSNOTIFY_MARK_FLAG_WEAK_FSID;
30ad1938326bf9 Amir Goldstein 2023-11-30  1213  
30ad1938326bf9 Amir Goldstein 2023-11-30  1214  	/* First mark added will determine if group is single or multi fsid */
30ad1938326bf9 Amir Goldstein 2023-11-30  1215  	if (list_empty(&group->marks_list))
30ad1938326bf9 Amir Goldstein 2023-11-30  1216  		return 0;
30ad1938326bf9 Amir Goldstein 2023-11-30  1217  
30ad1938326bf9 Amir Goldstein 2023-11-30  1218  	/* Find sb of an existing mark */
30ad1938326bf9 Amir Goldstein 2023-11-30 @1219  	list_for_each_entry(old, &group->marks_list, g_list) {
30ad1938326bf9 Amir Goldstein 2023-11-30  1220  		conn = READ_ONCE(old->connector);
30ad1938326bf9 Amir Goldstein 2023-11-30  1221  		if (!conn)
30ad1938326bf9 Amir Goldstein 2023-11-30  1222  			continue;
30ad1938326bf9 Amir Goldstein 2023-11-30  1223  		old_sb = fsnotify_connector_sb(conn);
30ad1938326bf9 Amir Goldstein 2023-11-30  1224  		if (old_sb)
30ad1938326bf9 Amir Goldstein 2023-11-30  1225  			break;
30ad1938326bf9 Amir Goldstein 2023-11-30  1226  	}
30ad1938326bf9 Amir Goldstein 2023-11-30  1227  
30ad1938326bf9 Amir Goldstein 2023-11-30  1228  	/* Only detached marks left? */
30ad1938326bf9 Amir Goldstein 2023-11-30  1229  	if (!old_sb)
30ad1938326bf9 Amir Goldstein 2023-11-30  1230  		return 0;
30ad1938326bf9 Amir Goldstein 2023-11-30  1231  
30ad1938326bf9 Amir Goldstein 2023-11-30  1232  	/* Do not allow mixing of marks with weak and strong fsid */
30ad1938326bf9 Amir Goldstein 2023-11-30 @1233  	if ((mark->flags ^ old->flags) & FSNOTIFY_MARK_FLAG_WEAK_FSID)
30ad1938326bf9 Amir Goldstein 2023-11-30  1234  		return -EXDEV;
30ad1938326bf9 Amir Goldstein 2023-11-30  1235  
30ad1938326bf9 Amir Goldstein 2023-11-30  1236  	/* Allow mixing of marks with strong fsid from different fs */
30ad1938326bf9 Amir Goldstein 2023-11-30  1237  	if (!fsid->weak)
30ad1938326bf9 Amir Goldstein 2023-11-30  1238  		return 0;
30ad1938326bf9 Amir Goldstein 2023-11-30  1239  
30ad1938326bf9 Amir Goldstein 2023-11-30  1240  	/* Do not allow mixing marks with weak fsid from different fs */
30ad1938326bf9 Amir Goldstein 2023-11-30  1241  	if (old_sb != fsid->sb)
30ad1938326bf9 Amir Goldstein 2023-11-30  1242  		return -EXDEV;
30ad1938326bf9 Amir Goldstein 2023-11-30  1243  
30ad1938326bf9 Amir Goldstein 2023-11-30  1244  	/* Do not allow mixing marks from different btrfs sub-volumes */
30ad1938326bf9 Amir Goldstein 2023-11-30  1245  	if (!fanotify_fsid_equal(&FANOTIFY_MARK(old)->fsid,
30ad1938326bf9 Amir Goldstein 2023-11-30  1246  				 &FANOTIFY_MARK(mark)->fsid))
30ad1938326bf9 Amir Goldstein 2023-11-30  1247  		return -EXDEV;
30ad1938326bf9 Amir Goldstein 2023-11-30  1248  
30ad1938326bf9 Amir Goldstein 2023-11-30  1249  	return 0;
30ad1938326bf9 Amir Goldstein 2023-11-30  1250  }
30ad1938326bf9 Amir Goldstein 2023-11-30  1251  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* fs/notify/fanotify/fanotify_user.c:1233:20-23: ERROR: invalid reference to the index variable of the iterator on line 1219
@ 2024-12-02  3:14 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2024-12-02  3:14 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Amir Goldstein <amir73il@gmail.com>
CC: Jan Kara <jack@suse.cz>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   40384c840ea1944d7c5a392e8975ed088ecf0b37
commit: 30ad1938326bf9303ca38090339d948975a626f5 fanotify: allow "weak" fsid when watching a single filesystem
date:   1 year ago
:::::: branch date: 5 hours ago
:::::: commit date: 1 year ago
config: i386-randconfig-054-20241118 (https://download.01.org/0day-ci/archive/20241202/202412021154.5uFNariI-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202412021154.5uFNariI-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/notify/fanotify/fanotify_user.c:1233:20-23: ERROR: invalid reference to the index variable of the iterator on line 1219

vim +1233 fs/notify/fanotify/fanotify_user.c

30ad1938326bf9 Amir Goldstein 2023-11-30  1200  
30ad1938326bf9 Amir Goldstein 2023-11-30  1201  static int fanotify_set_mark_fsid(struct fsnotify_group *group,
30ad1938326bf9 Amir Goldstein 2023-11-30  1202  				  struct fsnotify_mark *mark,
30ad1938326bf9 Amir Goldstein 2023-11-30  1203  				  struct fan_fsid *fsid)
30ad1938326bf9 Amir Goldstein 2023-11-30  1204  {
30ad1938326bf9 Amir Goldstein 2023-11-30  1205  	struct fsnotify_mark_connector *conn;
30ad1938326bf9 Amir Goldstein 2023-11-30  1206  	struct fsnotify_mark *old;
30ad1938326bf9 Amir Goldstein 2023-11-30  1207  	struct super_block *old_sb = NULL;
30ad1938326bf9 Amir Goldstein 2023-11-30  1208  
30ad1938326bf9 Amir Goldstein 2023-11-30  1209  	FANOTIFY_MARK(mark)->fsid = fsid->id;
30ad1938326bf9 Amir Goldstein 2023-11-30  1210  	mark->flags |= FSNOTIFY_MARK_FLAG_HAS_FSID;
30ad1938326bf9 Amir Goldstein 2023-11-30  1211  	if (fsid->weak)
30ad1938326bf9 Amir Goldstein 2023-11-30  1212  		mark->flags |= FSNOTIFY_MARK_FLAG_WEAK_FSID;
30ad1938326bf9 Amir Goldstein 2023-11-30  1213  
30ad1938326bf9 Amir Goldstein 2023-11-30  1214  	/* First mark added will determine if group is single or multi fsid */
30ad1938326bf9 Amir Goldstein 2023-11-30  1215  	if (list_empty(&group->marks_list))
30ad1938326bf9 Amir Goldstein 2023-11-30  1216  		return 0;
30ad1938326bf9 Amir Goldstein 2023-11-30  1217  
30ad1938326bf9 Amir Goldstein 2023-11-30  1218  	/* Find sb of an existing mark */
30ad1938326bf9 Amir Goldstein 2023-11-30 @1219  	list_for_each_entry(old, &group->marks_list, g_list) {
30ad1938326bf9 Amir Goldstein 2023-11-30  1220  		conn = READ_ONCE(old->connector);
30ad1938326bf9 Amir Goldstein 2023-11-30  1221  		if (!conn)
30ad1938326bf9 Amir Goldstein 2023-11-30  1222  			continue;
30ad1938326bf9 Amir Goldstein 2023-11-30  1223  		old_sb = fsnotify_connector_sb(conn);
30ad1938326bf9 Amir Goldstein 2023-11-30  1224  		if (old_sb)
30ad1938326bf9 Amir Goldstein 2023-11-30  1225  			break;
30ad1938326bf9 Amir Goldstein 2023-11-30  1226  	}
30ad1938326bf9 Amir Goldstein 2023-11-30  1227  
30ad1938326bf9 Amir Goldstein 2023-11-30  1228  	/* Only detached marks left? */
30ad1938326bf9 Amir Goldstein 2023-11-30  1229  	if (!old_sb)
30ad1938326bf9 Amir Goldstein 2023-11-30  1230  		return 0;
30ad1938326bf9 Amir Goldstein 2023-11-30  1231  
30ad1938326bf9 Amir Goldstein 2023-11-30  1232  	/* Do not allow mixing of marks with weak and strong fsid */
30ad1938326bf9 Amir Goldstein 2023-11-30 @1233  	if ((mark->flags ^ old->flags) & FSNOTIFY_MARK_FLAG_WEAK_FSID)
30ad1938326bf9 Amir Goldstein 2023-11-30  1234  		return -EXDEV;
30ad1938326bf9 Amir Goldstein 2023-11-30  1235  
30ad1938326bf9 Amir Goldstein 2023-11-30  1236  	/* Allow mixing of marks with strong fsid from different fs */
30ad1938326bf9 Amir Goldstein 2023-11-30  1237  	if (!fsid->weak)
30ad1938326bf9 Amir Goldstein 2023-11-30  1238  		return 0;
30ad1938326bf9 Amir Goldstein 2023-11-30  1239  
30ad1938326bf9 Amir Goldstein 2023-11-30  1240  	/* Do not allow mixing marks with weak fsid from different fs */
30ad1938326bf9 Amir Goldstein 2023-11-30  1241  	if (old_sb != fsid->sb)
30ad1938326bf9 Amir Goldstein 2023-11-30  1242  		return -EXDEV;
30ad1938326bf9 Amir Goldstein 2023-11-30  1243  
30ad1938326bf9 Amir Goldstein 2023-11-30  1244  	/* Do not allow mixing marks from different btrfs sub-volumes */
30ad1938326bf9 Amir Goldstein 2023-11-30  1245  	if (!fanotify_fsid_equal(&FANOTIFY_MARK(old)->fsid,
30ad1938326bf9 Amir Goldstein 2023-11-30  1246  				 &FANOTIFY_MARK(mark)->fsid))
30ad1938326bf9 Amir Goldstein 2023-11-30  1247  		return -EXDEV;
30ad1938326bf9 Amir Goldstein 2023-11-30  1248  
30ad1938326bf9 Amir Goldstein 2023-11-30  1249  	return 0;
30ad1938326bf9 Amir Goldstein 2023-11-30  1250  }
30ad1938326bf9 Amir Goldstein 2023-11-30  1251  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 5+ messages in thread

* fs/notify/fanotify/fanotify_user.c:1233:20-23: ERROR: invalid reference to the index variable of the iterator on line 1219
@ 2024-12-09 18:33 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2024-12-09 18:33 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Amir Goldstein <amir73il@gmail.com>
CC: Jan Kara <jack@suse.cz>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fac04efc5c793dccbd07e2d59af9f90b7fc0dca4
commit: 30ad1938326bf9303ca38090339d948975a626f5 fanotify: allow "weak" fsid when watching a single filesystem
date:   1 year ago
:::::: branch date: 20 hours ago
:::::: commit date: 1 year ago
config: i386-randconfig-053-20241209 (https://download.01.org/0day-ci/archive/20241210/202412100248.IRl1qnuh-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202412100248.IRl1qnuh-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> fs/notify/fanotify/fanotify_user.c:1233:20-23: ERROR: invalid reference to the index variable of the iterator on line 1219

vim +1233 fs/notify/fanotify/fanotify_user.c

30ad1938326bf93 Amir Goldstein 2023-11-30  1200  
30ad1938326bf93 Amir Goldstein 2023-11-30  1201  static int fanotify_set_mark_fsid(struct fsnotify_group *group,
30ad1938326bf93 Amir Goldstein 2023-11-30  1202  				  struct fsnotify_mark *mark,
30ad1938326bf93 Amir Goldstein 2023-11-30  1203  				  struct fan_fsid *fsid)
30ad1938326bf93 Amir Goldstein 2023-11-30  1204  {
30ad1938326bf93 Amir Goldstein 2023-11-30  1205  	struct fsnotify_mark_connector *conn;
30ad1938326bf93 Amir Goldstein 2023-11-30  1206  	struct fsnotify_mark *old;
30ad1938326bf93 Amir Goldstein 2023-11-30  1207  	struct super_block *old_sb = NULL;
30ad1938326bf93 Amir Goldstein 2023-11-30  1208  
30ad1938326bf93 Amir Goldstein 2023-11-30  1209  	FANOTIFY_MARK(mark)->fsid = fsid->id;
30ad1938326bf93 Amir Goldstein 2023-11-30  1210  	mark->flags |= FSNOTIFY_MARK_FLAG_HAS_FSID;
30ad1938326bf93 Amir Goldstein 2023-11-30  1211  	if (fsid->weak)
30ad1938326bf93 Amir Goldstein 2023-11-30  1212  		mark->flags |= FSNOTIFY_MARK_FLAG_WEAK_FSID;
30ad1938326bf93 Amir Goldstein 2023-11-30  1213  
30ad1938326bf93 Amir Goldstein 2023-11-30  1214  	/* First mark added will determine if group is single or multi fsid */
30ad1938326bf93 Amir Goldstein 2023-11-30  1215  	if (list_empty(&group->marks_list))
30ad1938326bf93 Amir Goldstein 2023-11-30  1216  		return 0;
30ad1938326bf93 Amir Goldstein 2023-11-30  1217  
30ad1938326bf93 Amir Goldstein 2023-11-30  1218  	/* Find sb of an existing mark */
30ad1938326bf93 Amir Goldstein 2023-11-30 @1219  	list_for_each_entry(old, &group->marks_list, g_list) {
30ad1938326bf93 Amir Goldstein 2023-11-30  1220  		conn = READ_ONCE(old->connector);
30ad1938326bf93 Amir Goldstein 2023-11-30  1221  		if (!conn)
30ad1938326bf93 Amir Goldstein 2023-11-30  1222  			continue;
30ad1938326bf93 Amir Goldstein 2023-11-30  1223  		old_sb = fsnotify_connector_sb(conn);
30ad1938326bf93 Amir Goldstein 2023-11-30  1224  		if (old_sb)
30ad1938326bf93 Amir Goldstein 2023-11-30  1225  			break;
30ad1938326bf93 Amir Goldstein 2023-11-30  1226  	}
30ad1938326bf93 Amir Goldstein 2023-11-30  1227  
30ad1938326bf93 Amir Goldstein 2023-11-30  1228  	/* Only detached marks left? */
30ad1938326bf93 Amir Goldstein 2023-11-30  1229  	if (!old_sb)
30ad1938326bf93 Amir Goldstein 2023-11-30  1230  		return 0;
30ad1938326bf93 Amir Goldstein 2023-11-30  1231  
30ad1938326bf93 Amir Goldstein 2023-11-30  1232  	/* Do not allow mixing of marks with weak and strong fsid */
30ad1938326bf93 Amir Goldstein 2023-11-30 @1233  	if ((mark->flags ^ old->flags) & FSNOTIFY_MARK_FLAG_WEAK_FSID)
30ad1938326bf93 Amir Goldstein 2023-11-30  1234  		return -EXDEV;
30ad1938326bf93 Amir Goldstein 2023-11-30  1235  
30ad1938326bf93 Amir Goldstein 2023-11-30  1236  	/* Allow mixing of marks with strong fsid from different fs */
30ad1938326bf93 Amir Goldstein 2023-11-30  1237  	if (!fsid->weak)
30ad1938326bf93 Amir Goldstein 2023-11-30  1238  		return 0;
30ad1938326bf93 Amir Goldstein 2023-11-30  1239  
30ad1938326bf93 Amir Goldstein 2023-11-30  1240  	/* Do not allow mixing marks with weak fsid from different fs */
30ad1938326bf93 Amir Goldstein 2023-11-30  1241  	if (old_sb != fsid->sb)
30ad1938326bf93 Amir Goldstein 2023-11-30  1242  		return -EXDEV;
30ad1938326bf93 Amir Goldstein 2023-11-30  1243  
30ad1938326bf93 Amir Goldstein 2023-11-30  1244  	/* Do not allow mixing marks from different btrfs sub-volumes */
30ad1938326bf93 Amir Goldstein 2023-11-30  1245  	if (!fanotify_fsid_equal(&FANOTIFY_MARK(old)->fsid,
30ad1938326bf93 Amir Goldstein 2023-11-30  1246  				 &FANOTIFY_MARK(mark)->fsid))
30ad1938326bf93 Amir Goldstein 2023-11-30  1247  		return -EXDEV;
30ad1938326bf93 Amir Goldstein 2023-11-30  1248  
30ad1938326bf93 Amir Goldstein 2023-11-30  1249  	return 0;
30ad1938326bf93 Amir Goldstein 2023-11-30  1250  }
30ad1938326bf93 Amir Goldstein 2023-11-30  1251  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-12-09 18:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-09 18:33 fs/notify/fanotify/fanotify_user.c:1233:20-23: ERROR: invalid reference to the index variable of the iterator on line 1219 kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2024-12-02  3:14 kernel test robot
2024-11-18 15:08 kernel test robot
2024-09-30 19:24 kernel test robot
2024-01-19 20:16 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.