All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH RFC 14/15] samples: Add fs error monitoring example
Date: Tue, 27 Apr 2021 07:10:24 +0800	[thread overview]
Message-ID: <202104270702.GxizjvSN-lkp@intel.com> (raw)
In-Reply-To: <20210426184201.4177978-15-krisman@collabora.com>

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

Hi Gabriel,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on pcmoore-audit/next]
[also build test ERROR on ext4/dev linus/master v5.12]
[cannot apply to ext3/fsnotify next-20210426]
[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/Gabriel-Krisman-Bertazi/File-system-wide-monitoring/20210427-024627
base:   https://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/audit.git next
config: um-allmodconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/3b25963eb28ef5e89ef34cc7b64e479205a38e9e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Gabriel-Krisman-Bertazi/File-system-wide-monitoring/20210427-024627
        git checkout 3b25963eb28ef5e89ef34cc7b64e479205a38e9e
        # save the attached .config to linux build tree
        make W=1 W=1 ARCH=um 

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 >>):

>> samples/fanotify/fs-monitor.c:28:36: error: field 'hdr' has incomplete type
      28 |  struct fanotify_event_info_header hdr;
         |                                    ^~~
   samples/fanotify/fs-monitor.c:35:36: error: field 'hdr' has incomplete type
      35 |  struct fanotify_event_info_header hdr;
         |                                    ^~~
   samples/fanotify/fs-monitor.c:41:36: error: field 'hdr' has incomplete type
      41 |  struct fanotify_event_info_header hdr;
         |                                    ^~~
   samples/fanotify/fs-monitor.c: In function 'handle_notifications':
