All of lore.kernel.org
 help / color / mirror / Atom feed
* [mcgrof:20200601-block-fixes 4/9] kernel/trace/blktrace.c:500:38: error: no member named 'sg_debugfs_dir' in 'struct request_queue'; did you mean 'debugfs_dir'?
@ 2020-06-02 12:10 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-06-02 12:10 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 6868 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git 20200601-block-fixes
head:   9550785177b10cb84c129a2ebd9004bc1bc62476
commit: 91bae9e92dfcea0cd677122b7892967422b485e8 [4/9] blktrace: fix debugfs use after free
config: x86_64-randconfig-a003-20200602 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 2388a096e7865c043e83ece4e26654bd3d1a20d5)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        git checkout 91bae9e92dfcea0cd677122b7892967422b485e8
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> kernel/trace/blktrace.c:500:38: error: no member named 'sg_debugfs_dir' in 'struct request_queue'; did you mean 'debugfs_dir'?
strlen(buts->name) == strlen(q->sg_debugfs_dir->d_name.name)
^~~~~~~~~~~~~~
debugfs_dir
include/linux/blkdev.h:572:18: note: 'debugfs_dir' declared here
struct dentry           *debugfs_dir;
^
kernel/trace/blktrace.c:499:16: error: no member named 'sg_debugfs_dir' in 'struct request_queue'; did you mean 'debugfs_dir'?
} else if (q->sg_debugfs_dir &&
^~~~~~~~~~~~~~
debugfs_dir
include/linux/blkdev.h:572:18: note: 'debugfs_dir' declared here
struct dentry           *debugfs_dir;
^
kernel/trace/blktrace.c:501:31: error: no member named 'sg_debugfs_dir' in 'struct request_queue'; did you mean 'debugfs_dir'?
&& strcmp(buts->name, q->sg_debugfs_dir->d_name.name) == 0) {
^~~~~~~~~~~~~~
debugfs_dir
include/linux/blkdev.h:572:18: note: 'debugfs_dir' declared here
struct dentry           *debugfs_dir;
^
kernel/trace/blktrace.c:503:12: error: no member named 'sg_debugfs_dir' in 'struct request_queue'; did you mean 'debugfs_dir'?
dir = q->sg_debugfs_dir;
^~~~~~~~~~~~~~
debugfs_dir
include/linux/blkdev.h:572:18: note: 'debugfs_dir' declared here
struct dentry           *debugfs_dir;
^
kernel/trace/blktrace.c:796:5: warning: no previous prototype for function 'blk_trace_bio_get_cgid' [-Wmissing-prototypes]
u64 blk_trace_bio_get_cgid(struct request_queue *q, struct bio *bio)
^
kernel/trace/blktrace.c:796:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
u64 blk_trace_bio_get_cgid(struct request_queue *q, struct bio *bio)
^
static
1 warning and 4 errors generated.

vim +500 kernel/trace/blktrace.c

   469	
   470	/*
   471	 * Setup everything required to start tracing
   472	 */
   473	static int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
   474				      struct block_device *bdev,
   475				      struct blk_user_trace_setup *buts)
   476	{
   477		struct blk_trace *bt = NULL;
   478		struct dentry *dir = NULL;
   479		int ret;
   480	
   481		if (!buts->buf_size || !buts->buf_nr)
   482			return -EINVAL;
   483	
   484		strncpy(buts->name, name, BLKTRACE_BDEV_SIZE);
   485		buts->name[BLKTRACE_BDEV_SIZE - 1] = '\0';
   486	
   487		/*
   488		 * some device names have larger paths - convert the slashes
   489		 * to underscores for this to work as expected
   490		 */
   491		strreplace(buts->name, '/', '_');
   492	
   493		/*
   494		 * We also have to use a partition directory if a partition is
   495		 * being worked on, even though the same request_queue is shared.
   496		 */
   497		if (bdev && bdev != bdev->bd_contains) {
   498			dir = bdev->bd_part->debugfs_dir;
   499		} else if (q->sg_debugfs_dir &&
 > 500			   strlen(buts->name) == strlen(q->sg_debugfs_dir->d_name.name)
   501			   && strcmp(buts->name, q->sg_debugfs_dir->d_name.name) == 0) {
   502			/* scsi-generic requires use of its own directory */
   503			dir = q->sg_debugfs_dir;
   504		} else {
   505			/*
   506			 * For queues that do not have a gendisk attached to them, that
   507			 * is those which do not use *add_disk*() or similar, the
   508			 * debugfs directory will not have been created at setup time.
   509			 * This is the case for scsi-generic drivers.  Create it here
   510			 * lazily, it will only be removed when the queue is torn down.
   511			 */
   512			if (!q->debugfs_dir) {
   513				q->debugfs_dir =
   514					debugfs_create_dir(buts->name,
   515							   blk_debugfs_root);
   516			}
   517			dir = q->debugfs_dir;
   518		}
   519	
   520		/*
   521		 * As blktrace relies on debugfs for its interface the debugfs directory
   522		 * is required, contrary to the usual mantra of not checking for debugfs
   523		 * files or directories.
   524		 */
   525		if (IS_ERR_OR_NULL(q->debugfs_dir)) {
   526			pr_warn("debugfs_dir not present for %s so skipping\n",
   527				buts->name);
   528			return -ENOENT;
   529		}
   530	
   531		bt = kzalloc(sizeof(*bt), GFP_KERNEL);
   532		if (!bt)
   533			return -ENOMEM;
   534	
   535		ret = -ENOMEM;
   536		bt->sequence = alloc_percpu(unsigned long);
   537		if (!bt->sequence)
   538			goto err;
   539	
   540		bt->msg_data = __alloc_percpu(BLK_TN_MAX_MSG, __alignof__(char));
   541		if (!bt->msg_data)
   542			goto err;
   543	
   544		bt->dev = dev;
   545		atomic_set(&bt->dropped, 0);
   546		INIT_LIST_HEAD(&bt->running_list);
   547	
   548		ret = -EIO;
   549		bt->dropped_file = debugfs_create_file("dropped", 0444, dir, bt,
   550						       &blk_dropped_fops);
   551	
   552		bt->msg_file = debugfs_create_file("msg", 0222, dir, bt, &blk_msg_fops);
   553	
   554		bt->rchan = relay_open("trace", dir, buts->buf_size, buts->buf_nr,
   555				       &blk_relay_callbacks, bt);
   556		if (!bt->rchan)
   557			goto err;
   558	
   559		bt->act_mask = buts->act_mask;
   560		if (!bt->act_mask)
   561			bt->act_mask = (u16) -1;
   562	
   563		blk_trace_setup_lba(bt, bdev);
   564	
   565		/* overwrite with user settings */
   566		if (buts->start_lba)
   567			bt->start_lba = buts->start_lba;
   568		if (buts->end_lba)
   569			bt->end_lba = buts->end_lba;
   570	
   571		bt->pid = buts->pid;
   572		bt->trace_state = Blktrace_setup;
   573	
   574		ret = -EBUSY;
   575		if (cmpxchg(&q->blk_trace, NULL, bt))
   576			goto err;
   577	
   578		get_probe_ref();
   579	
   580		ret = 0;
   581	err:
   582		if (ret)
   583			blk_trace_free(bt);
   584		return ret;
   585	}
   586	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 35125 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-06-02 12:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-02 12:10 [mcgrof:20200601-block-fixes 4/9] kernel/trace/blktrace.c:500:38: error: no member named 'sg_debugfs_dir' in 'struct request_queue'; did you mean 'debugfs_dir'? kbuild 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.