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