diff mbox series

[v3,19/19] scsi: Made changes in Kconfig to select BLK_CGROUP_FC_APPID

Message ID 1604387903-20006-20-git-send-email-muneendra.kumar@broadcom.com
State New
Headers show
Series [v3,01/19] cgroup: Added cgroup_get_from_kernfs_id | expand

Commit Message

Muneendra Kumar Nov. 3, 2020, 7:18 a.m. UTC
Made changes in Kconfig to select BLK_CGROUP_FC_APPID under
SCSI_FC_ATTRS

Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>

---
v3:
New patch
---
 drivers/scsi/Kconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

kernel test robot Nov. 3, 2020, 6:07 p.m. UTC | #1
Hi Muneendra,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on scsi/for-next]
[also build test WARNING on cgroup/for-next v5.10-rc2]
[cannot apply to mkp-scsi/for-next next-20201103]
[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/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201103-221403
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: c6x-randconfig-r013-20201103 (attached as .config)
compiler: c6x-elf-gcc (GCC) 9.3.0
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/78074b9ba99b7f8c0cd4b2d0c17589441443775c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201103-221403
        git checkout 78074b9ba99b7f8c0cd4b2d0c17589441443775c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=c6x 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from include/linux/writeback.h:14,
                    from include/linux/memcontrol.h:22,
                    from include/linux/swap.h:9,
                    from include/linux/suspend.h:5,
                    from kernel/sched/sched.h:63,
                    from kernel/sched/core.c:13:
   include/linux/blk-cgroup.h: In function 'blkcg_set_fc_appid':
   include/linux/blk-cgroup.h:686:32: error: 'io_cgrp_subsys' undeclared (first use in this function)
     686 |  css = cgroup_get_e_css(cgrp, &io_cgrp_subsys);
         |                                ^~~~~~~~~~~~~~
   include/linux/blk-cgroup.h:686:32: note: each undeclared identifier is reported only once for each function it appears in
   include/linux/blk-cgroup.h:691:10: error: implicit declaration of function 'css_to_blkcg'; did you mean 'pd_to_blkg'? [-Werror=implicit-function-declaration]
     691 |  blkcg = css_to_blkcg(css);
         |          ^~~~~~~~~~~~
         |          pd_to_blkg
>> include/linux/blk-cgroup.h:691:8: warning: assignment to 'struct blkcg *' from 'int' makes pointer from integer without a cast [-Wint-conversion]

     691 |  blkcg = css_to_blkcg(css);
         |        ^
   include/linux/blk-cgroup.h:700:15: error: 'struct blkcg' has no member named 'fc_app_id'
     700 |  strlcpy(blkcg->fc_app_id, buf, len);
         |               ^~
   include/linux/blk-cgroup.h: In function 'blkcg_get_fc_appid':
   include/linux/blk-cgroup.h:719:16: error: 'struct bio' has no member named 'bi_blkg'
     719 |  if (bio && bio->bi_blkg &&
         |                ^~
   include/linux/blk-cgroup.h:720:14: error: 'struct bio' has no member named 'bi_blkg'
     720 |    strlen(bio->bi_blkg->blkcg->fc_app_id))
         |              ^~
   include/linux/blk-cgroup.h:721:13: error: 'struct bio' has no member named 'bi_blkg'
     721 |   return bio->bi_blkg->blkcg->fc_app_id;
         |             ^~
   kernel/sched/core.c: In function 'ttwu_stat':
   kernel/sched/core.c:2419:13: warning: variable 'rq' set but not used [-Wunused-but-set-variable]
    2419 |  struct rq *rq;
         |             ^~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/writeback.h:14,
                    from include/linux/memcontrol.h:22,
                    from include/linux/swap.h:9,
                    from include/linux/suspend.h:5,
                    from kernel/sched/sched.h:63,
                    from kernel/sched/loadavg.c:9:
   include/linux/blk-cgroup.h: In function 'blkcg_set_fc_appid':
   include/linux/blk-cgroup.h:686:32: error: 'io_cgrp_subsys' undeclared (first use in this function)
     686 |  css = cgroup_get_e_css(cgrp, &io_cgrp_subsys);
         |                                ^~~~~~~~~~~~~~
   include/linux/blk-cgroup.h:686:32: note: each undeclared identifier is reported only once for each function it appears in
   include/linux/blk-cgroup.h:691:10: error: implicit declaration of function 'css_to_blkcg'; did you mean 'pd_to_blkg'? [-Werror=implicit-function-declaration]
     691 |  blkcg = css_to_blkcg(css);
         |          ^~~~~~~~~~~~
         |          pd_to_blkg
>> include/linux/blk-cgroup.h:691:8: warning: assignment to 'struct blkcg *' from 'int' makes pointer from integer without a cast [-Wint-conversion]

     691 |  blkcg = css_to_blkcg(css);
         |        ^
   include/linux/blk-cgroup.h:700:15: error: 'struct blkcg' has no member named 'fc_app_id'
     700 |  strlcpy(blkcg->fc_app_id, buf, len);
         |               ^~
   include/linux/blk-cgroup.h: In function 'blkcg_get_fc_appid':
   include/linux/blk-cgroup.h:719:16: error: 'struct bio' has no member named 'bi_blkg'
     719 |  if (bio && bio->bi_blkg &&
         |                ^~
   include/linux/blk-cgroup.h:720:14: error: 'struct bio' has no member named 'bi_blkg'
     720 |    strlen(bio->bi_blkg->blkcg->fc_app_id))
         |              ^~
   include/linux/blk-cgroup.h:721:13: error: 'struct bio' has no member named 'bi_blkg'
     721 |   return bio->bi_blkg->blkcg->fc_app_id;
         |             ^~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/writeback.h:14,
                    from include/linux/memcontrol.h:22,
                    from include/linux/swap.h:9,
                    from include/linux/suspend.h:5,
                    from kernel/sched/sched.h:63,
                    from kernel/sched/fair.c:23:
   include/linux/blk-cgroup.h: In function 'blkcg_set_fc_appid':
   include/linux/blk-cgroup.h:686:32: error: 'io_cgrp_subsys' undeclared (first use in this function)
     686 |  css = cgroup_get_e_css(cgrp, &io_cgrp_subsys);
         |                                ^~~~~~~~~~~~~~
   include/linux/blk-cgroup.h:686:32: note: each undeclared identifier is reported only once for each function it appears in
   include/linux/blk-cgroup.h:691:10: error: implicit declaration of function 'css_to_blkcg'; did you mean 'pd_to_blkg'? [-Werror=implicit-function-declaration]
     691 |  blkcg = css_to_blkcg(css);
         |          ^~~~~~~~~~~~
         |          pd_to_blkg
>> include/linux/blk-cgroup.h:691:8: warning: assignment to 'struct blkcg *' from 'int' makes pointer from integer without a cast [-Wint-conversion]

     691 |  blkcg = css_to_blkcg(css);
         |        ^
   include/linux/blk-cgroup.h:700:15: error: 'struct blkcg' has no member named 'fc_app_id'
     700 |  strlcpy(blkcg->fc_app_id, buf, len);
         |               ^~
   include/linux/blk-cgroup.h: In function 'blkcg_get_fc_appid':
   include/linux/blk-cgroup.h:719:16: error: 'struct bio' has no member named 'bi_blkg'
     719 |  if (bio && bio->bi_blkg &&
         |                ^~
   include/linux/blk-cgroup.h:720:14: error: 'struct bio' has no member named 'bi_blkg'
     720 |    strlen(bio->bi_blkg->blkcg->fc_app_id))
         |              ^~
   include/linux/blk-cgroup.h:721:13: error: 'struct bio' has no member named 'bi_blkg'
     721 |   return bio->bi_blkg->blkcg->fc_app_id;
         |             ^~
   kernel/sched/fair.c: At top level:
   kernel/sched/fair.c:5368:6: warning: no previous prototype for 'init_cfs_bandwidth' [-Wmissing-prototypes]
    5368 | void init_cfs_bandwidth(struct cfs_bandwidth *cfs_b) {}
         |      ^~~~~~~~~~~~~~~~~~
   kernel/sched/fair.c:11129:6: warning: no previous prototype for 'free_fair_sched_group' [-Wmissing-prototypes]
   11129 | void free_fair_sched_group(struct task_group *tg) { }
         |      ^~~~~~~~~~~~~~~~~~~~~
   kernel/sched/fair.c:11131:5: warning: no previous prototype for 'alloc_fair_sched_group' [-Wmissing-prototypes]
   11131 | int alloc_fair_sched_group(struct task_group *tg, struct task_group *parent)
         |     ^~~~~~~~~~~~~~~~~~~~~~
   kernel/sched/fair.c:11136:6: warning: no previous prototype for 'online_fair_sched_group' [-Wmissing-prototypes]
   11136 | void online_fair_sched_group(struct task_group *tg) { }
         |      ^~~~~~~~~~~~~~~~~~~~~~~
   kernel/sched/fair.c:11138:6: warning: no previous prototype for 'unregister_fair_sched_group' [-Wmissing-prototypes]
   11138 | void unregister_fair_sched_group(struct task_group *tg) { }
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/writeback.h:14,
                    from include/linux/memcontrol.h:22,
                    from include/linux/swap.h:9,
                    from include/linux/suspend.h:5,
                    from kernel/sched/sched.h:63,
                    from kernel/sched/rt.c:6:
   include/linux/blk-cgroup.h: In function 'blkcg_set_fc_appid':
   include/linux/blk-cgroup.h:686:32: error: 'io_cgrp_subsys' undeclared (first use in this function)
     686 |  css = cgroup_get_e_css(cgrp, &io_cgrp_subsys);
         |                                ^~~~~~~~~~~~~~
   include/linux/blk-cgroup.h:686:32: note: each undeclared identifier is reported only once for each function it appears in
   include/linux/blk-cgroup.h:691:10: error: implicit declaration of function 'css_to_blkcg'; did you mean 'pd_to_blkg'? [-Werror=implicit-function-declaration]
     691 |  blkcg = css_to_blkcg(css);
         |          ^~~~~~~~~~~~
         |          pd_to_blkg
>> include/linux/blk-cgroup.h:691:8: warning: assignment to 'struct blkcg *' from 'int' makes pointer from integer without a cast [-Wint-conversion]

     691 |  blkcg = css_to_blkcg(css);
         |        ^
   include/linux/blk-cgroup.h:700:15: error: 'struct blkcg' has no member named 'fc_app_id'
     700 |  strlcpy(blkcg->fc_app_id, buf, len);
         |               ^~
   include/linux/blk-cgroup.h: In function 'blkcg_get_fc_appid':
   include/linux/blk-cgroup.h:719:16: error: 'struct bio' has no member named 'bi_blkg'
     719 |  if (bio && bio->bi_blkg &&
         |                ^~
   include/linux/blk-cgroup.h:720:14: error: 'struct bio' has no member named 'bi_blkg'
     720 |    strlen(bio->bi_blkg->blkcg->fc_app_id))
         |              ^~
   include/linux/blk-cgroup.h:721:13: error: 'struct bio' has no member named 'bi_blkg'
     721 |   return bio->bi_blkg->blkcg->fc_app_id;
         |             ^~
   kernel/sched/rt.c: At top level:
   kernel/sched/rt.c:253:6: warning: no previous prototype for 'free_rt_sched_group' [-Wmissing-prototypes]
     253 | void free_rt_sched_group(struct task_group *tg) { }
         |      ^~~~~~~~~~~~~~~~~~~
   kernel/sched/rt.c:255:5: warning: no previous prototype for 'alloc_rt_sched_group' [-Wmissing-prototypes]
     255 | int alloc_rt_sched_group(struct task_group *tg, struct task_group *parent)
         |     ^~~~~~~~~~~~~~~~~~~~
   kernel/sched/rt.c:668:6: warning: no previous prototype for 'sched_rt_bandwidth_account' [-Wmissing-prototypes]
     668 | bool sched_rt_bandwidth_account(struct rt_rq *rt_rq)
         |      ^~~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +691 include/linux/blk-cgroup.h

835f4599c6dcff2 Muneendra 2020-11-03  668  
835f4599c6dcff2 Muneendra 2020-11-03  669  #ifdef CONFIG_BLK_CGROUP_FC_APPID
835f4599c6dcff2 Muneendra 2020-11-03  670  /*
835f4599c6dcff2 Muneendra 2020-11-03  671   * Sets the fc_app_id field associted to blkcg
835f4599c6dcff2 Muneendra 2020-11-03  672   * @buf: application identifier
835f4599c6dcff2 Muneendra 2020-11-03  673   * @id: cgrp id
835f4599c6dcff2 Muneendra 2020-11-03  674   * @len: size of appid
835f4599c6dcff2 Muneendra 2020-11-03  675   */
835f4599c6dcff2 Muneendra 2020-11-03  676  static inline int blkcg_set_fc_appid(char *buf, u64 id, size_t len)
835f4599c6dcff2 Muneendra 2020-11-03  677  {
835f4599c6dcff2 Muneendra 2020-11-03  678  	struct cgroup *cgrp = NULL;
835f4599c6dcff2 Muneendra 2020-11-03  679  	struct cgroup_subsys_state *css = NULL;
835f4599c6dcff2 Muneendra 2020-11-03  680  	struct blkcg *blkcg = NULL;
835f4599c6dcff2 Muneendra 2020-11-03  681  	int ret  = 0;
835f4599c6dcff2 Muneendra 2020-11-03  682  
835f4599c6dcff2 Muneendra 2020-11-03  683  	cgrp = cgroup_get_from_kernfs_id(id);
835f4599c6dcff2 Muneendra 2020-11-03  684  	if (!cgrp)
835f4599c6dcff2 Muneendra 2020-11-03  685  		return -ENOENT;
835f4599c6dcff2 Muneendra 2020-11-03  686  	css = cgroup_get_e_css(cgrp, &io_cgrp_subsys);
835f4599c6dcff2 Muneendra 2020-11-03  687  	if (!css) {
835f4599c6dcff2 Muneendra 2020-11-03  688  		ret = -ENOENT;
835f4599c6dcff2 Muneendra 2020-11-03  689  		goto out_cgrp_put;
835f4599c6dcff2 Muneendra 2020-11-03  690  	}
835f4599c6dcff2 Muneendra 2020-11-03 @691  	blkcg = css_to_blkcg(css);
835f4599c6dcff2 Muneendra 2020-11-03  692  	if (!blkcg) {
835f4599c6dcff2 Muneendra 2020-11-03  693  		ret = -ENOENT;
835f4599c6dcff2 Muneendra 2020-11-03  694  		goto out_put;
835f4599c6dcff2 Muneendra 2020-11-03  695  	}
835f4599c6dcff2 Muneendra 2020-11-03  696  	if (len > APPID_LEN) {
835f4599c6dcff2 Muneendra 2020-11-03  697  		ret = -EINVAL;
835f4599c6dcff2 Muneendra 2020-11-03  698  		goto out_put;
835f4599c6dcff2 Muneendra 2020-11-03  699  	}
835f4599c6dcff2 Muneendra 2020-11-03  700  	strlcpy(blkcg->fc_app_id, buf, len);
835f4599c6dcff2 Muneendra 2020-11-03  701  out_put:
835f4599c6dcff2 Muneendra 2020-11-03  702  	css_put(css);
835f4599c6dcff2 Muneendra 2020-11-03  703  out_cgrp_put:
835f4599c6dcff2 Muneendra 2020-11-03  704  	cgroup_put(cgrp);
835f4599c6dcff2 Muneendra 2020-11-03  705  	return ret;
835f4599c6dcff2 Muneendra 2020-11-03  706  }
835f4599c6dcff2 Muneendra 2020-11-03  707  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot Nov. 3, 2020, 9:19 p.m. UTC | #2
Hi Muneendra,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on scsi/for-next]
[also build test ERROR on cgroup/for-next v5.10-rc2]
[cannot apply to mkp-scsi/for-next next-20201103]
[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/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201103-221403
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: arm64-randconfig-r023-20201103 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 1fcd5d5655e29f85e12b402e32974f207cfedf32)
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
        # install arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://github.com/0day-ci/linux/commit/78074b9ba99b7f8c0cd4b2d0c17589441443775c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201103-221403
        git checkout 78074b9ba99b7f8c0cd4b2d0c17589441443775c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All error/warnings (new ones prefixed by >>):

   WARNING: unmet direct dependencies detected for BLK_CGROUP_FC_APPID
   Depends on BLOCK && BLK_CGROUP
   Selected by
   - SCSI_FC_ATTRS && SCSI && NET
   In file included from arch/arm64/kernel/asm-offsets.c:16:
   In file included from include/linux/suspend.h:5:
   In file included from include/linux/swap.h:9:
   In file included from include/linux/memcontrol.h:22:
   In file included from include/linux/writeback.h:14:
