Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp522450pxb; Tue, 19 Oct 2021 07:42:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkns2j3IUz9ktUpZNh3nGG3gmdDjJo7g2Oz2/aWHIETt5pd0lGxfXkoDx6UhcTQ3L/+7s4 X-Received: by 2002:a17:907:9625:: with SMTP id gb37mr38549189ejc.432.1634654535185; Tue, 19 Oct 2021 07:42:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634654535; cv=none; d=google.com; s=arc-20160816; b=jjqPQh8yGQ2F+tN1P8efJKG/iJfp9C2CY7L1X2hwuK1CMOrGZ1I274kNNydjpKOjFF xqhO7y99kSm7ceySq+2z1pf/8ZcfgYyAvW8247u4jXiQfQpAj49RKhZVyLZm+xRZZQel iES4/Jp/Xzrx1U7T/j94AdJZ7vkaNGQkjHoSbEG09dNbeQIPDgH+bICkzsKYRi82V+eV ijEQI//rcBCD0bB5sr9gmQJ5ii83y095YFMQKLyh23tRFHQMUKE3VmeXHm8TFDsBXHES sDuw3pcC/ZB21SwNymhy5nvMmkSkcDzOXthsTNTDiNcw42ffOWXvZi/qi80jWy3buFyv 7VwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=FOGSHk2VOApH2+KCtBYsFzwzfXmho1mXCw0bshaMDUw=; b=EcHL7qiCwu+dOA8w3Tsd4HJN8JfbOmXY+uDO4RQqHIh7vvcx+GlPdFPeYYdACNsA3r 5YIa0/WlIjkMtbkKLbaBFZrkxfLUGcN370UcLLIHzw7fEy+HaWOa+c3kbw+J5CJO21Kj Nh00b43EdzUwtUguR+3rtTpcwEdttIuMImhPiAcUtTTP8wALYt9Z9iBPtgePEf1mJUdx 9yNqJ2IKBayVZbicFXAT585ZosHft/khb2CpnF4bNE9dVmujwzgJ4o83tsKRpgIeenGh QuJx1xWr7NrFcV5VEgck6AlXq8pghTs3mZ+6tqMN+8s3IsCZsdxlv4ewTZFD9mGS33Wy T1iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Djme+D2N; dkim=neutral (no key) header.i=@suse.cz; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hp30si19597097ejc.176.2021.10.19.07.41.38; Tue, 19 Oct 2021 07:42:15 -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; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Djme+D2N; dkim=neutral (no key) header.i=@suse.cz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229554AbhJSOna (ORCPT + 99 others); Tue, 19 Oct 2021 10:43:30 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:35156 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbhJSOn3 (ORCPT ); Tue, 19 Oct 2021 10:43:29 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 0EDA81F782; Tue, 19 Oct 2021 14:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1634654475; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FOGSHk2VOApH2+KCtBYsFzwzfXmho1mXCw0bshaMDUw=; b=Djme+D2Ne9seqbevUDtBReBcYlJAwVN5e1wMmRpp0z0hQ/mkOUV46k/y9e4KMJhTPxfhJy iDhokmCjgxLzMTvdC3QkJYUKeyHkA/VPJllgsyY7UaUlbEjTMK/R5A2NrlKDiYYB03/vKB zcsFPsE+Zwl/Urj0cVVod4QikhY5Z+0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1634654475; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FOGSHk2VOApH2+KCtBYsFzwzfXmho1mXCw0bshaMDUw=; b=cGJhFSNDT0gHqpzVXFZV+szKID6JeNwOxZEFim7TprVkUsP6Nc5bWFGb47hBvBO7YNvzt5 KI8gUvF2Bl47aHCA== Received: from quack2.suse.cz (unknown [10.100.200.198]) by relay2.suse.de (Postfix) with ESMTP id E15BEA3B81; Tue, 19 Oct 2021 14:41:14 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id BF9D01E0983; Tue, 19 Oct 2021 16:41:14 +0200 (CEST) Date: Tue, 19 Oct 2021 16:41:14 +0200 From: Jan Kara To: Gabriel Krisman Bertazi Cc: jack@suse.com, amir73il@gmail.com, djwong@kernel.org, tytso@mit.edu, david@fromorbit.com, dhowells@redhat.com, khazhy@google.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-api@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCH v8 27/32] fanotify: Report fid info for file related file system errors Message-ID: <20211019144114.GP3255@quack2.suse.cz> References: <20211019000015.1666608-1-krisman@collabora.com> <20211019000015.1666608-28-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211019000015.1666608-28-krisman@collabora.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon 18-10-21 21:00:10, Gabriel Krisman Bertazi wrote: > Plumb the pieces to add a FID report to error records. Since all error > event memory must be pre-allocated, we pre-allocate the maximum file > handle size possible, such that it should always fit. > > For errors that don't expose a file handle report it with an invalid > FID. > > Signed-off-by: Gabriel Krisman Bertazi ... > diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c > index 45df610debbe..335ce8f88eb8 100644 > --- a/fs/notify/fanotify/fanotify.c > +++ b/fs/notify/fanotify/fanotify.c > @@ -609,7 +609,9 @@ static struct fanotify_event *fanotify_alloc_error_event( > { > struct fs_error_report *report = > fsnotify_data_error_report(data, data_type); > + struct inode *inode = report->inode; > struct fanotify_error_event *fee; > + int fh_len; > > if (WARN_ON_ONCE(!report)) > return NULL; This WARN_ON_ONCE is now pointless since you dereference report->inode above... So I guess move the dereference after WARN? > @@ -267,6 +274,10 @@ static inline int fanotify_event_dir_fh_len(struct fanotify_event *event) > > static inline bool fanotify_event_has_object_fh(struct fanotify_event *event) > { > + > + /* For error events, even zeroed fh are reported. */ > + if (event->type == FANOTIFY_EVENT_TYPE_FS_ERROR) > + return true; > if (fanotify_event_object_fh_len(event) > 0) > return true; This hunk belongs into patch 25. With these fixed feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR