Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3501633pxb; Mon, 18 Oct 2021 17:03:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYzbihlyRmDKJKuUnZS5rtKJyQ3329bz6vHijGt0L3ocTdyA3k+czyTYzQwZXfNKpQ6e1/ X-Received: by 2002:a17:906:9b88:: with SMTP id dd8mr2563864ejc.467.1634601784338; Mon, 18 Oct 2021 17:03:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634601784; cv=none; d=google.com; s=arc-20160816; b=BjwK7egIVC8sAOMH8kjnDMrwePcrP99VYdZLMGxchPA3j41sUcpkpeiSg452WEodln 6r+2+r58AHO4Y10yzdOD6wrGjWSCir6Yb15VFYu2JcUBbh1+0PPi4Q7y1/w9v5smjei+ cECScD7Y8E3AwWoZpj548MiQa5j4SLtrSIXto+tjGV1KcXM/79uOQkMb5jfmTB5JW5tV o2oBuiqPYq7MrP1KqJrnc0+TEp21lDmQ5ekEXBKtY5Q5v+J7ph0Q6/b7inO6eWbe3Uu3 5I7UeiAY3JrwoUpyBq3biJ3CjsoOh82CgSx4+dvyrHy4ruvbG3S8wv3GRl+XFOk8SJT/ vuYw== 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=CVxsp0qoxNnYWe9dpSSubhTDyTQ1uvWtuBSr0pb5nVo=; b=d0PBabvJY+RcM7F3ymD22Alu4wJnqPB94lLkywUlKaUvMkv916RqtDHqkr/QLa/Muy 34Wwseqkj9RHCY0T11YnPzqlkmAex4k4qN3iIOt42sXdRVraNVlG3uFGc6UMNctdKVj4 UkwI0ByWvAMWMwK3x/dLSMThb+ubIJ6gz2LG/Gj7yalG7/NejPYlne8xOOQuW8/mepDy OxFJ+tVl2M5XU8ftVH0YxX8qwiNCjiyxqvsvUEd2e6EF3lLTzQjSjDxQsdVsNwr1oin5 GNx1UhIVXhKynnDawR1YUgWi+BJsvPQWu8nckxAreBM9+rBiXVd9KB/2cLs7Lv2pjiVz o9rw== 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 d2si20222196edy.32.2021.10.18.17.02.40; Mon, 18 Oct 2021 17:03:04 -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 S233939AbhJSAES (ORCPT + 99 others); Mon, 18 Oct 2021 20:04:18 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:40796 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233931AbhJSAES (ORCPT ); Mon, 18 Oct 2021 20:04:18 -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 6471D1F424C4; Tue, 19 Oct 2021 01:02:03 +0100 (BST) From: Gabriel Krisman Bertazi To: jack@suse.com, amir73il@gmail.com Cc: 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, Gabriel Krisman Bertazi , kernel@collabora.com, Jan Kara Subject: [PATCH v8 13/32] fanotify: Support null inode event in fanotify_dfid_inode Date: Mon, 18 Oct 2021 20:59:56 -0300 Message-Id: <20211019000015.1666608-14-krisman@collabora.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211019000015.1666608-1-krisman@collabora.com> References: <20211019000015.1666608-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. Reviewed-by: Amir Goldstein Reviewed-by: Jan Kara 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