[PATCH v2 4/5] common/rc: add quirks for fuse-overlayfs device/mount point

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



On fuse-overlayfs the mount device is always reported as
a "fuse-overlayfs" string, instead of the parent directory
of the mount point (the string expected by overlay/scripts).

Unfortunately, it seems that the fuse mount option 'fsname'
doesn't set the filesystem source/device on fuse-overlayfs,
so the easy fix of just adding it to mount options is gone.

So two quirks are used to check for a fuse-overlayfs mount,
that checks the mount point/directory in _check_mounted_on()
and init_rc(); latter with the new helper _fs_type_dev_dir().

With this, fuse-overlayfs can now keep going through tests!

Signed-off-by: Mauricio Faria de Oliveira <mfo@xxxxxxxxxxxxx>
---
 README.overlay |  1 +
 common/rc      | 19 ++++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/README.overlay b/README.overlay
index 08a39b8830c9..7ef07ae6bbab 100644
--- a/README.overlay
+++ b/README.overlay
@@ -53,4 +53,5 @@ OVERLAY_FSCK_OPTIONS will be used to check both test and scratch overlay.
 
 To test other filesystem types (experimental) configure the OVL_FSTYP variable:
 
+ OVL_FSTYP=fuse.fuse-overlayfs
  OVL_FSTYP=aufs
diff --git a/common/rc b/common/rc
index 5711eca2a1d2..6a4cb9b6d604 100644
--- a/common/rc
+++ b/common/rc
@@ -1481,6 +1481,14 @@ _check_mounted_on()
 
 	# find $dev as the source, and print result in "$dev $mnt" format
 	local mount_rec=`findmnt -rncv -S $dev -o SOURCE,TARGET`
+
+	# fuse-overlayfs dev is not $dev, check via $mnt.
+	if [ -z "$mount_rec" -a "$FSTYP" = "overlay" -a \
+		"$OVL_FSTYP" = "fuse.fuse-overlayfs" ]; then
+		dev="fuse-overlayfs"
+		mount_rec=`findmnt -rncv -S $dev -T $mnt -o SOURCE,TARGET`
+	fi
+
 	[ -n "$mount_rec" ] || return 1 # 1 = not mounted
 
 	# if it's mounted, make sure its on $mnt
@@ -3788,8 +3796,17 @@ init_rc()
 	fi
 
 	# if $TEST_DEV is not mounted, mount it now as XFS
-	if [ -z "`_fs_type $TEST_DEV`" ]
+	if [ -n "`_fs_type $TEST_DEV`" ]
 	then
+		# $TEST_DEV is mounted
+		true
+	elif [ "$FSTYP" = "overlay" -a "$OVL_FSTYP" = "fuse.fuse-overlayfs" -a \
+		-n "`_fs_type_dev_dir fuse-overlayfs $TEST_DEV/$OVL_MNT`" ]
+	then
+		# (fuse-overlayfs dev is not $TEST_DEV; check via mount point)
+		# $TEST_DEV is mounted
+		true
+	else
 		# $TEST_DEV is not mounted
 		if ! _test_mount
 		then
-- 
2.20.1




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux