On Mon, Mar 30, 2020 at 03:02:32PM +0800, Qu Wenruo wrote: > [PROBLEM] > We want to inject $INSTRUMENT (mostly valgrind) before btrfs command but > after root_helper. > > Currently we won't inject $INSTRUMENT at all if we are using > root_helper. > This means the coverage is not good enough. > > [FIX] > This patch introduce a new function, expand_command(), to handle all > parameter/argument injection, including existing 'btrfs check' inject. > > This function will: > - Detect where to inject $INSTRUMENT > If we have root_helper and the command is target command > (btrfs/mkfs.btrfs/btrfs-convert), then we inject $INSTRUMENT after > root_helper. > If we don't have root_helper, and the command is target command, > we inject $INSTRUMENT before the command. > Or we don't inject $INSTRUMENT (it's not the target command). > > - Use existing spec facility to inject extra arguments > > - Use an array to restore to result > To avoid bash interpret the IFS inside path/commands. > > Now we can make sure no matter if we use root_helper, $INSTRUMENT is > always injected corrected. > > Signed-off-by: Qu Wenruo <wqu@xxxxxxxx> I don't know why, but with this patch (without my fixups) the misc tests get stuck at 004-shrink-fs. Per 'ps' output it's inside the test.sh script so not waiting for sync or such. I need to do the releease so will skip this patch as it's not critical.
