Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp133734pxj; Wed, 26 May 2021 18:21:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVCHCGiTjTPs+d25pgMP7UskOFe1b42Xiw1KNMYAan1o/kk4BMehq/j/iPNcC1Dku6Tsj9 X-Received: by 2002:a05:6638:124b:: with SMTP id o11mr1005667jas.4.1622078461893; Wed, 26 May 2021 18:21:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622078461; cv=none; d=google.com; s=arc-20160816; b=viTlCRYiQTI57Agv8Bg2id4am7u0Jww9+X6JhdF8tY5y9UI6VkAbn3PkvkQ2NUn7Yx +QBBdtpcMUFcR/0JHVX3180pFI32/MztYyBMm5TIa2P2OdAI+kP3wzmV2UWovgSbj29w sq2IvHnuA15rpZ9cvysAyICos6oln0P7u/c+hs/U/BSFOkzN49AibpTGEY1QyVOi8Srk dnKFsBt62Qz99oke8pg0OZIsMBwCeTDZK/d/7SHWb5ec/GLtNtxM8Hykfnb8QZ9KjKZc Jcd2e59u/HnfAaLZHXXplsYKRe+YTrcp6QYJCsuAOP28p/B0bGwg1D3YJXJ+DgG9W4Iw nAvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:organization:subject:cc:to:from; bh=fm3SLnf1QqT8r/1Xd+AsUps18eL3/C/fL57X662hfVg=; b=hwYx1SGjIoXK8ooRcX5Y10fz1vVZhWQjLL3ERlG68xdsY/cPbCKAdY0F1xHOAc2w6J GWdXROuhLSr0/bwq6XJ8p7xJf/p7dABmzsG+tg3VPhptth/ML+srZYZEaEk0d5lw1dYc rXokzNFThyeTazeGyBi5XDmkac4nYvZdxwZaIKLz0fpWqhhqgyCquy7O6JpNDX2G8ZZK 9nj6WVNnQJd9/PsHKZyYsHTbaCS2hmXWVsAIZgndsVD6FUDvXClpZidQCQJz4t4tkwrT wbGytyDt1svIftT6D1obyZJzLUKx088LRo/as2LggkMq8DlVZ3rEnn7E/Pd9gJXub8sb Zwyg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j2si1016022jak.119.2021.05.26.18.20.46; Wed, 26 May 2021 18:21:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233478AbhEZXiz (ORCPT + 99 others); Wed, 26 May 2021 19:38:55 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:40050 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233517AbhEZXiy (ORCPT ); Wed, 26 May 2021 19:38:54 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 6C0EE1F434FC From: Gabriel Krisman Bertazi To: Amir Goldstein Cc: kernel@collabora.com, "Darrick J . Wong" , "Theodore Ts'o" , Dave Chinner , Jan Kara , David Howells , Khazhismel Kumykov , linux-fsdevel , Ext4 Subject: Re: [PATCH 10/11] samples: Add fs error monitoring example Organization: Collabora References: <20210521024134.1032503-1-krisman@collabora.com> <20210521024134.1032503-11-krisman@collabora.com> Date: Wed, 26 May 2021 19:37:17 -0400 In-Reply-To: (Amir Goldstein's message of "Fri, 21 May 2021 12:48:18 +0300") Message-ID: <87tumpjccy.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Amir Goldstein 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