>> include/linux/blk-cgroup.h:686:32: error: use of undeclared identifier 'io_cgrp_subsys'

   css = cgroup_get_e_css(cgrp, &io_cgrp_subsys);
   ^
   include/linux/blk-cgroup.h:691:10: error: implicit declaration of function 'css_to_blkcg'
   blkcg = css_to_blkcg(css);
   ^
   include/linux/blk-cgroup.h:691:10: note: did you mean
   include/linux/blk-cgroup.h:654:32: note: 'pd_to_blkg' declared here
   static inline struct blkcg_gq blkg_policy_data { return NULL; }
   ^
>> include/linux/blk-cgroup.h:691:8: warning: incompatible integer to pointer conversion assigning to 'struct blkcg from 'int'

   blkcg = css_to_blkcg(css);
   ^ ~~~~~~~~~~~~~~~~~
>> include/linux/blk-cgroup.h:700:17: error: no member named 'fc_app_id' in 'struct blkcg'

   strlcpy(blkcg->fc_app_id, buf, len);
   ~~~~~ ^
>> include/linux/blk-cgroup.h:719:18: error: no member named 'bi_blkg' in 'struct bio'

   if (bio && bio->bi_blkg &&
   ~~~ ^
   include/linux/blk-cgroup.h:720:16: error: no member named 'bi_blkg' in 'struct bio'
   strlen(bio->bi_blkg->blkcg->fc_app_id))
   ~~~ ^
   include/linux/blk-cgroup.h:721:15: error: no member named 'bi_blkg' in 'struct bio'
   return bio->bi_blkg->blkcg->fc_app_id;
   ~~~ ^
   1 warning and 6 errors generated.
   Makefile arch include kernel scripts source usr [scripts/Makefile.build:117: arch/arm64/kernel/asm-offsets.s] Error 1
   Target '__build' not remade because of errors.
   Makefile arch include kernel scripts source usr [Makefile:1200: prepare0] Error 2
   Target 'prepare' not remade because of errors.
   make: Makefile arch include kernel scripts source usr [Makefile:185: __sub-make] Error 2
   make: Target 'prepare' not remade because of errors.

