Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp474318pxb; Fri, 15 Oct 2021 09:15:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5oYaCA7P/f4dW0NSXZT/eZ+IKOYUAvSp934rvzAwJdbD6HBpYFfBRqSehvVZ4H0yAfMz+ X-Received: by 2002:a65:62c4:: with SMTP id m4mr9919500pgv.453.1634314557559; Fri, 15 Oct 2021 09:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634314557; cv=none; d=google.com; s=arc-20160816; b=UFMU/puubXtKYda6bx99Kqg4aUqJbnaee7FLttYb3VWai+jGOCntGAQTdb04JgNmYc RIJjkupD+iYHYrfFOvqH+T8+Vkf9jMGdZxzHq/mJSXLpDadELPxzR7JlCbConteW3xnY RmCUOaobUiwxiq4kelvTQB4ONOmV6CH+LYFZHJdrfr4Ay5ZSaG/G8VYrs/ahqZwXFsjL D3YcxjA/1c/A926HoLrQUaAFLLl1CWFJH0GSROscdk3fW4crxfdLzNyAgm8qjmVWqGut Tp/nWUVNxpzQxGtiWogkNkk6Glbj4U8N2gK3hd5t/TvNSHdDiMHb6Sc9DB3Kd2jdn//v xgBQ== 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=vrVBy4iu/vWndrF2YkZJ1wiG86xLeYYCvLKhGTpz9Bs=; b=sOQ6h18D6IXazX+E3yOMX52gS6bKRFEjDEItDRTqeCw6S/xccWb7yGYbR5jqVDybDX wJ96oaomsTHyC8D5rERxYL+6SlTcFBqmnpAMqyEqnmwNc72UMF9pcr1n9htaXNqnNBh3 Ow8t9J7snaXo6Ix/9ZMbq+VJNMxc+mvh3KDLyFjZeXyc8fwtaM95qJ0B6VImvmeN2J0u uM6jGasjBio+zzlRmfb0kDmze7bSf/WgWutsTMEUJFzz04E04AqjQfgeWlRPHHY7NtqY Vu1zzJ6MqdN4hOsapJbPCLDYeVTwxMuoDwMTPrrpNuoHrIXCTUl0Rc2NUC8bVKPxJly6 IT/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=zaO2z9ub; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=u3JY8DOH; 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 nu17si21406433pjb.85.2021.10.15.09.15.44; Fri, 15 Oct 2021 09:15:57 -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=zaO2z9ub; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=u3JY8DOH; 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 S237416AbhJOJck (ORCPT + 99 others); Fri, 15 Oct 2021 05:32:40 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:59600 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237378AbhJOJcc (ORCPT ); Fri, 15 Oct 2021 05:32:32 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 0CEAD1FD39; Fri, 15 Oct 2021 09:30:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1634290225; 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=vrVBy4iu/vWndrF2YkZJ1wiG86xLeYYCvLKhGTpz9Bs=; b=zaO2z9ubBrWTZ2y8aqN/UCaA9HuXQond6ok0lcnMBDYfmoYEFQE9y0iefqer5V+UyLS3x5 otQ/FcvH+fbD5cap2sQvom3fErVS1BTGdcck4hrxvU0SQ3Rfm+qs6INmPe/QU9PiuyaagG qti21eImyj/sK8NYwp+Wv81S+5nM5BM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1634290225; 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=vrVBy4iu/vWndrF2YkZJ1wiG86xLeYYCvLKhGTpz9Bs=; b=u3JY8DOHrAnB7x3Tc8xfk37raw0s4VG7/iTkGNMxPBoMU8o0AfjO1upLt9ssl69qewIpz7 wSzPV/Q0PxdR15CQ== Received: from quack2.suse.cz (unknown [10.100.200.198]) by relay2.suse.de (Postfix) with ESMTP id EF107A3B81; Fri, 15 Oct 2021 09:30:24 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id D50F31E0A40; Fri, 15 Oct 2021 11:30:24 +0200 (CEST) Date: Fri, 15 Oct 2021 11:30:24 +0200 From: Jan Kara To: Gabriel Krisman Bertazi Cc: jack@suse.com, amir73il@gmail.com, djwong@kernel.org, tytso@mit.edu, dhowells@redhat.com, khazhy@google.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-api@vger.kernel.org, repnop@google.com, kernel@collabora.com Subject: Re: [PATCH v7 12/28] fanotify: Support null inode event in fanotify_dfid_inode Message-ID: <20211015093024.GF23102@quack2.suse.cz> References: <20211014213646.1139469-1-krisman@collabora.com> <20211014213646.1139469-13-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211014213646.1139469-13-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 Thu 14-10-21 18:36:30, Gabriel Krisman Bertazi wrote: > FAN_FS_ERROR doesn't support DFID, but this function is still called for > every event. The problem is that it is not capable of handling null > inodes, which now can happen in case of superblock error events. For > this case, just returning dir will be enough. > > Signed-off-by: Gabriel Krisman Bertazi Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/notify/fanotify/fanotify.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c > index c620b4f6fe12..397ee623ff1e 100644 > --- a/fs/notify/fanotify/fanotify.c > +++ b/fs/notify/fanotify/fanotify.c > @@ -452,7 +452,7 @@ static struct inode *fanotify_dfid_inode(u32 event_mask, const void *data, > if (event_mask & ALL_FSNOTIFY_DIRENT_EVENTS) > return dir; > > - if (S_ISDIR(inode->i_mode)) > + if (inode && S_ISDIR(inode->i_mode)) > return inode; > > return dir; > -- > 2.33.0 > -- Jan Kara SUSE Labs, CR