Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp1949302pxy; Mon, 2 Aug 2021 14:48:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwm5C0IoTIr0LiL77d+pYM7KkcjEL8ZO54SQg8GrHZ4vG7VLokrmyLiJZIZvWPxwL3cQtQ0 X-Received: by 2002:a92:6503:: with SMTP id z3mr467914ilb.258.1627940921595; 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=lWxMt4enn5HIAz7nXV8G0PulPf5d6gqJ/gLb62+wWa3xoAiI5pH3hoasPC9GiNq05N NBCOC/ltpyOkfKnkHivojsd/L4Ayc/hW7XuFCgVjzwuP8UAvnYU6N/odUlYE+MNmhYq7 C303tqGDNxoIocsTDOtreS8bpSTrAHHYh/HzEAz/57mutP/6XJVUuzrsnJQ+zFMZoL/+ hnsKpaFkwB11PdVVMs8pCQQYrxjFIssDsHxtfwakcsIk5Ma6hk4KV0wkTdiMwF4sIFQ1 hnDnLmuoOb0l6TU2uuhyFMJuoBpA1b5lx4fO2FXOgfaWGtHHUHH8Vb6/IAMNPbWgFbXW qvvw== 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=vuKqTisoAzPhmCTcwMHe3ZiUaEMp1sBXwDWNWFZRcrg=; b=CdaMrE8ipl8+jrOPMee5hw3no+TCIpHP7e5vwYnMhApaD5tcuYd9EmHaLUwE1Ngf3C 7vJxQLnMz9bn5PHSppquZuGe8U/XSgFo+CsioPu10JS9s1K9pghJHdVQU3qj8o67i2D3 DP+JdDG3992u9oU8laFzvW1lhVzcPOaeeR+dIyF4cYl9Ah6+tSwbLvfgJuwMK4ioSh+/ 1usO9K4f4b2Iwxl48dZ2pQkRDGMyzdPMUCrCQm2xpxB+6MB4G+YpRhLYOmaHq4iIYSTM aHaJpA77sVFVms0UjvwiZH/zQcfwfA3o+N7BJSbaJTl09LvlQ5bFph7m+e1UWatUET+Y XdhA== 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 v66si6440505iof.105.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 S231397AbhHBVr1 (ORCPT + 99 others); Mon, 2 Aug 2021 17:47:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229567AbhHBVr1 (ORCPT ); Mon, 2 Aug 2021 17:47:27 -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 AAA0EC06175F for ; Mon, 2 Aug 2021 14:47:17 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id 50E791F42CCA 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 5/7] syscalls/fanotify20: Support submission of debugfs commands Date: Mon, 2 Aug 2021 17:46:43 -0400 Message-Id: <20210802214645.2633028-6-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 In order to test FAN_FS_ERROR, we want to corrupt the filesystem. The easiest way to do it is by using debugfs. Add a small helper to issue debugfs requests. Since most likely this will be the only testcase to need this, don't bother making it a proper helper for now. Signed-off-by: Gabriel Krisman Bertazi --- testcases/kernel/syscalls/fanotify/fanotify20.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/testcases/kernel/syscalls/fanotify/fanotify20.c b/testcases/kernel/syscalls/fanotify/fanotify20.c index 7a9601072139..e7ced28eb61d 100644 --- a/testcases/kernel/syscalls/fanotify/fanotify20.c +++ b/testcases/kernel/syscalls/fanotify/fanotify20.c @@ -63,6 +63,13 @@ int fd_notify; #define EXT4_ERR_ESHUTDOWN 16 +static void do_debugfs_request(const char *dev, char *request) +{ + char *cmd[] = {"debugfs", "-w", dev, "-R", request, NULL}; + + SAFE_CMD(cmd, NULL, NULL); +} + static void trigger_fs_abort(void) { SAFE_MOUNT(tst_device->dev, MOUNT_PATH, tst_device->fs_type, -- 2.32.0