Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1949300pxy; Mon, 2 Aug 2021 14:48:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjp50lYCiEFt6JyERGxOjthBPVfb2doRPLCkGuwTr+yI69Fa1GrdgT4FScYMzO2VpVMIKN X-Received: by 2002:a92:c989:: with SMTP id y9mr694569iln.183.1627940921535; Mon, 02 Aug 2021 14:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627940921; cv=none; d=google.com; s=arc-20160816; b=aLiwHUQesqgPY89tradSHq2nJbpwPesKrKtvV0aoqgXbPMp4HMtDqJeSZdv7GcPO6q kXoJgBo1JSZOBeOV+hfQjSNDUcoItsNZ/aWx9VT1z67QPjC9BZc6bIqDQGqPz8cqHsyV ZlvlQ+TBIUzgKlEp76ZwFW+Ufa7HdlC96aQuFbdS0aaMIpd5vlohlk+gYYZGFZQsrou7 ShHDbLfKRg8jDK5RWZusN30vzmMOf/QdWXyNdSfQdn6r/AxeRmhRpP6G/jN2mAsU8OY5 4tpQ4YecCHzOD2zocfMc/CvZceHJlg7UKYlgKxIFhgofwFTQdVGL4rV5WmeApKSmyAtA 1wvQ== 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=M7eG2O/zFnxFb6WMG/p+2HMh3XiHdhkTPRIlsCUFpaI=; b=z/8npzBe5OWr87wqkJ1c3DxWQ7tp9mxsAViDIlBeoh/5Tr92FroHpsJ2IN0yA0I4t1 h73cjkrhZrU9MZCZSU5aKUQChdD/2+EqW8Qcf7br+kU38r2gTethUQOx4dcPymyjSY4n 2qeTzzUOB5H5vSIfMDZTW0bOUqrfZCDRaRxSTqs7Qb0fWtK5hSyzox5gnL02bfFvxyrm VFbbxdTPHKC/FwLHvrr2KiqirGudNhcefpPzbeAoFNeOz35q/fkErrnGQmcayLRaUE6z QYRM3Zvy45J+giaAT6Befc8rqFDZQa5AlUEPzHj10BkekOxiNlYBg9FsnBTt0Prm0YXI jUdg== 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 b15si13725723ioj.7.2021.08.02.14.48.29; Mon, 02 Aug 2021 14:48:41 -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 S231843AbhHBVrg (ORCPT + 99 others); Mon, 2 Aug 2021 17:47:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231814AbhHBVrf (ORCPT ); Mon, 2 Aug 2021 17:47:35 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2406C06175F for ; Mon, 2 Aug 2021 14:47:25 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 03A671F42CCA 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 7/7] syscalls/fanotify20: Test capture of multiple errors Date: Mon, 2 Aug 2021 17:46:45 -0400 Message-Id: <20210802214645.2633028-8-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 When multiple FS errors occur, only the first is stored. This testcase validates this behavior by issuing two different errors and making sure only the first is stored, while the second is simply accumulated in error_count. Signed-off-by: Gabriel Krisman Bertazi --- .../kernel/syscalls/fanotify/fanotify20.c | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/testcases/kernel/syscalls/fanotify/fanotify20.c b/testcases/kernel/syscalls/fanotify/fanotify20.c index 0c63e90edc3a..07040cb7fa7c 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify20.c +++ b/testcases/kernel/syscalls/fanotify/fanotify20.c @@ -106,6 +106,18 @@ static void tcase2_trigger_lookup(void) ret, TCASE2_BAD_DIR, errno, EUCLEAN); } +static void tcase3_trigger(void) +{ + trigger_fs_abort(); + tcase2_trigger_lookup(); +} + +static void tcase4_trigger(void) +{ + tcase2_trigger_lookup(); + trigger_fs_abort(); +} + static const struct test_case { char *name; int error; @@ -130,6 +142,19 @@ static const struct test_case { .error_count = 1, .error = 0, .inode = &tcase2_bad_ino, + }, + { + .name = "Multiple error submission", + .trigger_error = &tcase3_trigger, + .error_count = 2, + .error = EXT4_ERR_ESHUTDOWN, + }, + { + .name = "Multiple error submission 2", + .trigger_error = &tcase4_trigger, + .error_count = 2, + .error = 0, + .inode = &tcase2_bad_ino, } }; -- 2.32.0