Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3501923pxb; Mon, 18 Oct 2021 17:03:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyv06efwF7WCH06AFWne/UjV58I/5qf+fokSh4O4rEAH+2YB3NoPyBneZAJtY6uF8yDaX1e X-Received: by 2002:a17:907:9606:: with SMTP id gb6mr17156427ejc.287.1634601802491; Mon, 18 Oct 2021 17:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634601802; cv=none; d=google.com; s=arc-20160816; b=vkAxQsm3ixM/nHPtMz9TCeNXdkuEh2a04Jrl1QRxQorWBWzFJYkMkcXpaFWIwRclii z8iNLAn/2cD30jdd4ysN9pJ8ozlh40/532X0d6MBG8XOPoE8iMJg/pWcC6wIS4Fzk1/E r/O5NCjYf6k33H9OnAL+Rh94veIxAW9JKaXepsf+y+tll65UmdlpAD/IFLUlY0EBGlN5 bxCcFAlkAl6t/hRfPTZtLr2hgwmW0SkkccVTD4vGJiBfvZDrpaYNa0oN3LG8FhYonZj8 t2ns6bjM0oecykk+FTDlb7ekV7Q+6J3i1+jezAzQEunB7W0CSfrvF5pL5OYvyazjvJ6o FK+A== 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=HQamnNLnwQqsnl01znWnNQd9dUhvAsdyXTNBJlbB0BQ=; b=suMqTIWZmDV0RefjDyj131Z8NwFy0AKXDMU+283tFbgWBiMGsx5efKI46rQUkWqvBo 0stw4VpBo2X8hD0DAbhNTQ+W6cgtMIuj9q3oS8oNM90K0g9M6XiAjpzYJ6ZDz2Tvh78t kqFwDGnKq8CwBHSkeEaF3WgGnJCo+9Juo+kPX/yMX1YFCSFFXR4Ecd2Ctkem4OjHo24I WlAIOsDVisn5lmUvrxcyHNxF/nSG3NcknZBZvYhx3iuKA6aC1hLgYa2c5PygVnk04LAN gzN/tIbJ2JaB9vTIMxxzkRNayrZMIfCfdUOvXmmefpaHzOHVM9X0UMI4xLvlo53cOlt6 siAA== 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 jg11si25544056ejc.229.2021.10.18.17.02.59; Mon, 18 Oct 2021 17:03:22 -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 S233239AbhJSAFC (ORCPT + 99 others); Mon, 18 Oct 2021 20:05:02 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:40886 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233992AbhJSAFB (ORCPT ); Mon, 18 Oct 2021 20:05:01 -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 B38FB1F411B7; Tue, 19 Oct 2021 01:02:47 +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 18/32] fanotify: Reserve UAPI bits for FAN_FS_ERROR Date: Mon, 18 Oct 2021 21:00:01 -0300 Message-Id: <20211019000015.1666608-19-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 allows reporting of event type FS_ERROR to userspace, which is a mechanism to report file system wide problems via fanotify. This commit preallocate userspace visible bits to match the FS_ERROR event. Reviewed-by: Jan Kara Reviewed-by: Amir Goldstein Signed-off-by: Gabriel Krisman Bertazi --- fs/notify/fanotify/fanotify.c | 1 + include/uapi/linux/fanotify.h | 1 + 2 files changed, 2 insertions(+) diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index c64d61b673ca..8f152445d75c 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c @@ -752,6 +752,7 @@ static int fanotify_handle_event(struct fsnotify_group *group, u32 mask, BUILD_BUG_ON(FAN_ONDIR != FS_ISDIR); BUILD_BUG_ON(FAN_OPEN_EXEC != FS_OPEN_EXEC); BUILD_BUG_ON(FAN_OPEN_EXEC_PERM != FS_OPEN_EXEC_PERM); + BUILD_BUG_ON(FAN_FS_ERROR != FS_ERROR); BUILD_BUG_ON(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 19); diff --git a/include/uapi/linux/fanotify.h b/include/uapi/linux/fanotify.h index 64553df9d735..2990731ddc8b 100644 --- a/include/uapi/linux/fanotify.h +++ b/include/uapi/linux/fanotify.h @@ -20,6 +20,7 @@ #define FAN_OPEN_EXEC 0x00001000 /* File was opened for exec */ #define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ +#define FAN_FS_ERROR 0x00008000 /* Filesystem error */ #define FAN_OPEN_PERM 0x00010000 /* File open in perm check */ #define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */ -- 2.33.0