From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9580CC43381 for ; Fri, 29 Mar 2019 21:37:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5EA9C218A2 for ; Fri, 29 Mar 2019 21:37:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730107AbfC2Vhc (ORCPT ); Fri, 29 Mar 2019 17:37:32 -0400 Received: from mx2.suse.de ([195.135.220.15]:57406 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729771AbfC2Vhc (ORCPT ); Fri, 29 Mar 2019 17:37:32 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id BB73EB16D; Fri, 29 Mar 2019 21:37:30 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 1FE8D1E42C7; Fri, 29 Mar 2019 22:37:30 +0100 (CET) Date: Fri, 29 Mar 2019 22:37:30 +0100 From: Jan Kara To: Matthew Bobrowski Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, amir73il@gmail.com, jack@suse.cz Subject: Re: [patch] fanotify.7, fanotify_init.2, fanotify_mark.2: Document FAN_REPORT_FID and directory modification events Message-ID: <20190329213730.GD8757@quack2.suse.cz> References: <20190325005133.GA13990@lithium.mbobrowski.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190325005133.GA13990@lithium.mbobrowski.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon 25-03-19 11:51:39, Matthew Bobrowski wrote: > Details relating to the new initialization flag FAN_REPORT_FID has been > added. As part of the FAN_REPORT_FID feature, a new set of event masks are > available and have been documented accordingly. > > A simple example program has been added to also support the understanding > and use case of FAN_REPORT_FID. > > Signed-off-by: Matthew Bobrowski > Reviewed-by: Amir Goldstein Looks good to me, you can add: Reviewed-by: Jan Kara Two nits below: > +.I hdr > +This is a structure of type > +.IR fanotify_event_info_header . > +It is a generic header that contains information used to describe > +additional information attached to the event. > +For example, when an fanotify file descriptor is created using > +.B FAN_REPORT_FID > +the > +.I info_type > +field of this header is set to > +.BR FAN_EVENT_INFO_TYPE_FID . > +Event listeners can use this field to check that events of the correct ^^^ additional information of the correct type? ... > + /* Process all events within the buffer */ > + for (metadata = (struct fanotify_event_metadata *) events_buf; > + FAN_EVENT_OK(metadata, len); > + metadata = FAN_EVENT_NEXT(metadata, len)) { > + fid = (struct fanotify_event_info_fid *) (metadata + 1); > + file_handle = (struct file_handle *) fid->handle; > + > + /* Ensure that the event info is of the correct type */ > + if (fid->hdr.info_type != FAN_EVENT_INFO_TYPE_FID) { > + fprintf(stderr, "Received unexpected event type.\\n"); ^^^ event info type? Honza -- Jan Kara SUSE Labs, CR