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 <yi.zhang@redhat.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
+++ /dev/null
-#!/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"
-}
+++ /dev/null
-#!/bin/bash
-# SPDX-License-Identifier: GPL-3.0+
-# Copyright (C) 2018 Jeremy Cline <jeremy@jcline.org>
-#
-# 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"
-}