* [PATCH] common/rc: fix mount options quoting in _mount
@ 2026-06-29 13:29 lan
2026-06-29 15:58 ` Darrick J. Wong
0 siblings, 1 reply; 7+ messages in thread
From: lan @ 2026-06-29 13:29 UTC (permalink / raw)
To: fstests; +Cc: An Long
From: An Long <lan@suse.com>
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(-)
diff --git a/common/rc b/common/rc
index 79189e7e..56dbea6f 100644
--- a/common/rc
+++ b/common/rc
@@ -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
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] common/rc: fix mount options quoting in _mount 2026-06-29 13:29 [PATCH] common/rc: fix mount options quoting in _mount lan @ 2026-06-29 15:58 ` Darrick J. Wong 2026-07-01 6:14 ` [PATCH v2] " lan 0 siblings, 1 reply; 7+ messages in thread From: Darrick J. Wong @ 2026-06-29 15:58 UTC (permalink / raw) To: lan; +Cc: fstests On Mon, Jun 29, 2026 at 09:29:35PM +0800, lan@suse.com wrote: > From: An Long <lan@suse.com> > > 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(-) > > diff --git a/common/rc b/common/rc > index 79189e7e..56dbea6f 100644 > --- a/common/rc > +++ b/common/rc > @@ -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... > ret=$? > 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 > if _has_dmesg_since_option; then > dmesg --since '30s ago' >> "$seqres.mountfail?" > else > -- > 2.51.0 > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] common/rc: fix mount options quoting in _mount 2026-06-29 15:58 ` Darrick J. Wong @ 2026-07-01 6:14 ` lan 2026-07-01 16:34 ` Darrick J. Wong 0 siblings, 1 reply; 7+ messages in thread From: lan @ 2026-07-01 6:14 UTC (permalink / raw) To: djwong, fstests; +Cc: An Long From: An Long <lan@suse.com> 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. Signed-off-by: An Long <lan@suse.com> --- v2: Revert the error log to "$*" common/rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/rc b/common/rc index 79189e7e..b9a07324 100644 --- a/common/rc +++ b/common/rc @@ -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?" -- 2.51.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2] common/rc: fix mount options quoting in _mount 2026-07-01 6:14 ` [PATCH v2] " lan @ 2026-07-01 16:34 ` Darrick J. Wong [not found] ` <CAHLNDm3bTGowGmp46GMbpJz8_Eew+sGsH173D0PnnFKt=fWB_A@mail.gmail.com> 0 siblings, 1 reply; 7+ messages in thread From: Darrick J. Wong @ 2026-07-01 16:34 UTC (permalink / raw) To: lan; +Cc: fstests On Wed, Jul 01, 2026 at 02:14:07PM +0800, lan@suse.com wrote: > From: An Long <lan@suse.com> > > 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. > > Signed-off-by: An Long <lan@suse.com> > --- > v2: Revert the error log to "$*" Very good! Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> --D > common/rc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/common/rc b/common/rc > index 79189e7e..b9a07324 100644 > --- a/common/rc > +++ b/common/rc > @@ -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?" > -- > 2.51.0 > > ^ permalink raw reply [flat|nested] 7+ messages in thread
[parent not found: <CAHLNDm3bTGowGmp46GMbpJz8_Eew+sGsH173D0PnnFKt=fWB_A@mail.gmail.com>]
* Re: [PATCH v2] common/rc: fix mount options quoting in _mount [not found] ` <CAHLNDm3bTGowGmp46GMbpJz8_Eew+sGsH173D0PnnFKt=fWB_A@mail.gmail.com> @ 2026-08-13 19:27 ` Darrick J. Wong 2026-08-14 9:32 ` Long An 0 siblings, 1 reply; 7+ messages in thread From: Darrick J. Wong @ 2026-08-13 19:27 UTC (permalink / raw) To: Long An; +Cc: fstests On Fri, Aug 14, 2026 at 12:32:43AM +0800, Long An wrote: > 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 > Thanks, > An > > On Thu, Jul 2, 2026 at 12:34 AM Darrick J. Wong <djwong@kernel.org> wrote: > > > On Wed, Jul 01, 2026 at 02:14:07PM +0800, lan@suse.com wrote: > > > From: An Long <lan@suse.com> > > > > > > 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. > > > > > > Signed-off-by: An Long <lan@suse.com> > > > --- > > > v2: Revert the error log to "$*" > > > > Very good! > > Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> > > > > --D > > > > > common/rc | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/common/rc b/common/rc > > > index 79189e7e..b9a07324 100644 > > > --- a/common/rc > > > +++ b/common/rc > > > @@ -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?" > > > -- > > > 2.51.0 > > > > > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] common/rc: fix mount options quoting in _mount 2026-08-13 19:27 ` Darrick J. Wong @ 2026-08-14 9:32 ` Long An 2026-08-17 7:21 ` Zorro Lang 0 siblings, 1 reply; 7+ messages in thread From: Long An @ 2026-08-14 9:32 UTC (permalink / raw) To: zlang; +Cc: fstests, Darrick J. Wong Hello Zorro, Friendly ping on this patch. Any feedback would be appreciated. Thanks, An On Fri, Aug 14, 2026 at 3:27 AM Darrick J. Wong <djwong@kernel.org> wrote: > > On Fri, Aug 14, 2026 at 12:32:43AM +0800, Long An wrote: > > 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 > > > Thanks, > > An > > > > On Thu, Jul 2, 2026 at 12:34 AM Darrick J. Wong <djwong@kernel.org> wrote: > > > > > On Wed, Jul 01, 2026 at 02:14:07PM +0800, lan@suse.com wrote: > > > > From: An Long <lan@suse.com> > > > > > > > > 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. > > > > > > > > Signed-off-by: An Long <lan@suse.com> > > > > --- > > > > v2: Revert the error log to "$*" > > > > > > Very good! > > > Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> > > > > > > --D > > > > > > > common/rc | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/common/rc b/common/rc > > > > index 79189e7e..b9a07324 100644 > > > > --- a/common/rc > > > > +++ b/common/rc > > > > @@ -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?" > > > > -- > > > > 2.51.0 > > > > > > > > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2] common/rc: fix mount options quoting in _mount 2026-08-14 9:32 ` Long An @ 2026-08-17 7:21 ` Zorro Lang 0 siblings, 0 replies; 7+ messages in thread From: Zorro Lang @ 2026-08-17 7:21 UTC (permalink / raw) To: Long An; +Cc: fstests, Darrick J. Wong On Fri, Aug 14, 2026 at 05:32:52PM +0800, Long An wrote: > 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 > > Thanks, > An > > > On Fri, Aug 14, 2026 at 3:27 AM Darrick J. Wong <djwong@kernel.org> wrote: > > > > On Fri, Aug 14, 2026 at 12:32:43AM +0800, Long An wrote: > > > 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 > > > > > Thanks, > > > An > > > > > > On Thu, Jul 2, 2026 at 12:34 AM Darrick J. Wong <djwong@kernel.org> wrote: > > > > > > > On Wed, Jul 01, 2026 at 02:14:07PM +0800, lan@suse.com wrote: > > > > > From: An Long <lan@suse.com> > > > > > > > > > > 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. > > > > > > > > > > Signed-off-by: An Long <lan@suse.com> > > > > > --- > > > > > v2: Revert the error log to "$*" > > > > > > > > Very good! > > > > Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> > > > > > > > > --D > > > > > > > > > common/rc | 2 +- > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > diff --git a/common/rc b/common/rc > > > > > index 79189e7e..b9a07324 100644 > > > > > --- a/common/rc > > > > > +++ b/common/rc > > > > > @@ -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?" > > > > > -- > > > > > 2.51.0 > > > > > > > > > > > > > > ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-08-17 7:21 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-29 13:29 [PATCH] common/rc: fix mount options quoting in _mount lan
2026-06-29 15:58 ` Darrick J. Wong
2026-07-01 6:14 ` [PATCH v2] " lan
2026-07-01 16:34 ` Darrick J. Wong
[not found] ` <CAHLNDm3bTGowGmp46GMbpJz8_Eew+sGsH173D0PnnFKt=fWB_A@mail.gmail.com>
2026-08-13 19:27 ` Darrick J. Wong
2026-08-14 9:32 ` Long An
2026-08-17 7:21 ` Zorro Lang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox