public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* Re: [LTP] lib/tst_mkfs.c:  problem about tst_mkfs()
       [not found] <52DCE226.4030500@cn.fujitsu.com>
@ 2014-01-20  8:52 ` Wanlong Gao
  0 siblings, 0 replies; only message in thread
From: Wanlong Gao @ 2014-01-20  8:52 UTC (permalink / raw)
  To: Wang Xiaoguang; +Cc: LTP

On 01/20/2014 04:45 PM, Wang Xiaoguang wrote:
> 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.

Should be fixed, please send a patch.

Thanks,
Wanlong Gao

> 
> 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
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 


------------------------------------------------------------------------------
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
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-01-20  9:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <52DCE226.4030500@cn.fujitsu.com>
2014-01-20  8:52 ` [LTP] lib/tst_mkfs.c: problem about tst_mkfs() Wanlong Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox