Skip to contentSkip to conversation

common/rc: fix mount options quoting in _mount

PATCH New [email protected] 1 participant 1 message Jul 1

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 common/rc: fix mount options quoting in _mount

From: An Long <[email protected]>

In commit 078f320 ("treewide: convert all $MOUNT_PROG to _mount"), direct calls to $MOUNT_PROG were converted to call the helper function _mount.
However, the _mount helper was implemented using $* instead of "$@". This unquoted argument expansion triggers word splitting on any arguments containing spaces (such as the overlay mount options containing spaces in tests overlay/083 and overlay/086), causing the mount to fail with "mount: bad usage".
Fix this regression by using "$@" in the _mount helper, which correctly preserves argument boundaries exactly as they were provided by the caller.

---
V1 -> V2: Revert the error log to "$*"

v1: https://lore.kernel.org/fstests/20260629155812.GW6070@frogsfrogsfrogs/T/#t

 common/rc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
index 79189e7e..b9a07324 100644
@@ -296,7 +296,7 @@ _has_dmesg_since_option()
 
 _mount()
 {
-	$MOUNT_PROG $*
+	$MOUNT_PROG "$@"
 	ret=$?
 	if [ "$ret" -ne 0 ]; then
 		echo "\"$MOUNT_PROG $*\" failed at $(date)" >> "$seqres.mountfail?"
Signature · 1 line
2.51.0