From 5e803ca0ae9962e4e4f86287077c4336fa70a664 Mon Sep 17 00:00:00 2001 From: Omar Sandoval Date: Tue, 4 Aug 2020 12:29:01 -0700 Subject: [PATCH] Remove partition rereading tests for reverted fixes The change that block/013 tested for was reverted in Linux kernel commit 10c70d95c0f2 ("block: remove the bd_openers checks in blk_drop_partitions"). To quote Christoph: "That check only catches file systems that use a single block device (e.g. not btrfs multi-device or XFS or ext4 with log devices) and also doesn't catch non-filesystem users. I first tried to generalized it, but that ran into a chain of other problems. And there really isn't much of a problem re-reading partitions on a mounted file system - it is pointless but not actually harmful." So, we shouldn't expect that check to come back. Let's remove the test. Similarly, the change that scsi/003 tested for was reverted in Linux kernel commit 8acf608e602f ("Revert "scsi: sd: Keep disk read-only when re-reading partition""). According to that commit, this can be fixed, so when that happens we can reintroduce the test. Reported-by: Yi Zhang Signed-off-by: Omar Sandoval --- tests/block/013 | 37 ------------------------------------- tests/scsi/003 | 29 ----------------------------- 2 files changed, 66 deletions(-) delete mode 100755 tests/block/013 delete mode 100755 tests/scsi/003 diff --git a/tests/block/013 b/tests/block/013 deleted file mode 100755 index 84e2ebb..0000000 --- a/tests/block/013 +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-3.0+ -# Copyright (c) 2017 FUJITSU LIMITED. All rights reserved. -# -# If the entire block device is formatted with a filesystem and mounted, -# running "blockdev --rereadpt" should fail and return EBUSY. On buggy kernel, -# it passes unexpectedly. -# -# Regression test for commit 77032ca66f86 ("Return EBUSY from BLKRRPART for -# mounted whole-dev fs"). - -. tests/block/rc - -DESCRIPTION="try BLKRRPART on a mounted device" -QUICK=1 - -requires() { - _have_program mkfs.ext3 -} - -test_device() { - echo "Running ${TEST_NAME}" - - mkfs.ext3 -q -F "$TEST_DEV" - mkdir "$TMPDIR/mntpoint" - mount "$TEST_DEV" "$TMPDIR/mntpoint" - - local out - out="$(blockdev --rereadpt "$TEST_DEV" 2>&1)" - if ! echo "$out" | grep -o "Device or resource busy"; then - echo "$out" - fi - - umount "$TMPDIR/mntpoint" - - echo "Test complete" -} diff --git a/tests/scsi/003 b/tests/scsi/003 deleted file mode 100755 index 134aa5c..0000000 --- a/tests/scsi/003 +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -# SPDX-License-Identifier: GPL-3.0+ -# Copyright (C) 2018 Jeremy Cline -# -# Regression test for commit 20bd1d026aac ("scsi: sd: Keep disk read-only when -# re-reading partition"). - -. tests/scsi/rc - -DESCRIPTION="ensure re-reading the partition table keeps its read-only flag" -QUICK=1 - -test_device() { - echo "Running ${TEST_NAME}" - - blockdev --setro "$TEST_DEV" - blockdev --getro "$TEST_DEV" - blockdev --rereadpt "$TEST_DEV" - blockdev --getro "$TEST_DEV" - dd if=/dev/zero of="$TEST_DEV" count=1024 |& grep -o "Operation not permitted" - - blockdev --setrw "$TEST_DEV" - blockdev --getro "$TEST_DEV" - blockdev --rereadpt "$TEST_DEV" - blockdev --getro "$TEST_DEV" - dd if=/dev/zero of="$TEST_DEV" count=1024 |& grep -o "Operation not permitted" - - echo "Test complete" -} -- 2.49.0