All of lore.kernel.org
 help / color / mirror / Atom feed
diff for duplicates of <202202021722.Gftmgh6J-lkp@intel.com>

diff --git a/a/1.txt b/N1/1.txt
index 00df294..d7d39e9 100644
--- a/a/1.txt
+++ b/N1/1.txt
@@ -1,17 +1,7 @@
-CC: kbuild-all(a)lists.01.org
-In-Reply-To: <20220201205534.1962784-3-haoluo@google.com>
-References: <20220201205534.1962784-3-haoluo@google.com>
-TO: Hao Luo <haoluo@google.com>
-
 Hi Hao,
 
-[FYI, it's a private test report for your RFC patch.]
-[auto build test WARNING on bpf-next/master]
-
 url:    https://github.com/0day-ci/linux/commits/Hao-Luo/Extend-cgroup-interface-with-bpf/20220202-045743
 base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
-:::::: branch date: 12 hours ago
-:::::: commit date: 12 hours ago
 config: i386-randconfig-m021-20220131 (https://download.01.org/0day-ci/archive/20220202/202202021722.Gftmgh6J-lkp(a)intel.com/config)
 compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
 
@@ -25,7 +15,6 @@ kernel/bpf/inode.c:251 populate_dir() error: uninitialized symbol 'ret'.
 
 vim +/e +71 kernel/bpf/inode.c
 
-b2197755b2633e Daniel Borkmann   2015-10-29   64  
 f6c6ca7ed74437 Hao Luo           2022-02-01   65  static void free_obj_list(struct kref *kref)
 f6c6ca7ed74437 Hao Luo           2022-02-01   66  {
 f6c6ca7ed74437 Hao Luo           2022-02-01   67  	struct obj_list *list;
@@ -33,147 +22,19 @@ f6c6ca7ed74437 Hao Luo           2022-02-01   68  	struct bpf_inherit_entry *e;
 f6c6ca7ed74437 Hao Luo           2022-02-01   69  
 f6c6ca7ed74437 Hao Luo           2022-02-01   70  	list = container_of(kref, struct obj_list, refcnt);
 f6c6ca7ed74437 Hao Luo           2022-02-01  @71  	list_for_each_entry(e, &list->list, list) {
+
+Need to use list_for_each_entry_safe() because this frees the list
+iterator.
+
 f6c6ca7ed74437 Hao Luo           2022-02-01   72  		list_del_rcu(&e->list);
 f6c6ca7ed74437 Hao Luo           2022-02-01   73  		bpf_any_put(e->obj, e->type);
 f6c6ca7ed74437 Hao Luo           2022-02-01   74  		kfree(e);
 f6c6ca7ed74437 Hao Luo           2022-02-01   75  	}
 f6c6ca7ed74437 Hao Luo           2022-02-01   76  	kfree(list);
 f6c6ca7ed74437 Hao Luo           2022-02-01   77  }
-f6c6ca7ed74437 Hao Luo           2022-02-01   78  
-b2197755b2633e Daniel Borkmann   2015-10-29   79  static void *bpf_fd_probe_obj(u32 ufd, enum bpf_type *type)
-b2197755b2633e Daniel Borkmann   2015-10-29   80  {
-b2197755b2633e Daniel Borkmann   2015-10-29   81  	void *raw;
-b2197755b2633e Daniel Borkmann   2015-10-29   82  
-c9da161c6517ba Daniel Borkmann   2015-11-24   83  	raw = bpf_map_get_with_uref(ufd);
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02   84  	if (!IS_ERR(raw)) {
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02   85  		*type = BPF_TYPE_MAP;
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02   86  		return raw;
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02   87  	}
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02   88  
-b2197755b2633e Daniel Borkmann   2015-10-29   89  	raw = bpf_prog_get(ufd);
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02   90  	if (!IS_ERR(raw)) {
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02   91  		*type = BPF_TYPE_PROG;
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02   92  		return raw;
-b2197755b2633e Daniel Borkmann   2015-10-29   93  	}
-b2197755b2633e Daniel Borkmann   2015-10-29   94  
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02   95  	raw = bpf_link_get_from_fd(ufd);
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02   96  	if (!IS_ERR(raw)) {
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02   97  		*type = BPF_TYPE_LINK;
-b2197755b2633e Daniel Borkmann   2015-10-29   98  		return raw;
-b2197755b2633e Daniel Borkmann   2015-10-29   99  	}
-b2197755b2633e Daniel Borkmann   2015-10-29  100  
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02  101  	return ERR_PTR(-EINVAL);
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02  102  }
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02  103  
-b2197755b2633e Daniel Borkmann   2015-10-29  104  static const struct inode_operations bpf_dir_iops;
-b2197755b2633e Daniel Borkmann   2015-10-29  105  
-b2197755b2633e Daniel Borkmann   2015-10-29  106  static const struct inode_operations bpf_prog_iops = { };
-b2197755b2633e Daniel Borkmann   2015-10-29  107  static const struct inode_operations bpf_map_iops  = { };
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02  108  static const struct inode_operations bpf_link_iops  = { };
-b2197755b2633e Daniel Borkmann   2015-10-29  109  
-f6c6ca7ed74437 Hao Luo           2022-02-01  110  static int bpf_mkprog(struct dentry *dentry, umode_t mode, void *arg);
-f6c6ca7ed74437 Hao Luo           2022-02-01  111  static int bpf_mkmap(struct dentry *dentry, umode_t mode, void *arg);
-f6c6ca7ed74437 Hao Luo           2022-02-01  112  static int bpf_mklink(struct dentry *dentry, umode_t mode, void *arg);
-f6c6ca7ed74437 Hao Luo           2022-02-01  113  
-b2197755b2633e Daniel Borkmann   2015-10-29  114  static struct inode *bpf_get_inode(struct super_block *sb,
-b2197755b2633e Daniel Borkmann   2015-10-29  115  				   const struct inode *dir,
-b2197755b2633e Daniel Borkmann   2015-10-29  116  				   umode_t mode)
-b2197755b2633e Daniel Borkmann   2015-10-29  117  {
-b2197755b2633e Daniel Borkmann   2015-10-29  118  	struct inode *inode;
-b2197755b2633e Daniel Borkmann   2015-10-29  119  
-b2197755b2633e Daniel Borkmann   2015-10-29  120  	switch (mode & S_IFMT) {
-b2197755b2633e Daniel Borkmann   2015-10-29  121  	case S_IFDIR:
-b2197755b2633e Daniel Borkmann   2015-10-29  122  	case S_IFREG:
-0f98621bef5d2b Daniel Borkmann   2016-10-29  123  	case S_IFLNK:
-b2197755b2633e Daniel Borkmann   2015-10-29  124  		break;
-b2197755b2633e Daniel Borkmann   2015-10-29  125  	default:
-b2197755b2633e Daniel Borkmann   2015-10-29  126  		return ERR_PTR(-EINVAL);
-b2197755b2633e Daniel Borkmann   2015-10-29  127  	}
-b2197755b2633e Daniel Borkmann   2015-10-29  128  
-b2197755b2633e Daniel Borkmann   2015-10-29  129  	inode = new_inode(sb);
-b2197755b2633e Daniel Borkmann   2015-10-29  130  	if (!inode)
-b2197755b2633e Daniel Borkmann   2015-10-29  131  		return ERR_PTR(-ENOSPC);
-b2197755b2633e Daniel Borkmann   2015-10-29  132  
-b2197755b2633e Daniel Borkmann   2015-10-29  133  	inode->i_ino = get_next_ino();
-078cd8279e6599 Deepa Dinamani    2016-09-14  134  	inode->i_atime = current_time(inode);
-b2197755b2633e Daniel Borkmann   2015-10-29  135  	inode->i_mtime = inode->i_atime;
-b2197755b2633e Daniel Borkmann   2015-10-29  136  	inode->i_ctime = inode->i_atime;
-b2197755b2633e Daniel Borkmann   2015-10-29  137  
-21cb47be6fb9ec Christian Brauner 2021-01-21  138  	inode_init_owner(&init_user_ns, inode, dir, mode);
-b2197755b2633e Daniel Borkmann   2015-10-29  139  
-b2197755b2633e Daniel Borkmann   2015-10-29  140  	return inode;
-b2197755b2633e Daniel Borkmann   2015-10-29  141  }
-b2197755b2633e Daniel Borkmann   2015-10-29  142  
-b2197755b2633e Daniel Borkmann   2015-10-29  143  static int bpf_inode_type(const struct inode *inode, enum bpf_type *type)
-b2197755b2633e Daniel Borkmann   2015-10-29  144  {
-b2197755b2633e Daniel Borkmann   2015-10-29  145  	*type = BPF_TYPE_UNSPEC;
-b2197755b2633e Daniel Borkmann   2015-10-29  146  	if (inode->i_op == &bpf_prog_iops)
-b2197755b2633e Daniel Borkmann   2015-10-29  147  		*type = BPF_TYPE_PROG;
-b2197755b2633e Daniel Borkmann   2015-10-29  148  	else if (inode->i_op == &bpf_map_iops)
-b2197755b2633e Daniel Borkmann   2015-10-29  149  		*type = BPF_TYPE_MAP;
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02  150  	else if (inode->i_op == &bpf_link_iops)
-70ed506c3bbcfa Andrii Nakryiko   2020-03-02  151  		*type = BPF_TYPE_LINK;
-b2197755b2633e Daniel Borkmann   2015-10-29  152  	else
-b2197755b2633e Daniel Borkmann   2015-10-29  153  		return -EACCES;
-b2197755b2633e Daniel Borkmann   2015-10-29  154  
-b2197755b2633e Daniel Borkmann   2015-10-29  155  	return 0;
-b2197755b2633e Daniel Borkmann   2015-10-29  156  }
-b2197755b2633e Daniel Borkmann   2015-10-29  157  
-3a2ad553a70d36 Hao Luo           2022-02-01  158  static struct bpf_dir_tag *inode_tag(const struct inode *inode)
-3a2ad553a70d36 Hao Luo           2022-02-01  159  {
-3a2ad553a70d36 Hao Luo           2022-02-01  160  	if (unlikely(!S_ISDIR(inode->i_mode)))
-3a2ad553a70d36 Hao Luo           2022-02-01  161  		return NULL;
-3a2ad553a70d36 Hao Luo           2022-02-01  162  
-3a2ad553a70d36 Hao Luo           2022-02-01  163  	return inode->i_private;
-3a2ad553a70d36 Hao Luo           2022-02-01  164  }
-3a2ad553a70d36 Hao Luo           2022-02-01  165  
-3a2ad553a70d36 Hao Luo           2022-02-01  166  /* tag_dir_inode - tag a newly created directory.
-3a2ad553a70d36 Hao Luo           2022-02-01  167   * @tag: tag of parent directory
-3a2ad553a70d36 Hao Luo           2022-02-01  168   * @dentry: dentry of the new directory
-3a2ad553a70d36 Hao Luo           2022-02-01  169   * @inode: inode of the new directory
-3a2ad553a70d36 Hao Luo           2022-02-01  170   *
-3a2ad553a70d36 Hao Luo           2022-02-01  171   * Called from bpf_mkdir.
-3a2ad553a70d36 Hao Luo           2022-02-01  172   */
-3a2ad553a70d36 Hao Luo           2022-02-01  173  static int tag_dir_inode(const struct bpf_dir_tag *tag,
-3a2ad553a70d36 Hao Luo           2022-02-01  174  			 const struct dentry *dentry, struct inode *inode)
-3a2ad553a70d36 Hao Luo           2022-02-01  175  {
-3a2ad553a70d36 Hao Luo           2022-02-01  176  	struct bpf_dir_tag *t;
-3a2ad553a70d36 Hao Luo           2022-02-01  177  	struct kernfs_node *kn;
-3a2ad553a70d36 Hao Luo           2022-02-01  178  
-3a2ad553a70d36 Hao Luo           2022-02-01  179  	WARN_ON(tag->type != BPF_DIR_KERNFS_REP);
-3a2ad553a70d36 Hao Luo           2022-02-01  180  
-3a2ad553a70d36 Hao Luo           2022-02-01  181  	/* kn is put at tag deallocation. */
-3a2ad553a70d36 Hao Luo           2022-02-01  182  	kn = kernfs_find_and_get_ns(tag->private, dentry->d_name.name, NULL);
-3a2ad553a70d36 Hao Luo           2022-02-01  183  	if (unlikely(!kn))
-3a2ad553a70d36 Hao Luo           2022-02-01  184  		return -ENOENT;
-3a2ad553a70d36 Hao Luo           2022-02-01  185  
-3a2ad553a70d36 Hao Luo           2022-02-01  186  	if (unlikely(kernfs_type(kn) != KERNFS_DIR)) {
-3a2ad553a70d36 Hao Luo           2022-02-01  187  		kernfs_put(kn);
-3a2ad553a70d36 Hao Luo           2022-02-01  188  		return -EPERM;
-3a2ad553a70d36 Hao Luo           2022-02-01  189  	}
-3a2ad553a70d36 Hao Luo           2022-02-01  190  
-3a2ad553a70d36 Hao Luo           2022-02-01  191  	t = kzalloc(sizeof(struct bpf_dir_tag), GFP_KERNEL | __GFP_NOWARN);
-3a2ad553a70d36 Hao Luo           2022-02-01  192  	if (unlikely(!t)) {
-3a2ad553a70d36 Hao Luo           2022-02-01  193  		kernfs_put(kn);
-3a2ad553a70d36 Hao Luo           2022-02-01  194  		return -ENOMEM;
-3a2ad553a70d36 Hao Luo           2022-02-01  195  	}
-3a2ad553a70d36 Hao Luo           2022-02-01  196  
-3a2ad553a70d36 Hao Luo           2022-02-01  197  	t->type = tag->type;
-f6c6ca7ed74437 Hao Luo           2022-02-01  198  	t->inherit_objects = tag->inherit_objects;
-f6c6ca7ed74437 Hao Luo           2022-02-01  199  	kref_get(&t->inherit_objects->refcnt);
-3a2ad553a70d36 Hao Luo           2022-02-01  200  	t->private = kn;
-3a2ad553a70d36 Hao Luo           2022-02-01  201  
-3a2ad553a70d36 Hao Luo           2022-02-01  202  	inode->i_private = t;
-3a2ad553a70d36 Hao Luo           2022-02-01  203  	return 0;
-3a2ad553a70d36 Hao Luo           2022-02-01  204  }
-3a2ad553a70d36 Hao Luo           2022-02-01  205  
-f6c6ca7ed74437 Hao Luo           2022-02-01  206  /* populate_dir - populate directory with bpf objects in a tag's
-f6c6ca7ed74437 Hao Luo           2022-02-01  207   * inherit_objects.
-f6c6ca7ed74437 Hao Luo           2022-02-01  208   * @dir: dentry of the directory.
-f6c6ca7ed74437 Hao Luo           2022-02-01  209   * @inode: inode of the direcotry.
-f6c6ca7ed74437 Hao Luo           2022-02-01  210   *
-f6c6ca7ed74437 Hao Luo           2022-02-01  211   * Called from mkdir. Must be called after dentry has been finalized.
-f6c6ca7ed74437 Hao Luo           2022-02-01  212   */
+
+[ snip ]
+
 f6c6ca7ed74437 Hao Luo           2022-02-01  213  static int populate_dir(struct dentry *dir, struct inode *inode)
 f6c6ca7ed74437 Hao Luo           2022-02-01  214  {
 f6c6ca7ed74437 Hao Luo           2022-02-01  215  	struct bpf_dir_tag *tag = inode_tag(inode);
@@ -213,8 +74,10 @@ f6c6ca7ed74437 Hao Luo           2022-02-01  248  		bpf_any_get(e->obj, e->type)
 f6c6ca7ed74437 Hao Luo           2022-02-01  249  	}
 f6c6ca7ed74437 Hao Luo           2022-02-01  250  	rcu_read_unlock();
 f6c6ca7ed74437 Hao Luo           2022-02-01 @251  	return ret;
+
+This warning is just about empty loops.  Likely impossible.
+
 f6c6ca7ed74437 Hao Luo           2022-02-01  252  }
-f6c6ca7ed74437 Hao Luo           2022-02-01  253  
 
 ---
 0-DAY CI Kernel Test Service, Intel Corporation
diff --git a/a/content_digest b/N1/content_digest
index 46d5cb7..60ba786 100644
--- a/a/content_digest
+++ b/N1/content_digest
@@ -1,23 +1,14 @@
- "From\0kernel test robot <lkp@intel.com>\0"
+ "ref\020220201205534.1962784-3-haoluo@google.com\0"
+ "From\0Dan Carpenter <dan.carpenter@oracle.com>\0"
  "Subject\0Re: [PATCH RFC bpf-next v2 2/5] bpf: Introduce inherit list for dir tag.\0"
- "Date\0Wed, 02 Feb 2022 17:15:14 +0800\0"
- "To\0kbuild@lists.01.org\0"
+ "Date\0Wed, 02 Feb 2022 12:32:01 +0300\0"
+ "To\0kbuild-all@lists.01.org\0"
  "\01:1\0"
  "b\0"
- "CC: kbuild-all(a)lists.01.org\n"
- "In-Reply-To: <20220201205534.1962784-3-haoluo@google.com>\n"
- "References: <20220201205534.1962784-3-haoluo@google.com>\n"
- "TO: Hao Luo <haoluo@google.com>\n"
- "\n"
  "Hi Hao,\n"
  "\n"
- "[FYI, it's a private test report for your RFC patch.]\n"
- "[auto build test WARNING on bpf-next/master]\n"
- "\n"
  "url:    https://github.com/0day-ci/linux/commits/Hao-Luo/Extend-cgroup-interface-with-bpf/20220202-045743\n"
  "base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master\n"
- ":::::: branch date: 12 hours ago\n"
- ":::::: commit date: 12 hours ago\n"
  "config: i386-randconfig-m021-20220131 (https://download.01.org/0day-ci/archive/20220202/202202021722.Gftmgh6J-lkp(a)intel.com/config)\n"
  "compiler: gcc-9 (Debian 9.3.0-22) 9.3.0\n"
  "\n"
@@ -31,7 +22,6 @@
  "\n"
  "vim +/e +71 kernel/bpf/inode.c\n"
  "\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29   64  \n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01   65  static void free_obj_list(struct kref *kref)\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01   66  {\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01   67  \tstruct obj_list *list;\n"
@@ -39,147 +29,19 @@
  "f6c6ca7ed74437 Hao Luo           2022-02-01   69  \n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01   70  \tlist = container_of(kref, struct obj_list, refcnt);\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01  @71  \tlist_for_each_entry(e, &list->list, list) {\n"
+ "\n"
+ "Need to use list_for_each_entry_safe() because this frees the list\n"
+ "iterator.\n"
+ "\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01   72  \t\tlist_del_rcu(&e->list);\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01   73  \t\tbpf_any_put(e->obj, e->type);\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01   74  \t\tkfree(e);\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01   75  \t}\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01   76  \tkfree(list);\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01   77  }\n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01   78  \n"
- "b2197755b2633e Daniel Borkmann   2015-10-29   79  static void *bpf_fd_probe_obj(u32 ufd, enum bpf_type *type)\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29   80  {\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29   81  \tvoid *raw;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29   82  \n"
- "c9da161c6517ba Daniel Borkmann   2015-11-24   83  \traw = bpf_map_get_with_uref(ufd);\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02   84  \tif (!IS_ERR(raw)) {\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02   85  \t\t*type = BPF_TYPE_MAP;\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02   86  \t\treturn raw;\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02   87  \t}\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02   88  \n"
- "b2197755b2633e Daniel Borkmann   2015-10-29   89  \traw = bpf_prog_get(ufd);\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02   90  \tif (!IS_ERR(raw)) {\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02   91  \t\t*type = BPF_TYPE_PROG;\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02   92  \t\treturn raw;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29   93  \t}\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29   94  \n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02   95  \traw = bpf_link_get_from_fd(ufd);\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02   96  \tif (!IS_ERR(raw)) {\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02   97  \t\t*type = BPF_TYPE_LINK;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29   98  \t\treturn raw;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29   99  \t}\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  100  \n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02  101  \treturn ERR_PTR(-EINVAL);\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02  102  }\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02  103  \n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  104  static const struct inode_operations bpf_dir_iops;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  105  \n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  106  static const struct inode_operations bpf_prog_iops = { };\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  107  static const struct inode_operations bpf_map_iops  = { };\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02  108  static const struct inode_operations bpf_link_iops  = { };\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  109  \n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  110  static int bpf_mkprog(struct dentry *dentry, umode_t mode, void *arg);\n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  111  static int bpf_mkmap(struct dentry *dentry, umode_t mode, void *arg);\n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  112  static int bpf_mklink(struct dentry *dentry, umode_t mode, void *arg);\n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  113  \n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  114  static struct inode *bpf_get_inode(struct super_block *sb,\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  115  \t\t\t\t   const struct inode *dir,\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  116  \t\t\t\t   umode_t mode)\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  117  {\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  118  \tstruct inode *inode;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  119  \n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  120  \tswitch (mode & S_IFMT) {\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  121  \tcase S_IFDIR:\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  122  \tcase S_IFREG:\n"
- "0f98621bef5d2b Daniel Borkmann   2016-10-29  123  \tcase S_IFLNK:\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  124  \t\tbreak;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  125  \tdefault:\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  126  \t\treturn ERR_PTR(-EINVAL);\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  127  \t}\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  128  \n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  129  \tinode = new_inode(sb);\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  130  \tif (!inode)\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  131  \t\treturn ERR_PTR(-ENOSPC);\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  132  \n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  133  \tinode->i_ino = get_next_ino();\n"
- "078cd8279e6599 Deepa Dinamani    2016-09-14  134  \tinode->i_atime = current_time(inode);\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  135  \tinode->i_mtime = inode->i_atime;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  136  \tinode->i_ctime = inode->i_atime;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  137  \n"
- "21cb47be6fb9ec Christian Brauner 2021-01-21  138  \tinode_init_owner(&init_user_ns, inode, dir, mode);\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  139  \n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  140  \treturn inode;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  141  }\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  142  \n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  143  static int bpf_inode_type(const struct inode *inode, enum bpf_type *type)\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  144  {\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  145  \t*type = BPF_TYPE_UNSPEC;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  146  \tif (inode->i_op == &bpf_prog_iops)\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  147  \t\t*type = BPF_TYPE_PROG;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  148  \telse if (inode->i_op == &bpf_map_iops)\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  149  \t\t*type = BPF_TYPE_MAP;\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02  150  \telse if (inode->i_op == &bpf_link_iops)\n"
- "70ed506c3bbcfa Andrii Nakryiko   2020-03-02  151  \t\t*type = BPF_TYPE_LINK;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  152  \telse\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  153  \t\treturn -EACCES;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  154  \n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  155  \treturn 0;\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  156  }\n"
- "b2197755b2633e Daniel Borkmann   2015-10-29  157  \n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  158  static struct bpf_dir_tag *inode_tag(const struct inode *inode)\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  159  {\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  160  \tif (unlikely(!S_ISDIR(inode->i_mode)))\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  161  \t\treturn NULL;\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  162  \n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  163  \treturn inode->i_private;\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  164  }\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  165  \n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  166  /* tag_dir_inode - tag a newly created directory.\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  167   * @tag: tag of parent directory\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  168   * @dentry: dentry of the new directory\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  169   * @inode: inode of the new directory\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  170   *\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  171   * Called from bpf_mkdir.\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  172   */\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  173  static int tag_dir_inode(const struct bpf_dir_tag *tag,\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  174  \t\t\t const struct dentry *dentry, struct inode *inode)\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  175  {\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  176  \tstruct bpf_dir_tag *t;\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  177  \tstruct kernfs_node *kn;\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  178  \n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  179  \tWARN_ON(tag->type != BPF_DIR_KERNFS_REP);\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  180  \n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  181  \t/* kn is put at tag deallocation. */\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  182  \tkn = kernfs_find_and_get_ns(tag->private, dentry->d_name.name, NULL);\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  183  \tif (unlikely(!kn))\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  184  \t\treturn -ENOENT;\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  185  \n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  186  \tif (unlikely(kernfs_type(kn) != KERNFS_DIR)) {\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  187  \t\tkernfs_put(kn);\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  188  \t\treturn -EPERM;\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  189  \t}\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  190  \n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  191  \tt = kzalloc(sizeof(struct bpf_dir_tag), GFP_KERNEL | __GFP_NOWARN);\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  192  \tif (unlikely(!t)) {\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  193  \t\tkernfs_put(kn);\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  194  \t\treturn -ENOMEM;\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  195  \t}\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  196  \n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  197  \tt->type = tag->type;\n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  198  \tt->inherit_objects = tag->inherit_objects;\n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  199  \tkref_get(&t->inherit_objects->refcnt);\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  200  \tt->private = kn;\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  201  \n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  202  \tinode->i_private = t;\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  203  \treturn 0;\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  204  }\n"
- "3a2ad553a70d36 Hao Luo           2022-02-01  205  \n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  206  /* populate_dir - populate directory with bpf objects in a tag's\n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  207   * inherit_objects.\n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  208   * @dir: dentry of the directory.\n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  209   * @inode: inode of the direcotry.\n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  210   *\n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  211   * Called from mkdir. Must be called after dentry has been finalized.\n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  212   */\n"
+ "\n"
+ "[ snip ]\n"
+ "\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01  213  static int populate_dir(struct dentry *dir, struct inode *inode)\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01  214  {\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01  215  \tstruct bpf_dir_tag *tag = inode_tag(inode);\n"
@@ -219,11 +81,13 @@
  "f6c6ca7ed74437 Hao Luo           2022-02-01  249  \t}\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01  250  \trcu_read_unlock();\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01 @251  \treturn ret;\n"
+ "\n"
+ "This warning is just about empty loops.  Likely impossible.\n"
+ "\n"
  "f6c6ca7ed74437 Hao Luo           2022-02-01  252  }\n"
- "f6c6ca7ed74437 Hao Luo           2022-02-01  253  \n"
  "\n"
  "---\n"
  "0-DAY CI Kernel Test Service, Intel Corporation\n"
  https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
 
-a7b1c419b636c539d0e2b5b6fae4d3381c5259deae46256d1c6b8deca0ce14c2
+cb352ad85d3260d27b1f549f82d0cd3c411533779fd0f58fcba8591e21051399

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.