Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5060931pxb; Thu, 14 Oct 2021 18:18:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJztKMRGqM7LHwmEj/LRGjPse3B0NhsRXNkFBjZMyFAHI7GDyWvHQyVE0dk5hube/Cm1SN03 X-Received: by 2002:a17:902:8a83:b0:13d:9572:86c2 with SMTP id p3-20020a1709028a8300b0013d957286c2mr8373250plo.48.1634260735310; Thu, 14 Oct 2021 18:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634260735; cv=none; d=google.com; s=arc-20160816; b=w3XtUh/ZWRAhVfvJPSPnwGodl28fcSRXvWBn9Ux95/dIj6s+jWj2bkTQXAoBiGrQtW r3Imo/ogYZz4o7U5UTnGABBnCmtuKRu8nhHNPgTzrPckl5EYmZqoXOevYyeir4PUlHVZ i7U9ejwGGJC33mKoWZHVoohX1hljjAt8tZrwRYYAPTiwBlxGB84xo3zMY2nsMIKiAw4R B1wZwrXDiaAa3wYoe5gSpDv18JbFjrISKnaSSmNnh8oDKkKJHA1lRqSnzX80HxMKw8eT H6nY0UZS8KiHV4dzosDMadYGLYOnNpxOYP0tnBQmlVZBFRlZkThZ7y6c6KMJ2VxLEv0G 7x3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qzX/fPrZr9LwzsTsJe+dKnRXvIZQbJc62uMhdfEHYOI=; b=ndQEYxlhQkJ/V0qmA9p6HiUdPCR9Soa6oIKh5HdvITO+PNLgz93bzMy5TjxVYrvHcD MMZ1xoLZ2Ki78wir54g0kM8IVdQF01PlktT6nvWER0WZLZesoeqrOBUCkxofFWTaTaXi B4Nuc0Wi/Cx9YHwqQKLjOO6MWFsSuBVmyZWRMAcV0WNF0AWhOUf93ukC9yFTWZP61FD+ 7FgIzdNjtg4x8os7icnphw5YABkT7pzljB+aymRWEBhFOCgwnGAyZ2PoP2IpeGLmdNTx eJCC3LnXcykas57+eoQ3Oot+d/Yigw3n87nSJsOjWL5R74/X1PZZF9DwP3DsowNu1go6 Yx6g== 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 x8si9681361pja.41.2021.10.14.18.18.42; Thu, 14 Oct 2021 18:18:55 -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 S233512AbhJNVka (ORCPT + 99 others); Thu, 14 Oct 2021 17:40:30 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:54138 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231956AbhJNVka (ORCPT ); Thu, 14 Oct 2021 17:40:30 -0400 Received: from localhost (unknown [IPv6:2804:14c:124:8a08::1007]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: krisman) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 38BFF1F44F83; Thu, 14 Oct 2021 22:38:22 +0100 (BST) From: Gabriel Krisman Bertazi To: jack@suse.com, amir73il@gmail.com Cc: 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, Gabriel Krisman Bertazi , kernel@collabora.com Subject: [PATCH v7 12/28] fanotify: Support null inode event in fanotify_dfid_inode Date: Thu, 14 Oct 2021 18:36:30 -0300 Message-Id: <20211014213646.1139469-13-krisman@collabora.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211014213646.1139469-1-krisman@collabora.com> References: <20211014213646.1139469-1-krisman@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 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 --- 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