Linux block layer
 help / color / mirror / Atom feed
* [PATCH V2] blktests: add test to cover umount one deleted disk
@ 2023-02-08  1:02 Ming Lei
  2023-02-08  7:39 ` Shinichiro Kawasaki
  2023-02-08 10:34 ` kernel test robot
  0 siblings, 2 replies; 7+ messages in thread
From: Ming Lei @ 2023-02-08  1:02 UTC (permalink / raw)
  To: Shin'ichiro Kawasaki; +Cc: linux-block, Ming Lei

disk can be disappear any time because of error handling, when
it is usually being mounted. Make sure umount can be done successfully
after disk deleting is done from error handling.

Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
V2:
	- add 032.out

 tests/block/032     | 35 +++++++++++++++++++++++++++++++++++
 tests/block/032.out |  2 ++
 2 files changed, 37 insertions(+)
 create mode 100755 tests/block/032
 create mode 100644 tests/block/032.out

diff --git a/tests/block/032 b/tests/block/032
new file mode 100755
index 0000000..b07b7ab
--- /dev/null
+++ b/tests/block/032
@@ -0,0 +1,35 @@
+#!/bin/bash
+# SPDX-License-Identifier: GPL-3.0+
+# Copyright (C) 2023 Ming Lei
+#
+# Test umount after deleting disk. Removes a device while the disk
+# is still mounted.
+
+. tests/block/rc
+. common/xfs
+. common/scsi_debug
+
+DESCRIPTION="remove one mounted device"
+QUICK=1
+
+requires() {
+	_have_xfs && _have_scsi_debug
+}
+
+test() {
+	echo "Running ${TEST_NAME}"
+
+	if ! _init_scsi_debug dev_size_mb=300; then
+		return 1
+	fi
+
+	mkdir -p "${TMPDIR}/mnt"
+	_xfs_mkfs_and_mount "/dev/${SCSI_DEBUG_DEVICES[0]}" "${TMPDIR}/mnt" > /dev/null 2>&1
+	echo 1 > "/sys/block/${SCSI_DEBUG_DEVICES[0]}/device/delete"
+	sleep 2
+	umount "${TMPDIR}/mnt"
+
+	_exit_scsi_debug
+
+	echo "Test complete"
+}
diff --git a/tests/block/032.out b/tests/block/032.out
new file mode 100644
index 0000000..3604e9e
--- /dev/null
+++ b/tests/block/032.out
@@ -0,0 +1,2 @@
+Running block/032
+Test complete
-- 
2.38.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] blktests: add test to cover umount one deleted disk
  2023-02-08  1:02 [PATCH V2] blktests: add test to cover umount one deleted disk Ming Lei
@ 2023-02-08  7:39 ` Shinichiro Kawasaki
  2023-02-08  7:42   ` Ming Lei
  2023-02-08 10:34 ` kernel test robot
  1 sibling, 1 reply; 7+ messages in thread
From: Shinichiro Kawasaki @ 2023-02-08  7:39 UTC (permalink / raw)
  To: Ming Lei; +Cc: linux-block@vger.kernel.org

On Feb 08, 2023 / 09:02, Ming Lei wrote:
> disk can be disappear any time because of error handling, when
> it is usually being mounted. Make sure umount can be done successfully
> after disk deleting is done from error handling.

Thanks, this patch looks good to me. The commit title needs some edit to have
the prefix "block/032: ". I will do the edit when I apply the patch. I will
wait a few more days in case anyone has comments.

Just from my curiosity, did we have any failure that this test case catches?

-- 
Shin'ichiro Kawasaki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] blktests: add test to cover umount one deleted disk
  2023-02-08  7:39 ` Shinichiro Kawasaki
@ 2023-02-08  7:42   ` Ming Lei
  2023-02-08 11:43     ` Shinichiro Kawasaki
  0 siblings, 1 reply; 7+ messages in thread
From: Ming Lei @ 2023-02-08  7:42 UTC (permalink / raw)
  To: Shinichiro Kawasaki; +Cc: linux-block@vger.kernel.org

On Wed, Feb 08, 2023 at 07:39:11AM +0000, Shinichiro Kawasaki wrote:
> On Feb 08, 2023 / 09:02, Ming Lei wrote:
> > disk can be disappear any time because of error handling, when
> > it is usually being mounted. Make sure umount can be done successfully
> > after disk deleting is done from error handling.
> 
> Thanks, this patch looks good to me. The commit title needs some edit to have
> the prefix "block/032: ". I will do the edit when I apply the patch. I will
> wait a few more days in case anyone has comments.

OK, thanks!

> 
> Just from my curiosity, did we have any failure that this test case catches?

https://lore.kernel.org/linux-block/20230208063552.GA15030@lst.de/T/#u

Thanks,
Ming


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] blktests: add test to cover umount one deleted disk
  2023-02-08  1:02 [PATCH V2] blktests: add test to cover umount one deleted disk Ming Lei
  2023-02-08  7:39 ` Shinichiro Kawasaki
@ 2023-02-08 10:34 ` kernel test robot
  1 sibling, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-02-08 10:34 UTC (permalink / raw)
  To: Ming Lei, Shin'ichiro Kawasaki; +Cc: oe-kbuild-all, linux-block, Ming Lei

Hi Ming,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v6.2-rc7 next-20230208]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Ming-Lei/blktests-add-test-to-cover-umount-one-deleted-disk/20230208-090437
patch link:    https://lore.kernel.org/r/20230208010235.553252-1-ming.lei%40redhat.com
patch subject: [PATCH V2] blktests: add test to cover umount one deleted disk
reproduce:
        scripts/spdxcheck.py

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>

spdxcheck warnings: (new ones prefixed by >>)
>> tests/block/032: 2:27 Invalid License ID: GPL-3.0+

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] blktests: add test to cover umount one deleted disk
  2023-02-08  7:42   ` Ming Lei
@ 2023-02-08 11:43     ` Shinichiro Kawasaki
  2023-02-14  4:27       ` Shinichiro Kawasaki
  0 siblings, 1 reply; 7+ messages in thread
From: Shinichiro Kawasaki @ 2023-02-08 11:43 UTC (permalink / raw)
  To: Ming Lei; +Cc: linux-block@vger.kernel.org

On Feb 08, 2023 / 15:42, Ming Lei wrote:
> On Wed, Feb 08, 2023 at 07:39:11AM +0000, Shinichiro Kawasaki wrote:
[...]
> > Just from my curiosity, did we have any failure that this test case catches?
> 
> https://lore.kernel.org/linux-block/20230208063552.GA15030@lst.de/T/#u

Thanks, I will add this URL as a Link tag.

-- 
Shin'ichiro Kawasaki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] blktests: add test to cover umount one deleted disk
  2023-02-08 11:43     ` Shinichiro Kawasaki
@ 2023-02-14  4:27       ` Shinichiro Kawasaki
  2023-02-14  6:37         ` Chaitanya Kulkarni
  0 siblings, 1 reply; 7+ messages in thread
From: Shinichiro Kawasaki @ 2023-02-14  4:27 UTC (permalink / raw)
  To: Ming Lei; +Cc: linux-block@vger.kernel.org

I've applied the patch with some edits. Thanks!

-- 
Shin'ichiro Kawasaki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH V2] blktests: add test to cover umount one deleted disk
  2023-02-14  4:27       ` Shinichiro Kawasaki
@ 2023-02-14  6:37         ` Chaitanya Kulkarni
  0 siblings, 0 replies; 7+ messages in thread
From: Chaitanya Kulkarni @ 2023-02-14  6:37 UTC (permalink / raw)
  To: Shinichiro Kawasaki, Ming Lei; +Cc: linux-block@vger.kernel.org

On 2/13/23 20:27, Shinichiro Kawasaki wrote:
> I've applied the patch with some edits. Thanks!
> 

Looks good to me, if you can add it easily,

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-02-14  6:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-08  1:02 [PATCH V2] blktests: add test to cover umount one deleted disk Ming Lei
2023-02-08  7:39 ` Shinichiro Kawasaki
2023-02-08  7:42   ` Ming Lei
2023-02-08 11:43     ` Shinichiro Kawasaki
2023-02-14  4:27       ` Shinichiro Kawasaki
2023-02-14  6:37         ` Chaitanya Kulkarni
2023-02-08 10:34 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox