* [brauner-vfs:work.coredump.socket.protocol 9/13] fs/coredump.c:690:12: warning: 'coredump_request' defined but not used
@ 2025-05-27 16:41 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2025-05-27 16:41 UTC (permalink / raw)
To: Christian Brauner; +Cc: oe-kbuild-all, Christian Brauner
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-05-27 16:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-27 16:41 [brauner-vfs:work.coredump.socket.protocol 9/13] fs/coredump.c:690:12: warning: 'coredump_request' defined but not used 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.