Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp504049pxb; Mon, 25 Oct 2021 12:34:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwhfLCJ00UuYikFZEbPcona1SFXL/+MsRVogHWTotCxrVwhUrPMp4yScwxw7pBzKRPhMxzl X-Received: by 2002:a17:906:6547:: with SMTP id u7mr24343311ejn.544.1635190483310; Mon, 25 Oct 2021 12:34:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635190483; cv=none; d=google.com; s=arc-20160816; b=KemTgkd7PvJv9INkqV0wAP26WHWO+q00oTErrFcpHQZPvYt0t8HjoSmqC026VAoYbp ewo61vrhJQQlNJLcLK4d6+l1urEWlJcMeXoKaYgu7iz+GnWLpwNBppUj1aWlGRgrZ0vn PRLCHW6bqQ2/TwgtIwfNleIbCCltBDrsYkK0Rx/7UUfF/qD7pX+WvDq36RqE6H4VNZzg uFCQbz/ZUtgKCCePIyL3A01j+t3FshX950ecPguMZRZvtJ3iWp2Jj+mrkA2IeadowyD9 I0e4PvQJlXArLmGoKv9q8Vj66Z8hbARdomkcwOQv4nd6T+nB76M4NmjD93DmA9TC+1TU vSgA== 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=uydLo4TCAkzmRecMaS4qzwtkgrh/7/+3FaWkGS7nhI1WgXUIrLiiu33AV73n5kNegt l0NgOfPx+fFZxot9GX2hPZsqR9dGQ/5/PVitmlRaSPlpbe9qqD3Op8H9IISubv0gTNWD iaDuQlpBA3WqI8swWwRXVqRcaN5ha758k46/Byuku23jvSGlZSPokz6cItIdBdlmKzKn 5sHINKEozlv+Z/XWFgMNm9SxafXyupZc/SITFbqboXMoSyzNUaPYxk0aag53yDKxVTBW yhmiYjTmkbyDPUFSqSV9L0ABtiV1ECeE9W/j4xjY7buKbxHIHIvyEK5jKSnJyg9jO9+T mdCA== 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 n10si33837220edx.401.2021.10.25.12.34.17; Mon, 25 Oct 2021 12:34:43 -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 S235746AbhJYTfa (ORCPT + 99 others); Mon, 25 Oct 2021 15:35:30 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:58614 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235787AbhJYTcc (ORCPT ); Mon, 25 Oct 2021 15:32:32 -0400 Received: from localhost (unknown [IPv6:2804:14c:124:8a08::1002]) (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 1431C1F41CDE; Mon, 25 Oct 2021 20:29:23 +0100 (BST) From: Gabriel Krisman Bertazi To: amir73il@gmail.com, jack@suse.com Cc: djwong@kernel.org, tytso@mit.edu, david@fromorbit.com, dhowells@redhat.com, khazhy@google.com, linux-fsdevel@vger.kernel.org, linux-api@vger.kernel.org, linux-ext4@vger.kernel.org, Gabriel Krisman Bertazi , kernel@collabora.com, Jan Kara Subject: [PATCH v9 13/31] fanotify: Support null inode event in fanotify_dfid_inode Date: Mon, 25 Oct 2021 16:27:28 -0300 Message-Id: <20211025192746.66445-14-krisman@collabora.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211025192746.66445-1-krisman@collabora.com> References: <20211025192746.66445-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