Return-Path: Received: from mx2.suse.de ([195.135.220.15]:38200 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726565AbeK2UEl (ORCPT ); Thu, 29 Nov 2018 15:04:41 -0500 Date: Thu, 29 Nov 2018 10:00:00 +0100 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , Matthew Bobrowski , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v3 07/13] fanotify: copy event fid info to user Message-ID: <20181129090000.GE31087@quack2.suse.cz> References: <20181125134352.21499-1-amir73il@gmail.com> <20181125134352.21499-8-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181125134352.21499-8-amir73il@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sun 25-11-18 15:43:46, Amir Goldstein wrote: > If group requested FAN_REPORT_FID and event has file identifier > copy that information to user reading the event after reading > event metadata. > metadata->event_len includes the length of the fid information. > > Signed-off-by: Amir Goldstein ... > +static int round_event_fid_len(struct fsnotify_event *fsn_event) > +{ > + struct fanotify_event *event = FANOTIFY_E(fsn_event); > + > + if (!FANOTIFY_HAS_FID(event)) > + return 0; > + > + return roundup(FANOTIFY_FID_INFO_LEN(event), FAN_EVENT_METADATA_LEN); > +} > + Why do you round up to FAN_EVENT_METADATA_LEN? I think rounding up to multiple of 8 bytes should be more than enough... Otherwise the patch looks good to me. Honza -- Jan Kara SUSE Labs, CR