]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs_scrub_all: fix broken command line string array construction
authorDarrick J. Wong <djwong@kernel.org>
Thu, 4 Jun 2026 06:04:52 +0000 (23:04 -0700)
committerAndrey Albershteyn <aalbersh@kernel.org>
Thu, 11 Jun 2026 10:26:04 +0000 (12:26 +0200)
In scrub_subprocess::__init__(), we construct cmd as an array of strings
to be passed (eventually) to exec.  Unfortunately, adding a string to an
array of strings doesn't do what you'd think in Python:

>>> x = ['moo', 'cow']
>>> x += '-x'
>>> x
['moo', 'cow', '-', 'x']

Fix this problem, which Codex has sharp enough eyes to catch.

Cc: linux-xfs@vger.kernel.org # v6.10.0
Fixes: a290edcfa0a391 ("xfs_scrub_all: encapsulate all the subprocess code in an object")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@kernel.org>
scrub/xfs_scrub_all.py.in

index 3f618587de8b253e047431a3b80f2471bb18173f..9afb7993abc06eec6aaa6bd855c8e8fdea529687 100644 (file)
@@ -100,7 +100,7 @@ class scrub_subprocess(scrub_control):
                else:
                        cmd += '@scrub_args@'.split()
                if scrub_media:
-                       cmd += '-x'
+                       cmd += ['-x']
                cmd += [mnt]
                self.cmdline = cmd
                self.proc = None