Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp511279pxb; Fri, 29 Oct 2021 14:20:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAO+CUg6edi2mFTTIDpGpy2R2q5n9VOzRm/b0h25jZrqeop1r+bqDA78J/tOXK7cTkWaDm X-Received: by 2002:a17:907:6e29:: with SMTP id sd41mr16317205ejc.438.1635542429172; Fri, 29 Oct 2021 14:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635542429; cv=none; d=google.com; s=arc-20160816; b=x21zNUe6YwdwJJVoZFfzZT1vDO3T43ojsRmg4twHTuIgVb+mKh+b53IeRPAaqipUAW SUMbN8TqqgHKrDOENUBhM53xYBOCvjhvXudFKCO3BUHd10uTnrLvNbn2qefIrSlQ1HMI jxN3trVzwu6hIqAq88EaVqr3ExKWjtwIt7lvlQTsxJB++ncthVWr66XRwc3rN6zz/sjG 2v4nLr0HPWAc7D51pKsTN/NxP4aqNftfoK3HZuI7B8hcBAU9WUiAmYPZHN8AUTOAKjeJ k3Zb0HbE9EBT23G3j1R1OCgMSh40WVKQ8dF1vGyhelLGbHeg7NMVzfamIahAIk48WQKO p2Mg== 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=vn4qorXcz3+ApwbOqNlBcAD5YPZaqz8558kZRY6UB6I=; b=a4l2g8FFV+pRu1X0Qr6GQTfz6kQcwZeGywaIbjXz/PXtEVrUXEebpnqt+IUnzwzaq8 NYtZfOiAz66V6HMwFMIAyD7HMJQaM0+Dja9e+FGFISR/lng42l9lNqj5DxTV+OjTrOc6 eoSgTcpJ63D2jQdBepqEaWWhp44Yyj69eBG6QhfiF2nrM/e1i+JwkNAvXh0v3uotLWo2 nlxu0N+9UwTy+Z5NHLBQnURujnsfLeVrN10nvy6KZ8IpLI8A52GUYARTshBl4vqDitkK HdGSWy9KblF3wxmKtF407G4y1WgKGpk/mkAkKfDjSlsjk7gAhcP1S5DNQEXjtCKo/HEi UX7g== 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 g19si9520519ejz.358.2021.10.29.14.20.06; Fri, 29 Oct 2021 14:20:29 -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 S231463AbhJ2VVf (ORCPT + 99 others); Fri, 29 Oct 2021 17:21:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231546AbhJ2VVZ (ORCPT ); Fri, 29 Oct 2021 17:21:25 -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 49051C061570 for ; Fri, 29 Oct 2021 14:18:55 -0700 (PDT) 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 67D011F45C6F; Fri, 29 Oct 2021 22:18:46 +0100 (BST) From: Gabriel Krisman Bertazi To: jack@suse.com, amir73il@gmail.com, repnop@google.com Cc: ltp@lists.linux.it, khazhy@google.com, kernel@collabora.com, linux-ext4@vger.kernel.org, Gabriel Krisman Bertazi Subject: [PATCH v3 9/9] syscalls/fanotify21: Test capture of multiple errors Date: Fri, 29 Oct 2021 18:17:32 -0300 Message-Id: <20211029211732.386127-10-krisman@collabora.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211029211732.386127-1-krisman@collabora.com> References: <20211029211732.386127-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. Reviewed-by: Amir Goldstein Signed-off-by: Gabriel Krisman Bertazi --- .../kernel/syscalls/fanotify/fanotify21.c | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/testcases/kernel/syscalls/fanotify/fanotify21.c b/testcases/kernel/syscalls/fanotify/fanotify21.c index e463365dd69d..7f0154da5eeb 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify21.c +++ b/testcases/kernel/syscalls/fanotify/fanotify21.c @@ -74,6 +74,18 @@ static void tcase2_trigger_lookup(void) ret, 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 struct test_case { char *name; int error; @@ -95,6 +107,20 @@ static struct test_case { .error = EFSCORRUPTED, .fid = &bad_file_fid, }, + { + .name = "Multiple error submission", + .trigger_error = &tcase3_trigger, + .error_count = 2, + .error = ESHUTDOWN, + .fid = &null_fid, + }, + { + .name = "Multiple error submission 2", + .trigger_error = &tcase4_trigger, + .error_count = 2, + .error = EFSCORRUPTED, + .fid = &bad_file_fid, + } }; int check_error_event_info_fid(struct fanotify_event_info_fid *fid, -- 2.33.0