>> samples/fanotify/fs-monitor.c:72:62: error: dereferencing pointer to incomplete type 'struct fanotify_event_info_header'
      72 |   for (off = (char*)(metadata+1); off < next; off = off + hdr->len) {
         |                                                              ^~
   samples/fanotify/fs-monitor.c: In function 'main':
>> samples/fanotify/fs-monitor.c:121:37: error: 'FAN_MARK_FILESYSTEM' undeclared (first use in this function); did you mean 'FAN_MARK_FLUSH'?
     121 |  if (fanotify_mark(fd, FAN_MARK_ADD|FAN_MARK_FILESYSTEM,
         |                                     ^~~~~~~~~~~~~~~~~~~
         |                                     FAN_MARK_FLUSH
   samples/fanotify/fs-monitor.c:121:37: note: each undeclared identifier is reported only once for each function it appears in


vim +/hdr +28 samples/fanotify/fs-monitor.c

    26	
    27	struct fanotify_event_info_error {
  > 28		struct fanotify_event_info_header hdr;
    29		int version;
    30		int error;
    31		long long unsigned fsid;
    32	};
    33	
    34	struct fanotify_event_info_location {
    35		struct fanotify_event_info_header hdr;
    36		int line;
    37		char function[0];
    38	};
    39	
    40	struct fanotify_event_info_fsdata {
    41		struct fanotify_event_info_header hdr;
    42		char data[0];
    43	};
    44	
    45	struct ext4_error_inode_report {
    46		unsigned long long inode;
    47		unsigned long long block;
    48		char desc[40];
    49	};
    50	#endif
    51	
    52	static void handle_notifications(char *buffer, int len)
    53	{
    54		struct fanotify_event_metadata *metadata;
    55		struct fanotify_event_info_header *hdr = 0;
    56		char *off, *next;
    57	
    58		for (metadata = (struct fanotify_event_metadata *) buffer;
    59		     FAN_EVENT_OK(metadata, len); metadata = FAN_EVENT_NEXT(metadata, len)) {
    60			next = (char*)metadata  + metadata->event_len;
    61			if (!(metadata->mask == FAN_ERROR)) {
    62				printf("unexpected FAN MARK: %llx\n", metadata->mask);
    63				continue;
    64			}
    65			if (metadata->fd != FAN_NOFD) {
    66				printf("bizar fd != FAN_NOFD\n");
    67				continue;;
    68			}
    69	
    70			printf("FAN_ERROR found len=%d\n", metadata->event_len);
    71	
  > 72			for (off = (char*)(metadata+1); off < next; off = off + hdr->len) {
    73				hdr = (struct fanotify_event_info_header*)(off);
    74	
    75				if (hdr->info_type == FAN_EVENT_INFO_TYPE_ERROR) {
    76					struct fanotify_event_info_error *error =
    77						(struct fanotify_event_info_error*) hdr;
    78	
    79					printf("  Generic Error Record: len=%d\n", hdr->len);
    80					printf("      version: %d\n", error->version);
    81					printf("      error: %d\n", error->error);
    82					printf("      fsid: %llx\n", error->fsid);
    83	
    84				} else if(hdr->info_type == FAN_EVENT_INFO_TYPE_LOCATION) {
    85					struct fanotify_event_info_location *loc =
    86						(struct fanotify_event_info_location*) hdr;
    87	
    88					printf("  Location Record Size = %d\n", loc->hdr.len);
    89					printf("      loc=%s:%d\n", loc->function, loc->line);
    90	
    91				} else if(hdr->info_type == FAN_EVENT_INFO_TYPE_FSDATA) {
    92					struct fanotify_event_info_fsdata *data =
    93						(struct fanotify_event_info_fsdata *)hdr;
    94					struct ext4_error_inode_report *fsdata =
    95						(struct ext4_error_inode_report*) ((char*)data->data);
    96	
    97					printf("  Fsdata Record: len=%d\n", hdr->len);
    98					printf("      inode=%llu\n", fsdata->inode);
    99					if (fsdata->block != -1L)
   100						printf("      block=%llu\n", fsdata->block);
   101					printf("      desc=%s\n", fsdata->desc);
   102				}
   103			}
   104		}
   105	}
   106	
   107	int main(int argc, char **argv)
   108	{
   109		int fd;
   110		char buffer[BUFSIZ];
   111	
   112		if (argc < 2) {
   113			printf("Missing path argument\n");
   114			return 1;
   115		}
   116	
   117		fd = fanotify_init(FAN_CLASS_NOTIF|FAN_PREALLOC_QUEUE, O_RDONLY);
   118		if (fd < 0)
   119			errx(1, "fanotify_init");
   120	
 > 121		if (fanotify_mark(fd, FAN_MARK_ADD|FAN_MARK_FILESYSTEM,

---
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: 24316 bytes --]

  reply	other threads:[~2021-04-26 23:10 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-26 18:41 [PATCH RFC 00/15] File system wide monitoring Gabriel Krisman Bertazi
2021-04-26 18:41 ` [PATCH RFC 01/15] fanotify: Fold event size calculation to its own function Gabriel Krisman Bertazi
2021-04-27  4:42   ` Amir Goldstein
2021-04-26 18:41 ` [PATCH RFC 02/15] fanotify: Split fsid check from other fid mode checks Gabriel Krisman Bertazi
2021-04-27  4:53   ` Amir Goldstein
2021-04-26 18:41 ` [PATCH RFC 03/15] fsnotify: Wire flags field on group allocation Gabriel Krisman Bertazi
2021-04-27  5:03   ` Amir Goldstein
2021-04-26 18:41 ` [PATCH RFC 04/15] fsnotify: Wire up group information on event initialization Gabriel Krisman Bertazi
2021-04-26 18:41 ` [PATCH RFC 05/15] fsnotify: Support event submission through ring buffer Gabriel Krisman Bertazi
2021-04-26 22:00   ` kernel test robot
2021-04-26 22:43   ` kernel test robot
2021-04-27  5:39   ` Amir Goldstein
2021-04-29 18:33     ` Gabriel Krisman Bertazi
2021-04-26 18:41 ` [PATCH RFC 06/15] fanotify: Support " Gabriel Krisman Bertazi
2021-04-27  6:02   ` Amir Goldstein
2021-04-29 18:36     ` Gabriel Krisman Bertazi
2021-04-26 18:41 ` [PATCH RFC 07/15] fsnotify: Support FS_ERROR event type Gabriel Krisman Bertazi
2021-04-27  8:39   ` Amir Goldstein
2021-04-26 18:41 ` [PATCH RFC 08/15] fsnotify: Introduce helpers to send error_events Gabriel Krisman Bertazi
2021-04-27  6:49   ` Amir Goldstein
2021-04-26 18:41 ` [PATCH RFC 09/15] fanotify: Introduce generic error record Gabriel Krisman Bertazi
2021-04-27  7:01   ` Amir Goldstein
2021-04-26 18:41 ` [PATCH RFC 10/15] fanotify: Introduce code location record Gabriel Krisman Bertazi
2021-04-27  7:11   ` Amir Goldstein
2021-04-29 18:40     ` Gabriel Krisman Bertazi
2021-05-11  5:35       ` Khazhy Kumykov
2021-04-26 18:41 ` [PATCH RFC 11/15] fanotify: Introduce filesystem specific data record Gabriel Krisman Bertazi
2021-04-27  7:12   ` Amir Goldstein
2021-04-26 18:41 ` [PATCH RFC 12/15] fanotify: Introduce the FAN_ERROR mark Gabriel Krisman Bertazi
2021-04-26 22:45   ` kernel test robot
2021-04-27  7:25   ` Amir Goldstein
2021-04-26 18:41 ` [PATCH RFC 13/15] ext4: Send notifications on error Gabriel Krisman Bertazi
2021-04-26 23:10   ` kernel test robot
2021-04-27  4:32   ` Amir Goldstein
2021-04-29  0:57   ` Darrick J. Wong
2021-04-26 18:42 ` [PATCH RFC 14/15] samples: Add fs error monitoring example Gabriel Krisman Bertazi
2021-04-26 23:10   ` kernel test robot [this message]
2021-04-26 18:42 ` [PATCH RFC 15/15] Documentation: Document the FAN_ERROR framework Gabriel Krisman Bertazi
2021-04-27  4:11 ` [PATCH RFC 00/15] File system wide monitoring Amir Goldstein
2021-04-27 15:44   ` Gabriel Krisman Bertazi
2021-05-11  4:45     ` Khazhy Kumykov
2021-05-11 10:43   ` Jan Kara
2021-04-27  4:33 [PATCH RFC 12/15] fanotify: Introduce the FAN_ERROR mark kernel test robot
2021-04-29 11:31 ` Dan Carpenter
2021-04-27  8:36 [PATCH RFC 13/15] ext4: Send notifications on error kernel test robot
2021-04-29 13:19 ` Dan Carpenter

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=202104270702.GxizjvSN-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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.