Skip to contentSkip to conversation

generic: test mount move semantics

PATCH New Zorro Lang 1 participant 1 message Nov 30, 2019 VFS

lore
Share & tools
lore

Zorro Lang

author
#0 lore raw

PATCH 1/1 generic: test mount move semantics

This's a functional test case for mount --move operation, it verifies below semantics:

---------------------------------------------------------------------------

  |         MOVE MOUNT OPERATION                                            |
  |**************************************************************************
  |source(A)->| shared       |       private  |       slave    | unbindable |
  | dest(B)  |               |                |                |            |
  |   |      |               |                |                |            |
  |   v      |               |                |                |            |
  |**************************************************************************
  |  shared  | shared        |     shared     | shared & slave |  invalid   |
  |          |               |                |                |            |
  |non-shared| shared        |      private   |      slave     | unbindable |

***************************************************************************
NOTE: moving a mount residing under a shared mount is invalid.

This case uses fsstress to produce a little random load, to make sure basic operations won't break the the moved mountpoints.

---

Hi,

It's been long time (maybe 2 years) since I finished this test case. Those cases before this one have been merged:

8a02ca3b generic: test two vfsmount no peers
101cb277 generic: test mount shared subtrees state transition 71691c26 generic: test bind mount operations
74a84259 common/rc: new functions for multi-level mount/umount operations

I thought this 'mount --move' test wasn't so necessary, so I left it in my local repo long time. But now upstream fsdevel is developing new mount API, I think this case will be helpful for that (if mount util supports new mount API later). So I change it a little then send out again.

Thanks,
Zorro

 common/rc             |   6 +
 tests/generic/586     | 182 ++++++++++++++++++++
 tests/generic/586.out | 374 ++++++++++++++++++++++++++++++++++++++++++
 tests/generic/group   |   1 +
 4 files changed, 563 insertions(+)
 create mode 100755 tests/generic/586
 create mode 100644 tests/generic/586.out
common/rc +6 -0
index b988e912..936cc5c5 100644
@@ -189,6 +189,12 @@ _get_mount()
 
 	_mount $scratch_opts $*
 	if [ $? -eq 0 ]; then
+		# mount --move operation updates the mountpoint, so remove
+		# the old one and insert the new one
+		if [[ "$*" =~ --move|-M ]]; then
+			MOUNTED_POINT_STACK=`echo $MOUNTED_POINT_STACK | \
+						cut -d\  -f2-`
+		fi
 		MOUNTED_POINT_STACK="$mnt_point $MOUNTED_POINT_STACK"
 	else
 		return 1
tests/generic/586 new file +182 -0

182 lines not on this page · raw message

tests/generic/586.out new file +374 -0

374 lines not on this page · raw message

tests/generic/group +1 -0
index e5d0c1da..7ceddfcd 100644
@@ -588,3 +588,4 @@
 583 auto quick encrypt
 584 auto quick encrypt
 585 auto rename
+586 auto quick mount
Signature · 1 line
2.20.1