<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>6011</bug_id>
          
          <creation_ts>2014-03-20 05:15:14 +0000</creation_ts>
          <short_desc>e2fsprogs: return error when failed to populate fs</short_desc>
          <delta_ts>2014-09-04 07:07:36 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>1.6</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.6 M5</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Yang">liezhi.yang</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>andrax.g.necula</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
          
          <qa_contact name="Andra Necula">andrax.g.necula</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>41482</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2014-03-20 05:15:14 +0000</bug_when>
    <thetext>We need return retval when &quot;mke2fs -d&quot; failed, otherwise the &quot;$?&quot; would
be 0 which is misleading.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>41593</commentid>
    <comment_count>1</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2014-03-24 01:25:46 +0000</bug_when>
    <thetext>Merged into master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=21a3ffb2dc305ab236a006e812007e6c8f665a0e</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45384</commentid>
    <comment_count>2</comment_count>
    <who name="Andra Necula">andrax.g.necula</who>
    <bug_when>2014-09-04 07:07:36 +0000</bug_when>
    <thetext>Hello,

We just made some tests related to this issue. Our way of testing was like this:
-	inserted an USB device (/dev/sdb) having a partition /dev/sdb1
-	created an empty directory (eg. teste)
-	ran against a non existent dir the command “mke2fs –d invalid_dir  /dev/sdb1” and obtained the desired result as on bug fix:
“
root@emenlow:/media/test/stick/teste# mke2fs -d invalid_dir /dev/sdb1  # invalid_dir is a non existent dir
...
Allocating group tables: done                           
Writing inode tables: done                           
Copying files into the device: populate_fs: No such file or directory while changing working directory to &quot;invalid_dir&quot;

Error while populating file system
root@emenlow:/media/test/stick/teste# echo $?
      2
“

However while performing our checks,  I observed something that I don’t know if it’s right or wrong:
-	even if the directory is empty, the process of creating root fs is starting and completing without error (and exit code is 0):

root@emenlow:/media/test/stick/teste# mke2fs -d . /dev/sdb1
...
root@emenlow:/media/test/stick/teste# echo $?
0
“

-	both in the case of empty dir and in case of non existing dir  the job of writing inode tables starts and completes successfully. This of course 
erases the content of inserted media. Shouldn’t be a check of content before?


Meanwhile I will mark this bug as verified.

Regards,
Andra N.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>