vim +/io_cgrp_subsys +686 include/linux/blk-cgroup.h

a051661ca6d134c block/blk-cgroup.h         Tejun Heo         2012-06-26  651  
f95a04afa80c0f4 block/blk-cgroup.h         Tejun Heo         2012-04-16  652  static inline struct blkg_policy_data *blkg_to_pd(struct blkcg_gq *blkg,
3c798398e393e5f block/blk-cgroup.h         Tejun Heo         2012-04-16  653  						  struct blkcg_policy *pol) { return NULL; }
f95a04afa80c0f4 block/blk-cgroup.h         Tejun Heo         2012-04-16 @654  static inline struct blkcg_gq *pd_to_blkg(struct blkg_policy_data *pd) { return NULL; }
3c798398e393e5f block/blk-cgroup.h         Tejun Heo         2012-04-16  655  static inline char *blkg_path(struct blkcg_gq *blkg) { return NULL; }
3c798398e393e5f block/blk-cgroup.h         Tejun Heo         2012-04-16  656  static inline void blkg_get(struct blkcg_gq *blkg) { }
3c798398e393e5f block/blk-cgroup.h         Tejun Heo         2012-04-16  657  static inline void blkg_put(struct blkcg_gq *blkg) { }
afc24d49c1e5dbe block/blk-cgroup.h         Vivek Goyal       2010-04-26  658  
d3f77dfdc71835f include/linux/blk-cgroup.h Tejun Heo         2019-06-27  659  static inline bool blkcg_punt_bio_submit(struct bio *bio) { return false; }
e439bedf6b24264 include/linux/blk-cgroup.h Dennis Zhou       2018-12-05  660  static inline void blkcg_bio_issue_init(struct bio *bio) { }
db18a53e5ba8409 include/linux/blk-cgroup.h Christoph Hellwig 2020-06-27  661  static inline void blk_cgroup_bio_start(struct bio *bio) { }
ae1188963611119 include/linux/blk-cgroup.h Tejun Heo         2015-08-18  662  
a051661ca6d134c block/blk-cgroup.h         Tejun Heo         2012-06-26  663  #define blk_queue_for_each_rl(rl, q)	\
a051661ca6d134c block/blk-cgroup.h         Tejun Heo         2012-06-26  664  	for ((rl) = &(q)->root_rl; (rl); (rl) = NULL)
a051661ca6d134c block/blk-cgroup.h         Tejun Heo         2012-06-26  665  
efa7d1c733d1d2c include/linux/blk-cgroup.h Tejun Heo         2015-05-22  666  #endif	/* CONFIG_BLOCK */
36558c8a30e121f block/blk-cgroup.h         Tejun Heo         2012-04-16  667  #endif	/* CONFIG_BLK_CGROUP */
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  668  
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  669  #ifdef CONFIG_BLK_CGROUP_FC_APPID
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  670  /*
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  671   * Sets the fc_app_id field associted to blkcg
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  672   * @buf: application identifier
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  673   * @id: cgrp id
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  674   * @len: size of appid
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  675   */
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  676  static inline int blkcg_set_fc_appid(char *buf, u64 id, size_t len)
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  677  {
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  678  	struct cgroup *cgrp = NULL;
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  679  	struct cgroup_subsys_state *css = NULL;
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  680  	struct blkcg *blkcg = NULL;
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  681  	int ret  = 0;
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  682  
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  683  	cgrp = cgroup_get_from_kernfs_id(id);
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  684  	if (!cgrp)
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  685  		return -ENOENT;
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03 @686  	css = cgroup_get_e_css(cgrp, &io_cgrp_subsys);
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  687  	if (!css) {
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  688  		ret = -ENOENT;
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  689  		goto out_cgrp_put;
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  690  	}
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03 @691  	blkcg = css_to_blkcg(css);
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  692  	if (!blkcg) {
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  693  		ret = -ENOENT;
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  694  		goto out_put;
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  695  	}
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  696  	if (len > APPID_LEN) {
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  697  		ret = -EINVAL;
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  698  		goto out_put;
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  699  	}
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03 @700  	strlcpy(blkcg->fc_app_id, buf, len);
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  701  out_put:
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  702  	css_put(css);
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  703  out_cgrp_put:
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  704  	cgroup_put(cgrp);
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  705  	return ret;
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  706  }
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  707  
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  708  /**
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  709   * blkcg_get_fc_appid - grab the app identifier associated with a bio
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  710   * @bio: target bio
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  711   *
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  712   * This returns the app identifier associated with a bio,
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  713   * %NULL if not associated.
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  714   * Callers are expected to either handle %NULL or know association has been
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  715   * done prior to calling this.
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  716   */
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  717  static inline char *blkcg_get_fc_appid(struct bio *bio)
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03  718  {
835f4599c6dcff2 include/linux/blk-cgroup.h Muneendra         2020-11-03 @719  	if (bio && bio->bi_blkg &&

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
kernel test robot Nov. 4, 2020, 12:55 a.m. UTC | #3
Hi Muneendra,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on scsi/for-next]
[also build test ERROR on cgroup/for-next v5.10-rc2]
[cannot apply to mkp-scsi/for-next next-20201103]
[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/Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201103-221403
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git for-next
config: mips-rm200_defconfig (attached as .config)
compiler: mipsel-linux-gcc (GCC) 9.3.0
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/78074b9ba99b7f8c0cd4b2d0c17589441443775c
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Muneendra/blkcg-Support-to-track-FC-storage-blk-io-traffic/20201103-221403
        git checkout 78074b9ba99b7f8c0cd4b2d0c17589441443775c
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   WARNING: unmet direct dependencies detected for BLK_CGROUP_FC_APPID
   Depends on BLOCK && BLK_CGROUP
   Selected by
   - SCSI_FC_ATTRS && SCSI && NET
   In file included from include/linux/writeback.h:14,
   from include/linux/memcontrol.h:22,
   from include/linux/swap.h:9,
   from include/linux/suspend.h:5,
   from arch/mips/kernel/asm-offsets.c:17:
   include/linux/blk-cgroup.h: In function 'blkcg_set_fc_appid':
>> include/linux/blk-cgroup.h:686:8: error: implicit declaration of function 'cgroup_get_e_css'; did you mean
   686 | css = cgroup_get_e_css(cgrp, &io_cgrp_subsys);
   | ^~~~~~~~~~~~~~~~
   | cgroup_release
   include/linux/blk-cgroup.h:686:32: error: 'io_cgrp_subsys' undeclared (first use in this function)
   686 | css = cgroup_get_e_css(cgrp, &io_cgrp_subsys);
   | ^~~~~~~~~~~~~~
   include/linux/blk-cgroup.h:686:32: note: each undeclared identifier is reported only once for each function it appears in
   include/linux/blk-cgroup.h:691:10: error: implicit declaration of function 'css_to_blkcg'; did you mean
   691 | blkcg = css_to_blkcg(css);
   | ^~~~~~~~~~~~
   | pd_to_blkg
   include/linux/blk-cgroup.h:691:8: warning: assignment to 'struct blkcg from 'int' makes pointer from integer without a cast
   691 | blkcg = css_to_blkcg(css);
   | ^
   include/linux/blk-cgroup.h:700:15: error: 'struct blkcg' has no member named 'fc_app_id'
   700 | strlcpy(blkcg->fc_app_id, buf, len);
   | ^~
>> include/linux/blk-cgroup.h:704:2: error: implicit declaration of function 'cgroup_put'; did you mean
   704 | cgroup_put(cgrp);
   | ^~~~~~~~~~
   | cgroup_psi
   include/linux/blk-cgroup.h: In function 'blkcg_get_fc_appid':
   include/linux/blk-cgroup.h:719:16: error: 'struct bio' has no member named 'bi_blkg'
   719 | if (bio && bio->bi_blkg &&
   | ^~
   include/linux/blk-cgroup.h:720:14: error: 'struct bio' has no member named 'bi_blkg'
   720 | strlen(bio->bi_blkg->blkcg->fc_app_id))
   | ^~
   include/linux/blk-cgroup.h:721:13: error: 'struct bio' has no member named 'bi_blkg'
   721 | return bio->bi_blkg->blkcg->fc_app_id;
   | ^~
   arch/mips/kernel/asm-offsets.c: At top level:
   arch/mips/kernel/asm-offsets.c:26:6: warning: no previous prototype for 'output_ptreg_defines'
   26 | void output_ptreg_defines(void)
   | ^~~~~~~~~~~~~~~~~~~~
   arch/mips/kernel/asm-offsets.c:78:6: warning: no previous prototype for 'output_task_defines'
   78 | void output_task_defines(void)
   | ^~~~~~~~~~~~~~~~~~~
   arch/mips/kernel/asm-offsets.c:93:6: warning: no previous prototype for 'output_thread_info_defines'
   93 | void output_thread_info_defines(void)
   | ^~~~~~~~~~~~~~~~~~~~~~~~~~
   arch/mips/kernel/asm-offsets.c:110:6: warning: no previous prototype for 'output_thread_defines'
   110 | void output_thread_defines(void)
   | ^~~~~~~~~~~~~~~~~~~~~
   arch/mips/kernel/asm-offsets.c:138:6: warning: no previous prototype for 'output_thread_fpu_defines'
   138 | void output_thread_fpu_defines(void)
   | ^~~~~~~~~~~~~~~~~~~~~~~~~
   arch/mips/kernel/asm-offsets.c:181:6: warning: no previous prototype for 'output_mm_defines'
   181 | void output_mm_defines(void)
   | ^~~~~~~~~~~~~~~~~
   arch/mips/kernel/asm-offsets.c:220:6: warning: no previous prototype for 'output_sc_defines'
   220 | void output_sc_defines(void)
   | ^~~~~~~~~~~~~~~~~
   arch/mips/kernel/asm-offsets.c:255:6: warning: no previous prototype for 'output_signal_defined'
   255 | void output_signal_defined(void)
   | ^~~~~~~~~~~~~~~~~~~~~
   arch/mips/kernel/asm-offsets.c:348:6: warning: no previous prototype for 'output_kvm_defines'
   348 | void output_kvm_defines(void)
   | ^~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors
   Makefile arch include kernel scripts source usr [scripts/Makefile.build:117: arch/mips/kernel/asm-offsets.s] Error 1
   Target '__build' not remade because of errors.
   Makefile arch include kernel scripts source usr [Makefile:1200: prepare0] Error 2
   Target 'prepare' not remade because of errors.
   make: Makefile arch include kernel scripts source usr [Makefile:185: __sub-make] Error 2
   make: Target 'prepare' not remade because of errors.

vim +/cgroup_get_e_css +686 include/linux/blk-cgroup.h

835f4599c6dcff2 Muneendra 2020-11-03  668  
835f4599c6dcff2 Muneendra 2020-11-03  669  #ifdef CONFIG_BLK_CGROUP_FC_APPID
835f4599c6dcff2 Muneendra 2020-11-03  670  /*
835f4599c6dcff2 Muneendra 2020-11-03  671   * Sets the fc_app_id field associted to blkcg
835f4599c6dcff2 Muneendra 2020-11-03  672   * @buf: application identifier
835f4599c6dcff2 Muneendra 2020-11-03  673   * @id: cgrp id
835f4599c6dcff2 Muneendra 2020-11-03  674   * @len: size of appid
835f4599c6dcff2 Muneendra 2020-11-03  675   */
835f4599c6dcff2 Muneendra 2020-11-03  676  static inline int blkcg_set_fc_appid(char *buf, u64 id, size_t len)
835f4599c6dcff2 Muneendra 2020-11-03  677  {
835f4599c6dcff2 Muneendra 2020-11-03  678  	struct cgroup *cgrp = NULL;
835f4599c6dcff2 Muneendra 2020-11-03  679  	struct cgroup_subsys_state *css = NULL;
835f4599c6dcff2 Muneendra 2020-11-03  680  	struct blkcg *blkcg = NULL;
835f4599c6dcff2 Muneendra 2020-11-03  681  	int ret  = 0;
835f4599c6dcff2 Muneendra 2020-11-03  682  
835f4599c6dcff2 Muneendra 2020-11-03  683  	cgrp = cgroup_get_from_kernfs_id(id);
835f4599c6dcff2 Muneendra 2020-11-03  684  	if (!cgrp)
835f4599c6dcff2 Muneendra 2020-11-03  685  		return -ENOENT;
835f4599c6dcff2 Muneendra 2020-11-03 @686  	css = cgroup_get_e_css(cgrp, &io_cgrp_subsys);
835f4599c6dcff2 Muneendra 2020-11-03  687  	if (!css) {
835f4599c6dcff2 Muneendra 2020-11-03  688  		ret = -ENOENT;
835f4599c6dcff2 Muneendra 2020-11-03  689  		goto out_cgrp_put;
835f4599c6dcff2 Muneendra 2020-11-03  690  	}
835f4599c6dcff2 Muneendra 2020-11-03  691  	blkcg = css_to_blkcg(css);
835f4599c6dcff2 Muneendra 2020-11-03  692  	if (!blkcg) {
835f4599c6dcff2 Muneendra 2020-11-03  693  		ret = -ENOENT;
835f4599c6dcff2 Muneendra 2020-11-03  694  		goto out_put;
835f4599c6dcff2 Muneendra 2020-11-03  695  	}
835f4599c6dcff2 Muneendra 2020-11-03  696  	if (len > APPID_LEN) {
835f4599c6dcff2 Muneendra 2020-11-03  697  		ret = -EINVAL;
835f4599c6dcff2 Muneendra 2020-11-03  698  		goto out_put;
835f4599c6dcff2 Muneendra 2020-11-03  699  	}
835f4599c6dcff2 Muneendra 2020-11-03  700  	strlcpy(blkcg->fc_app_id, buf, len);
835f4599c6dcff2 Muneendra 2020-11-03  701  out_put:
835f4599c6dcff2 Muneendra 2020-11-03  702  	css_put(css);
835f4599c6dcff2 Muneendra 2020-11-03  703  out_cgrp_put:
835f4599c6dcff2 Muneendra 2020-11-03 @704  	cgroup_put(cgrp);
835f4599c6dcff2 Muneendra 2020-11-03  705  	return ret;
835f4599c6dcff2 Muneendra 2020-11-03  706  }
835f4599c6dcff2 Muneendra 2020-11-03  707  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
diff mbox series

Patch

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 701b61ec76ee..de142ced9e14 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -230,6 +230,7 @@  config SCSI_FC_ATTRS
 	depends on SCSI && NET
 	select BLK_DEV_BSGLIB
 	select SCSI_NETLINK
+	select BLK_CGROUP_FC_APPID
 	help
 	  If you wish to export transport-specific information about
 	  each attached FiberChannel device to sysfs, say Y.