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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Amir Goldstein <amir73il@xxxxxxxxx> writes:

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



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux