common/rc: fix mount options quoting in _mount
PATCH 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.
--- common/rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
common/rc +2 -2
@@ -296,10 +296,10 @@ _has_dmesg_since_option() _mount() { - $MOUNT_PROG $* + $MOUNT_PROG "$@" ret=$? if [ "$ret" -ne 0 ]; then - echo "\"$MOUNT_PROG $*\" failed at $(date)" >> "$seqres.mountfail?" + echo "\"$MOUNT_PROG $@\" failed at $(date)" >> "$seqres.mountfail?" if _has_dmesg_since_option; then dmesg --since '30s ago' >> "$seqres.mountfail?" else
Signature · 1 line
2.51.0
Quoted 21 lines · On Mon, Jun 29, 2026 at 09:29:35PM +0800, [email protected] wrote:
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_mounthelper 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 testsoverlay/083andoverlay/086), causing the mount to fail with "mount: bad usage".
Fix this regression by using"$@"in the_mounthelper, which correctly preserves argument boundaries exactly as they were provided by the caller.--- common/rc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)common/rc +0
-0
common/rc _has_dmesg_since_option() · line 299
Quoted 5 lines
common/rc +1
-1@@ -296,10 +296,10 @@ _has_dmesg_since_option() _mount() { - $MOUNT_PROG $* + $MOUNT_PROG "$@"
Yes, "$@" is how you're supposed to convey the current list of arguments to a subprogram as a list, without alteration...
common/rc _has_dmesg_since_option() · line 302
Quoted 4 lines
common/rc +1
-1ret=$? if [ "$ret" -ne 0 ]; then - echo "\"$MOUNT_PROG $*\" failed at $(date)" >> "$seqres.mountfail?" + echo "\"$MOUNT_PROG $@\" failed at $(date)" >> "$seqres.mountfail?"
...but when embedding those arguments in a string, $* is the correct usage.
--D
Quoted 7 lines
common/rc +0
-0if _has_dmesg_since_option; then dmesg --since '30s ago' >> "$seqres.mountfail?" elseSignature · 1 line
2.51.0
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.
---
v2: Revert the error log to "$*"
common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/rc +1 -1
@@ -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
Quoted 13 lines · On Wed, Jul 01, 2026 at 02:14:07PM +0800, [email protected] wrote:
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_mounthelper 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 testsoverlay/083andoverlay/086), causing the mount to fail with "mount: bad usage".
Fix this regression by using"$@"in the_mounthelper, which correctly preserves argument boundaries exactly as they were provided by the caller.
Quoted 3 lines
Signed-off-by An Long <[email protected]>---
v2: Revert the error log to "$*"
Very good!
--D
Quoted 20 lines
common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/rc +1
-1@@ -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
Quoted 4 lines · Long An
Hi Darrick,
Thank you for your comments last month. Just following up on this patch. Is there anything else needed from my side?
Please talk to Zorro about that, he's the fstests maintainer.
--D
Quoted 51 lines
Thanks,
AnQuoted 46 lines · Darrick J. Wong
Quoted 12 lines · On Wed, Jul 01, 2026 at 02:14:07PM +0800, [email protected] wrote:
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_mounthelper 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 testsoverlay/083andoverlay/086), causing the mount to fail with "mount: bad usage".
Fix this regression by using"$@"in the_mounthelper, which correctly preserves argument boundaries exactly as they were provided by thecaller.
Quoted 4 lines
Signed-off-by An Long <[email protected]>---
v2: Revert the error log to "$*"Very good!
Reviewed-by "Darrick J. Wong" <[email protected]>--D
Quoted 8 lines
common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/rc +0
-0common/rc _has_dmesg_since_option() · line 302
Quoted 8 lines
common/rc +1
-1@@ -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?"
Quoted 4 lines
--
2.51.0
Hello Zorro,
Friendly ping on this patch.
Any feedback would be appreciated.
Thanks,
An
Quoted 62 lines · Darrick J. Wong
Quoted 4 lines · Long An
Hi Darrick,
Thank you for your comments last month. Just following up on this patch. Is there anything else needed from my side?
Please talk to Zorro about that, he's the fstests maintainer.
--D
Quoted 51 lines
Thanks,
AnQuoted 46 lines · Darrick J. Wong
Quoted 12 lines · On Wed, Jul 01, 2026 at 02:14:07PM +0800, [email protected] wrote:
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_mounthelper 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 testsoverlay/083andoverlay/086), causing the mount to fail with "mount: bad usage".
Fix this regression by using"$@"in the_mounthelper, which correctly preserves argument boundaries exactly as they were provided by thecaller.
Quoted 4 lines
Signed-off-by An Long <[email protected]>---
v2: Revert the error log to "$*"Very good!
Reviewed-by "Darrick J. Wong" <[email protected]>--D
Quoted 8 lines
common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/rc +0
-0common/rc _has_dmesg_since_option() · line 302
Quoted 8 lines
common/rc +1
-1@@ -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?"
Quoted 4 lines
--
2.51.0
Quoted 4 lines · Long An
Hello Zorro,
Friendly ping on this patch.
Any feedback would be appreciated.
This patch has been merged in fstests v2026.07.21, as:
b2e97cf3 common/rc: fix mount options quoting in _mount
Thanks,
Zorro
Quoted 68 lines
Thanks,
AnQuoted 62 lines · Darrick J. Wong
Quoted 4 lines · Long An
Hi Darrick,
Thank you for your comments last month. Just following up on this patch. Is there anything else needed from my side?
Please talk to Zorro about that, he's the fstests maintainer.
--D
Quoted 51 lines
Thanks,
AnQuoted 46 lines · Darrick J. Wong
Quoted 12 lines · On Wed, Jul 01, 2026 at 02:14:07PM +0800, [email protected] wrote:
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_mounthelper 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 testsoverlay/083andoverlay/086), causing the mount to fail with "mount: bad usage".
Fix this regression by using"$@"in the_mounthelper, which correctly preserves argument boundaries exactly as they were provided by thecaller.
Quoted 4 lines
Signed-off-by An Long <[email protected]>---
v2: Revert the error log to "$*"Very good!
Reviewed-by "Darrick J. Wong" <[email protected]>--D
Quoted 8 lines
common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/rc +0
-0common/rc _has_dmesg_since_option() · line 302
Quoted 8 lines
common/rc +1
-1@@ -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?"
Quoted 4 lines
--
2.51.0