Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1949167pxy; Mon, 2 Aug 2021 14:48:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsgm2Jl5hf9MdhcVpxAXzT1fTPdPpUvmPF/d3NZNx3Fcnn8B4rWy6l6VqSaoERTmQttc0I X-Received: by 2002:a05:6e02:96e:: with SMTP id q14mr51395ilt.151.1627940908100; Mon, 02 Aug 2021 14:48:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627940908; cv=none; d=google.com; s=arc-20160816; b=0vF0Zsc3G/qWsxqpkRakT4LWpa2dZjrvwpAAc7VmUOaO882/ifje/8gCoIjaw6vjB7 VseyJ2eR+Obs7I3VQr6RGHpuT+Z39yTIibqvjd8f49IIwkbpZ1U5jlyvyVNxvpavMJJ0 CBM7lHlMpTN+Q1CJJWHQtT8xlLYjO5RMHB3H/MH5zFMSQpBqPjKpFmjI53aPpW+Uq6U3 7nUlULiQiljepVBGxZOYIox+YgpTGyJE2pagF2Kjf9BtDJaqtu7ah68sYlaFsxZX1JES YQSmFkNBBUbgJ3dH317MkTlhmDMoVgsKWWBA3CZNH/tCIU8eD4H2cBtVC1RdPDlrF46u 0Tzw== 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=5GlEdwRRAzYay98T/+FbH194kjuHkVOeGpx6L8ssNVI=; b=uR3NVnZXlnBKgzA4HrMVyWvLZR0xumuOezgCG8+ddgwAeBVYapnPTR6XTC3xYjT/R7 86sISbGcDLyWc5V8ZP5oevF0ALUEFsxogcUdhSuxpVdtxW7P5URfdqMvTin1nZqiG4B+ rVkEEzFsFiPK6qMd6PQ5Z8j5dotJvf4XO0Vvgq786ImrKcSYVrdJI25Hg222oNcftkVd 5InvDE68iPOzoprdZYFiVKMOpZcELOF28f/z4US3mnQhqzZX2JbtZfJlQ1lm3k6mzdfL Nnr1ojOMdG7kDIvYntb9X20C9oexqNZIOBh4lR/R0Lg05ivVvEbmSaRxObF3ROxoNr78 CCSA== 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 y13si13916458ioq.14.2021.08.02.14.48.16; Mon, 02 Aug 2021 14:48:28 -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 S231764AbhHBVrX (ORCPT + 99 others); Mon, 2 Aug 2021 17:47:23 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:38226 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbhHBVrX (ORCPT ); Mon, 2 Aug 2021 17:47:23 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 60CFA1F42CCA From: Gabriel Krisman Bertazi To: ltp@lists.linux.it, jack@suse.com, amir73il@gmail.com Cc: linux-ext4@vger.kernel.org, khazhy@google.com, kernel@collabora.com, Gabriel Krisman Bertazi Subject: [PATCH 4/7] syscalls/fanotify20: Watch event after filesystem abort Date: Mon, 2 Aug 2021 17:46:42 -0400 Message-Id: <20210802214645.2633028-5-krisman@collabora.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210802214645.2633028-1-krisman@collabora.com> References: <20210802214645.2633028-1-krisman@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org This test monitors the EXT4 specific error triggered after a file system abort. It works by forcing a remount with the option "abort". This is an error not related to a file so it is reported against the superblock with a NULL FH. Signed-off-by: Gabriel Krisman Bertazi --- testcases/kernel/syscalls/fanotify/fanotify20.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/testcases/kernel/syscalls/fanotify/fanotify20.c b/testcases/kernel/syscalls/fanotify/fanotify20.c index d8d788ae685f..7a9601072139 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify20.c +++ b/testcases/kernel/syscalls/fanotify/fanotify20.c @@ -61,6 +61,14 @@ int fd_notify; #define MOUNT_PATH "test_mnt" +#define EXT4_ERR_ESHUTDOWN 16 + +static void trigger_fs_abort(void) +{ + SAFE_MOUNT(tst_device->dev, MOUNT_PATH, tst_device->fs_type, + MS_REMOUNT|MS_RDONLY, "abort"); +} + static const struct test_case { char *name; int error; @@ -71,6 +79,13 @@ static const struct test_case { void (*trigger_error)(void); void (*prepare_fs)(void); } testcases[] = { + { + .name = "Trigger abort", + .trigger_error = &trigger_fs_abort, + .error_count = 1, + .error = EXT4_ERR_ESHUTDOWN, + .inode = NULL + } }; struct fanotify_event_info_header *get_event_info( -- 2.32.0