diff options
author | Darrick J. Wong <djwong@kernel.org> | 2024-01-11 18:07:06 -0800 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2024-01-11 18:08:47 -0800 |
commit | 27df677a7b31c51c4595d2ae9078927b790d94b9 (patch) | |
tree | 7a931a185d77399d083262f6d652b9bb4eab0c9e | |
parent | 3d37d8bf535fd6a8ab241a86433b449152746e6a (diff) | |
download | xfsprogs-dev-27df677a7b31c51c4595d2ae9078927b790d94b9.tar.gz |
xfs_scrub_all: fix argument passing when invoking xfs_scrub manually
Currently, xfs_scrub_all will try to invoke xfs_scrub with argv[1] being
"-n -x". This of course is recognized by C getopt as a weird looking
string, not two individual arguments, and causes the child process to
exit with complaints about CLI usage.
What we really want is to split the string into a proper array and then
add them to the xfs_scrub command line. The code here isn't strictly
correct, but as @scrub_args@ is controlled by us in the Makefile, it'll
do for now.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | scrub/xfs_scrub_all.in | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/scrub/xfs_scrub_all.in b/scrub/xfs_scrub_all.in index d7d36e1bdb..671d588177 100644 --- a/scrub/xfs_scrub_all.in +++ b/scrub/xfs_scrub_all.in @@ -123,7 +123,9 @@ def run_scrub(mnt, cond, running_devs, mntdevs, killfuncs): return # Invoke xfs_scrub manually - cmd=['@sbindir@/xfs_scrub', '@scrub_args@', mnt] + cmd = ['@sbindir@/xfs_scrub'] + cmd += '@scrub_args@'.split() + cmd += [mnt] ret = run_killable(cmd, None, killfuncs, \ lambda proc: proc.terminate()) if ret >= 0: |