Hi,

    When I used tst_mkfs() to build a file system with extra mkfs
options, like that:
    tst_mkfs(NULL, device, "ext4", "-b 1024"); /* device is /dev/loop0 */
 
    It will output this error message:
    TINFO  :  Formatting /dev/loop0 with ext4 extra opts='-b 1024'
    mke2fs 1.42.7 (21-Jan-2013)
    mkfs.ext4: invalid blocks '/dev/loop0' on device 'ext4'

I look through tst_mkfs()'s implementations,
    the call chain is: tst_mkfs =>  tst_run_cmd => tst_run_cmd_fds
=>  _exit(execvp(argv[0], (char *const *)argv));

   in this case argv will be like that:
   char *argv[] = {"mkfs", "-t", "ext4", "-b 1024", "/dev/loop0", NULL},
then we finally call mkfs like that:
   mkfs -t ext4 "-b 1024" /dev/loop0  # this may make command mkfs parse
                                                           # arguments failed.

Indeed the right command should be:  mkfs -t ext4 -b 1024 /dev/loop0.

So I think there are some problems here, if we want to pass extra fs options.
Would you please review this? If so, I can send a patch to fix this.

Thanks,
Xiaoguang Wang


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to