All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Christian Brauner <brauner@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev,
	Christian Brauner <christianvanbrauner@gmail.com>
Subject: [brauner-vfs:work.coredump.socket.protocol 9/13] fs/coredump.c:690:12: warning: 'coredump_request' defined but not used
Date: Wed, 28 May 2025 00:41:21 +0800	[thread overview]
Message-ID: <202505280036.xjAhNgLi-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git work.coredump.socket.protocol
head:   cb5f73bef28a0477715f449b2ceb17e77a1b640a
commit: 9ce83f52a131f8806989e05df19215c433c8e7c8 [9/13] coredump: allow better parameter control
config: csky-randconfig-001-20250527 (https://download.01.org/0day-ci/archive/20250528/202505280036.xjAhNgLi-lkp@intel.com/config)
compiler: csky-linux-gcc (GCC) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250528/202505280036.xjAhNgLi-lkp@intel.com/reproduce)

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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505280036.xjAhNgLi-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/coredump.c:690:12: warning: 'coredump_request' defined but not used [-Wunused-function]
     690 | static int coredump_request(struct core_name *cn, struct coredump_params *cprm)
         |            ^~~~~~~~~~~~~~~~


vim +/coredump_request +690 fs/coredump.c

   689	
 > 690	static int coredump_request(struct core_name *cn, struct coredump_params *cprm)
   691	{
   692		struct coredump_req req = {
   693			.size		= sizeof(struct coredump_req),
   694			.mask		= COREDUMP_KERNEL | COREDUMP_USERSPACE |
   695					  COREDUMP_REJECT | COREDUMP_WAIT,
   696			.size_ack	= sizeof(struct coredump_ack),
   697		};
   698		struct coredump_ack ack = {};
   699		ssize_t ret, usize;
   700	
   701		if (cn->core_type != COREDUMP_SOCK_REQ)
   702			return 0;
   703	
   704		/* Let userspace know what we support. */
   705		ret = coredump_sock_send(cprm->file, &req);
   706		if (ret)
   707			return ret;
   708	
   709		/*
   710		 * Peek the size of the coredump_ack struct that userspace
   711		 * wants to send us and then retrieve it all in one go.
   712		 */
   713		ret = coredump_sock_recv(cprm->file, &ack, sizeof(ack.size),
   714					 MSG_PEEK | MSG_WAITALL);
   715		if (ret)
   716			return ret;
   717	
   718		/*
   719		 * We told userspace what size we know about.
   720		 * So refuse anything too small or larger than we know.
   721		 */
   722		usize = ack.size;
   723		if (usize < COREDUMP_ACK_SIZE_VER0 || usize > sizeof(ack)) {
   724			coredump_sock_oob(cprm->file, COREDUMP_OOB_INVALIDSIZE);
   725			return -EINVAL;
   726		}
   727	
   728		/* Now retrieve the coredump_ack. */
   729		ret = coredump_sock_recv(cprm->file, &ack, usize, MSG_WAITALL);
   730		if (ret)
   731			return ret;
   732		if (ack.size != usize)
   733			return -EINVAL;
   734	
   735		/*
   736		 * We told userspace what flags we support.
   737		 * So refuse any flags we don't know.
   738		 */
   739		if (ack.mask & ~req.mask) {
   740			coredump_sock_oob(cprm->file, COREDUMP_OOB_UNSUPPORTED);
   741			return -EINVAL;
   742		}
   743	
   744		/* Handle mutually exclusive options. */
   745		if (hweight64(ack.mask & (COREDUMP_USERSPACE | COREDUMP_KERNEL |
   746					  COREDUMP_REJECT)) != 1) {
   747			coredump_sock_oob(cprm->file, COREDUMP_OOB_CONFLICTING);
   748			return -EINVAL;
   749		}
   750	
   751		cn->mask = ack.mask;
   752		return 0;
   753	}
   754	

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

                 reply	other threads:[~2025-05-27 16:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202505280036.xjAhNgLi-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=brauner@kernel.org \
    --cc=christianvanbrauner@gmail.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.