Thread (1 message) 1 message, 1 author, 2021-05-26

Re: [PATCH 10/11] samples: Add fs error monitoring example

From: Gabriel Krisman Bertazi <hidden>
Date: 2021-05-26 23:37:25
Also in: linux-fsdevel

Amir Goldstein [off-list ref] writes:
quoted
+                       printf("unexpected FAN MARK: %llx\n", metadata->mask);
+                       continue;
+               } else if (metadata->fd != FAN_NOFD) {
+                       printf("Unexpected fd (!= FAN_NOFD)\n");
+                       continue;
+               }
+
+               printf("FAN_ERROR found len=%d\n", metadata->event_len);
+
+               error = (struct fanotify_event_info_error *) (metadata+1);
+               if (error->hdr.info_type == FAN_EVENT_INFO_TYPE_ERROR) {
You meant != FAN_EVENT_INFO_TYPE_ERROR ?
Ugh. the FAN_EVENT_INFO_TYPE_ERROR definition on this file was not updated,
preventing me from catching this. nice catch.
quoted
+                       printf("unknown record: %d\n", error->hdr.info_type);
+                       continue;
+               }
+
+               printf("  Generic Error Record: len=%d\n", error->hdr.len);
+               printf("      fsid: %llx\n", error->fsid);
+               printf("      error: %d\n", error->error);
+               printf("      inode: %lu\n", error->inode);
+               printf("      error_count: %d\n", error->error_count);
+       }
+}
+
+int main(int argc, char **argv)
+{
+       int fd;
+       char buffer[BUFSIZ];
BUFSIZ not defined?
that's from stdio.h.


-- 
Gabriel Krisman Bertazi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help