Re: [RFC v2 2/2] common: correct overlay+tmpfs cycle_mount

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



在 2022/5/9 23:17, Zorro Lang 写道:
On Sat, May 07, 2022 at 05:45:24PM +0800, Baokun Li wrote:
overlay+tmpfs cycle_mount should be like tmpfs cycle_mount,
otherwise some test cases may have issue like "xxx: No such file or directory".
If the 1st patch brings in an issue, then have to fix it in the 2nd patch,
I'd like to merge them into one completed patch. And these two patches are
not big, so it might be fine to do that and send again.

As Amir has given you some review points from overlayfs side, this part might
affect him more. So I'd like to wait a few days, if no reponse from him or
others, I'll give your patch my personal RVB, and merge it if test passed.

Thanks,
Zorro

I will send a patch V3 with the changes suggested by you. Thank you!

Signed-off-by: Baokun Li <libaokun1@xxxxxxxxxx>
---
  common/rc | 31 ++++++++++++++++++++++++-------
  1 file changed, 24 insertions(+), 7 deletions(-)

diff --git a/common/rc b/common/rc
index 553ae350..ca465438 100644
--- a/common/rc
+++ b/common/rc
@@ -410,10 +410,19 @@ _scratch_cycle_mount()
  {
      local opts="$1"
- if [ "$FSTYP" = tmpfs ]; then
-	_scratch_remount "$opts"
-	return
-    fi
+	case "$FSTYP" in
+	tmpfs)
+		_scratch_remount "$opts"
+		return
+		;;
+	overlay)
+		if [ "$OVL_BASE_FSTYP" = tmpfs ]; then
+			_scratch_remount "$opts"
+			return
+		fi
+		;;
+	esac
+
      if test -n "$opts"; then
  	opts="-o $opts"
      fi
@@ -522,9 +531,17 @@ _test_unmount()
_test_cycle_mount()
  {
-    if [ "$FSTYP" = tmpfs ]; then
-	return
-    fi
+	case "$FSTYP" in
+	tmpfs)
+		return
+		;;
+	overlay)
+		if [ "$OVL_BASE_FSTYP" = tmpfs ]; then
+			return
+		fi
+		;;
+	esac
+
      _test_unmount
      _test_mount
  }
--
2.31.1

.

--
With Best Regards,
Baokun Li




[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