<?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>8544</bug_id>
          
          <creation_ts>2015-10-20 04:35:15 +0000</creation_ts>
          <short_desc>mkfs.ext4: corrupt image for hardlinks</short_desc>
          <delta_ts>2015-10-29 15:29:01 +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>devtools / tool chain</component>
          <version>2.1</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>High</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>2.0</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Patrick Ohly">patrick.ohly</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>bogdanx.a.voiculescu</cc>
    
    <cc>liezhi.yang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>ross.burton</cc>
          
          <qa_contact name="Alexandru Georgescu">alexandru.c.georgescu</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>55467</commentid>
    <comment_count>0</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-20 04:35:15 +0000</bug_when>
    <thetext>When the rootfs contains hardlinks (example: /sbin/fsck.ext4 and its aliases), then a fsck.ext4 on the device fails, complaining for example about:

...
Oct 19 19:05:36 intel-corei7-64 systemd-fsck[672]: /dev/mmcblk0p2: Setting filetype for entry &apos;fsck.ext3&apos; in /sbin (20025) to 1.
Oct 19 19:05:36 intel-corei7-64 systemd-fsck[672]: /dev/mmcblk0p2: Setting filetype for entry &apos;fsck.ext2&apos; in /sbin (20025) to 1.
...
Oct 19 19:05:36 intel-corei7-64 systemd-fsck[672]: /dev/mmcblk0p2: Failed to optimize directory ??? (17): Corrupt extent header.
Oct 19 19:05:36 intel-corei7-64 systemd-fsck[672]: /dev/mmcblk0p2: ***** REBOOT LINUX *****
Oct 19 19:05:36 intel-corei7-64 systemd-fsck[672]: /dev/mmcblk0p2: 20655/368832 files (0.1% non-contiguous), 221840/....

More often than not, the rootfs partition is completely unusable afterwards.

This is based on a distro using OE-core 4038970f8ce27ac0d7a0afe2cdaa9a65108dfff5 (slighly older than current jethro branch). I&apos;ve not tried to reproduce it yet with genuine OE-core or poky, but I suspect it is affected the same way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55468</commentid>
    <comment_count>1</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-20 06:01:08 +0000</bug_when>
    <thetext>Here&apos;s an incomplete workaround for the problem which can be used in image recipes:

# A workaround for a deficiency in OE-core&apos;s mkfs.ext4:
# it does not handle hard links correctly, generating a
# filesystem that fsck.ext4 cannot fix and instead completely
# corrupts (https://bugzilla.yoctoproject.org/show_bug.cgi?id=8544)
#
# This affects only a handful of files (fsck.ext4/ext3/... and etc/terminfo/v/vt220)
# so instead of trying to be smart here and create symlinks, just create
# separate copies of all affected files.
ROOTFS_POSTPROCESS_COMMAND_append = &quot; avoid_hardlinks; &quot;
avoid_hardlinks () {
    find ${IMAGE_ROOTFS} -type f -links +1 | while read linked; do
        cp -a $linked $linked.tmp
        mv $linked.tmp $linked
    done
}

Unfortunately this is still incomplete. The image that I am testing with has extended attributes, and fsck.ext4 complains about one of those (&quot;Extended attribute in inode 20327 has a hash (468129694) which is invalid&quot;). The &quot;Failed to optimize directory ??? (17): Corrupt extent header.&quot; also still occurs. Furthermore, there are two problems with &quot;Free blocks count wrong&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55469</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-20 06:03:06 +0000</bug_when>
    <thetext>This problem occurs regularly when booting on MinnowMax with an image using systemd, because in that case the /etc/timestamp mechanism for updating the system time early in the boot process is missing and therefore fsck.ext4 always runs a full check because the time stamp on the superblock is in the future.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55473</commentid>
    <comment_count>3</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-20 08:22:54 +0000</bug_when>
    <thetext>One additional discovery: it only happens when these hardlinks also have xattrs, security.ima in our case.

The layer adding these xattrs is meta-security-smack from https://github.com/01org/meta-intel-iot-security

That means it cannot be reproduced with OE-core or Poky out-of-the-box. If someone wants to investigate further, I can try to reproduce it with Poky + these layers and provide instructions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55474</commentid>
    <comment_count>4</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-20 08:30:49 +0000</bug_when>
    <thetext>Hmm, double checking with an image using xattr+hardlinks via &quot;fsck.ext4 -f&quot; called directly from init=/bin/sh did not show the corruption.

Seems that I need to investigate further where exactly the FS gets corrupted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55478</commentid>
    <comment_count>5</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-20 09:38:00 +0000</bug_when>
    <thetext>Now I know how reproduce the issue:
1. system time must be incorrect
2. fsck.ext4 must be allowed to fix the superblock

That leads to the &quot;Extended attribute in inode&quot; error (and the other errors that I mentioned before) directly in the fsck.ext4 run where it is updating the time stamp of the superblock.

So it could be fsck.ext4 itself which corrupts the image. Not sure whether it depends on creating the image with mkfs.ext4.

I checked again whether it depends on xattrs. It still occurs when I have less of them (i.e. no ima.security, in particular not on the hard links) but as there are some xattrs elsewhere (Smack labels on /etc, for example) this still might make a difference.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55485</commentid>
    <comment_count>6</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-20 11:09:31 +0000</bug_when>
    <thetext>I can confirm that fsck.ext4 from current e2fsprogs master (= 956b0f18a5) no longer causes the problems that I ran into.

I suggest updating OE-core master to that version as soon as possible, followed by an update to 1.43 once it is released.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55486</commentid>
    <comment_count>7</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2015-10-20 11:15:30 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; I can confirm that fsck.ext4 from current e2fsprogs master (= 956b0f18a5) no
&gt; longer causes the problems that I ran into.
&gt; 
&gt; I suggest updating OE-core master to that version as soon as possible,
&gt; followed by an update to 1.43 once it is released.

I think we can upgrade it in YP 2.1, for YP 2.0, there isn&apos;t anything wrong AFAIK.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55524</commentid>
    <comment_count>8</comment_count>
    <who name="Paul Eggleton">bluelightning</who>
    <bug_when>2015-10-20 14:58:23 +0000</bug_when>
    <thetext>Surely there must be something wrong or we&apos;d not be having this discussion.

Is there a specific patch in e2fsprogs master that fixes the issue which we can backport?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55525</commentid>
    <comment_count>9</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2015-10-20 15:38:21 +0000</bug_when>
    <thetext>(In reply to comment #8)
&gt; Surely there must be something wrong or we&apos;d not be having this discussion.
&gt; 
&gt; Is there a specific patch in e2fsprogs master that fixes the issue which we
&gt; can backport?

Patrick doesn&apos;t use oe-core&apos;s version of e2fsprogs, though oe-core&apos;s doesn&apos;t support xattrs when mke2fs -d. So I think that there isn&apos;t wrong for YP 2.0, I will upgrade e2fsprogs to git version in YP 2.1 so that it supports xattrs, and I will move critical to major.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55533</commentid>
    <comment_count>10</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-20 20:10:08 +0000</bug_when>
    <thetext>I can reproduce some of the problems also with Poky 2.0 = jethro revision 8578bc17b54da97d42b257b3c8f398ac52b91a9f.

I built core-image-minimal for qemux86 with the following changes in local.conf:
CORE_IMAGE_EXTRA_INSTALL += &quot;e2fsprogs&quot;

Then I ran with:
runqemu qemux86 core-image-minimal ext4 serial nographic kvm &apos;bootparams=ro init=/bin/sh&apos; &apos;qemuparams=-monitor none&apos;

In the shell, I ran:

/ # mount -t proc proc /proc
/ # date 010101012014
Wed Jan  1 01:01:00 UTC 2014
/ # fsck.ext4 -n /dev/vda
e2fsck 1.42.9 (28-Dec-2013)
Superblock last write time (Tue Oct 20 19:56:02 2015,
	now = Wed Jan  1 01:01:05 2014) is in the future.
Fix? no

/dev/vda: clean, 799/2624 files, 8204/10492 blocks
/ # fsck.ext4 /dev/vda
e2fsck 1.42.9 (28-Dec-2013)
Superblock last write time (Tue Oct 20 19:56:02 2015,
	now = Wed Jan  1 01:01:17 2014) is in the future.
Fix&lt;y&gt;? yes
/dev/vda: clean, 799/2624 files, 8204/10492 blocks
/ # fsck.ext4 /dev/vda
e2fsck 1.42.9 (28-Dec-2013)
/dev/vda: clean, 799/2624 files, 8204/10492 blocks
/ # fsck.ext4 -f /dev/vda
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Setting filetype for entry &apos;e2fsck&apos; in /sbin (499) to 1.
Setting filetype for entry &apos;fsck.ext4dev&apos; in /sbin (499) to 1.
Setting filetype for entry &apos;mkfs.ext3&apos; in /sbin (499) to 1.
Setting filetype for entry &apos;fsck.ext3&apos; in /sbin (499) to 1.
Setting filetype for entry &apos;fsck.ext2&apos; in /sbin (499) to 1.
Setting filetype for entry &apos;mkfs.ext4dev&apos; in /sbin (499) to 1.
Setting filetype for entry &apos;mkfs.ext2&apos; in /sbin (499) to 1.
Setting filetype for entry &apos;mkfs.ext4&apos; in /sbin (499) to 1.
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/vda: ***** FILE SYSTEM WAS MODIFIED *****
/dev/vda: ***** REBOOT LINUX *****
/dev/vda: 799/2624 files (0.8% non-contiguous), 8206/10492 blocks

The same &quot;Setting filetype for entry&quot; messages appear. However, the filesystem does not become completely corrupted. Perhaps it would be different for more complex images.

FWIW, I&apos;m still not fully convinced that running fsck is really tested well enough:
* core-image-minimal does not contain it
* .hddimg mounts the rootfs read/write in the initramfs, which prevents running fsck
* mkefidisk.sh seems to do the same (not tested)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55541</commentid>
    <comment_count>11</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2015-10-21 01:32:01 +0000</bug_when>
    <thetext>(In reply to comment #10)
&gt; I can reproduce some of the problems also with Poky 2.0 = jethro revision
&gt; 8578bc17b54da97d42b257b3c8f398ac52b91a9f.
&gt; 
&gt; I built core-image-minimal for qemux86 with the following changes in
&gt; local.conf:
&gt; CORE_IMAGE_EXTRA_INSTALL += &quot;e2fsprogs&quot;
&gt; 
&gt; Then I ran with:
&gt; runqemu qemux86 core-image-minimal ext4 serial nographic kvm &apos;bootparams=ro
&gt; init=/bin/sh&apos; &apos;qemuparams=-monitor none&apos;
&gt; 
&gt; In the shell, I ran:
&gt; 
&gt; / # mount -t proc proc /proc
&gt; / # date 010101012014
&gt; Wed Jan  1 01:01:00 UTC 2014
&gt; / # fsck.ext4 -n /dev/vda

Is /dev/vda mounted ? I will try later.

// Robert

&gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; Superblock last write time (Tue Oct 20 19:56:02 2015,
&gt; 	now = Wed Jan  1 01:01:05 2014) is in the future.
&gt; Fix? no
&gt; 
&gt; /dev/vda: clean, 799/2624 files, 8204/10492 blocks
&gt; / # fsck.ext4 /dev/vda
&gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; Superblock last write time (Tue Oct 20 19:56:02 2015,
&gt; 	now = Wed Jan  1 01:01:17 2014) is in the future.
&gt; Fix&lt;y&gt;? yes
&gt; /dev/vda: clean, 799/2624 files, 8204/10492 blocks
&gt; / # fsck.ext4 /dev/vda
&gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; /dev/vda: clean, 799/2624 files, 8204/10492 blocks
&gt; / # fsck.ext4 -f /dev/vda
&gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; Pass 1: Checking inodes, blocks, and sizes
&gt; Pass 2: Checking directory structure
&gt; Setting filetype for entry &apos;e2fsck&apos; in /sbin (499) to 1.
&gt; Setting filetype for entry &apos;fsck.ext4dev&apos; in /sbin (499) to 1.
&gt; Setting filetype for entry &apos;mkfs.ext3&apos; in /sbin (499) to 1.
&gt; Setting filetype for entry &apos;fsck.ext3&apos; in /sbin (499) to 1.
&gt; Setting filetype for entry &apos;fsck.ext2&apos; in /sbin (499) to 1.
&gt; Setting filetype for entry &apos;mkfs.ext4dev&apos; in /sbin (499) to 1.
&gt; Setting filetype for entry &apos;mkfs.ext2&apos; in /sbin (499) to 1.
&gt; Setting filetype for entry &apos;mkfs.ext4&apos; in /sbin (499) to 1.
&gt; Pass 3: Checking directory connectivity
&gt; Pass 3A: Optimizing directories
&gt; Pass 4: Checking reference counts
&gt; Pass 5: Checking group summary information
&gt; 
&gt; /dev/vda: ***** FILE SYSTEM WAS MODIFIED *****
&gt; /dev/vda: ***** REBOOT LINUX *****
&gt; /dev/vda: 799/2624 files (0.8% non-contiguous), 8206/10492 blocks
&gt; 
&gt; The same &quot;Setting filetype for entry&quot; messages appear. However, the
&gt; filesystem does not become completely corrupted. Perhaps it would be
&gt; different for more complex images.
&gt; 
&gt; FWIW, I&apos;m still not fully convinced that running fsck is really tested well
&gt; enough:
&gt; * core-image-minimal does not contain it
&gt; * .hddimg mounts the rootfs read/write in the initramfs, which prevents
&gt; running fsck
&gt; * mkefidisk.sh seems to do the same (not tested)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55543</commentid>
    <comment_count>12</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-21 07:48:18 +0000</bug_when>
    <thetext>(In reply to comment #11)
&gt; (In reply to comment #10)
&gt; &gt; Then I ran with:
&gt; &gt; runqemu qemux86 core-image-minimal ext4 serial nographic kvm &apos;bootparams=ro
&gt; &gt; init=/bin/sh&apos; &apos;qemuparams=-monitor none&apos;
&gt; &gt; 
&gt; &gt; In the shell, I ran:
&gt; &gt; 
&gt; &gt; / # mount -t proc proc /proc
&gt; &gt; / # date 010101012014
&gt; &gt; Wed Jan  1 01:01:00 UTC 2014
&gt; &gt; / # fsck.ext4 -n /dev/vda
&gt; 
&gt; Is /dev/vda mounted ?

Yes, as / That&apos;s where /bin/sh and fsck.ext4 come from. But because of the &quot;ro&quot; boot parameter, it was mounted read-only, which enables running fsck on it. 

It is /dev/vda because of the &quot;kvm&quot; runqemu parameter. Otherwise it should be /dev/hda.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55656</commentid>
    <comment_count>13</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2015-10-23 11:24:27 +0000</bug_when>
    <thetext>Hi Patrick,

Would you please help to test the patch ? It is based on YP 2.0&apos;s master branch:

  git://git.openembedded.org/openembedded-core-contrib rbt/e2fsprogs
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=rbt/e2fsprogs

Robert Yang (1):
  e2fsprogs: backport a patch to fix filetype for hardlink</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55658</commentid>
    <comment_count>14</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2015-10-23 11:25:50 +0000</bug_when>
    <thetext>Now you may get:

e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/hda: ***** FILE SYSTEM WAS MODIFIED *****
/dev/hda: ***** REBOOT LINUX *****

Note the &quot;Pass 3A: Optimizing directories&quot;, it is fine, from &quot;man e2fsck&quot;:

    e2fsck may sometimes optimize a few directories --- for example, if
    directory indexing is enabled and a directory is not indexed and would
    benefit from being indexed, or if the index structures are corrupted
    and need to be rebuilt.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55691</commentid>
    <comment_count>15</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-23 16:11:41 +0000</bug_when>
    <thetext>Do you want me to validate this in OE-core or with xattrs and thus the e2fsprogs from https://github.com/01org/meta-intel-iot-security?

I trust that you made no mistake when testing and that the patch really addresses the problem in OE-core.

More interesting would be whether it also fixes the more severe corruption seen when building images with xattrs. I tried testing that, but the patch does not apply when using the (patched?!) e2fsprogs from the security layer.

The original upstream patch (a433db04d054a4c949c816b28cfa9952b35e0b0a) applies. It seems to address all issues that I was seeing; at least I cannot reproduce them anymore.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55698</commentid>
    <comment_count>16</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-23 18:42:08 +0000</bug_when>
    <thetext>I spoke to soon. The commit fixes the hardlink problem (obviously), but when fsck also changes the time stamp of the superblock, the fs still gets corrupted in our image. I hadn&apos;t reset the time in my previous test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55704</commentid>
    <comment_count>17</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2015-10-24 06:44:53 +0000</bug_when>
    <thetext>(In reply to comment #15)
&gt; Do you want me to validate this in OE-core or with xattrs and thus the
&gt; e2fsprogs from https://github.com/01org/meta-intel-iot-security?
&gt; 
&gt; I trust that you made no mistake when testing and that the patch really
&gt; addresses the problem in OE-core.
&gt; 
&gt; More interesting would be whether it also fixes the more severe corruption
&gt; seen when building images with xattrs. I tried testing that, but the patch
&gt; does not apply when using the (patched?!) e2fsprogs from the security layer.
&gt; 
&gt; The original upstream patch (a433db04d054a4c949c816b28cfa9952b35e0b0a)

That&apos;s the commit that I backported to YP 2.0.

&gt; applies. It seems to address all issues that I was seeing; at least I cannot
&gt; reproduce them anymore.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55705</commentid>
    <comment_count>18</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2015-10-24 08:00:55 +0000</bug_when>
    <thetext>(In reply to comment #16)
&gt; I spoke to soon. The commit fixes the hardlink problem (obviously), but when
&gt; fsck also changes the time stamp of the superblock, the fs still gets
&gt; corrupted in our image. I hadn&apos;t reset the time in my previous test.

Hi,

I tried the layer meta-intel-iot-security/meta-security-smack after the patch applied to e2fsprogs_git.bb:

OVERRIDES .= &quot;:smack&quot;
DISTRO_FEATURES_append = &quot; smack&quot;

# Enable systemd.
DISTRO_FEATURES_append = &quot; pam&quot;
DISTRO_FEATURES_append += &quot; systemd&quot;
VIRTUAL-RUNTIME_init_manager = &quot;systemd&quot;
DISTRO_FEATURES_BACKFILL_CONSIDERED = &quot;sysvinit&quot;
VIRTUAL-RUNTIME_initscripts = &quot;&quot;
# CORE_IMAGE_EXTRA_INSTALL += &quot;systemd-analyze&quot;

# Need Smack support in file utilities.
CORE_IMAGE_EXTRA_INSTALL += &quot;coreutils e2fsprogs&quot;

# Having Smack utilities is useful.
CORE_IMAGE_EXTRA_INSTALL += &quot;smack-userspace&quot;

There isn&apos;t anything run, or did I miss anything ?
$ bitbake core-image-minimal

/ # mount -t proc proc /proc
/ # date 010101012014
Wed Jan  1 01:01:00 UTC 2014
/ # fsck.ext4 -n /dev/vda
e2fsck 1.43-WIP (18-May-2014)
Superblock last write time (Sat Oct 24 07:57:39 2015,
        now = Wed Jan  1 01:01:08 2014) is in the future.
Fix? no

/dev/vda: clean, 1920/17352 files, 54296/69276 blocks
/ # fsck.ext4 -y /dev/vda
e2fsck 1.43-WIP (18-May-2014)
Superblock last write time (Sat Oct 24 07:57:39 2015,
        now = Wed Jan  1 01:01:20 2014) is in the future.
Fix? yes

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/vda: ***** FILE SYSTEM WAS MODIFIED *****
/dev/vda: ***** REBOOT LINUX *****
/dev/vda: 1920/17352 files (0.8% non-contiguous), 54308/69276 blocks
/ # fsck.ext4 /dev/vda
e2fsck 1.43-WIP (18-May-2014)
/dev/vda: clean, 1920/17352 files, 54308/69276 blocks
/ # fsck.ext4 -f /dev/vda
e2fsck 1.43-WIP (18-May-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vda: 1920/17352 files (0.8% non-contiguous), 54308/69276 blocks


(In reply to comment #16)
&gt; I spoke to soon. The commit fixes the hardlink problem (obviously), but when
&gt; fsck also changes the time stamp of the superblock, the fs still gets
&gt; corrupted in our image. I hadn&apos;t reset the time in my previous test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55720</commentid>
    <comment_count>19</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-26 09:36:06 +0000</bug_when>
    <thetext>With Smack enabled, you should see some xattrs, for example on /etc. Check with &quot;bitbake -c devshell core-image-minimal&quot; and &quot;getfattr -d -m . /etc&quot; (getfattr from the &quot;attr&quot; package on Debian-based distros).

I don&apos;t remember whether I had fatal errors in that case alone. My latest test was with IMA image signing enabled, which sets xattrs on all files. For that, follow the instructions in meta-integrity/README. It should be enough to add to local.conf:
  INHERIT += &quot;ima-evm-rootfs&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55795</commentid>
    <comment_count>20</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2015-10-27 02:48:08 +0000</bug_when>
    <thetext>(In reply to comment #19)
&gt; With Smack enabled, you should see some xattrs, for example on /etc. Check
&gt; with &quot;bitbake -c devshell core-image-minimal&quot; and &quot;getfattr -d -m . /etc&quot;
&gt; (getfattr from the &quot;attr&quot; package on Debian-based distros).
&gt; 
&gt; I don&apos;t remember whether I had fatal errors in that case alone. My latest
&gt; test was with IMA image signing enabled, which sets xattrs on all files. For
&gt; that, follow the instructions in meta-integrity/README. It should be enough
&gt; to add to local.conf:
&gt;   INHERIT += &quot;ima-evm-rootfs&quot;

It works well for me, too:

# getfattr -d -m . /etc
getfattr: Removing leading &apos;/&apos; from absolute path names
# file: etc
security.SMACK64=&quot;System::Shared&quot;
security.SMACK64TRANSMUTE=&quot;TRUE&quot;

/ # mount -t proc proc /proc
/ # date 010101012014
Wed Jan  1 01:01:00 UTC 2014
/ # fsck.ext4 -n /dev/vda
e2fsck 1.43-WIP (18-May-2014)
Superblock last write time (Tue Oct 27 02:41:48 2015,
        now = Wed Jan  1 01:01:03 2014) is in the future.
Fix? no

/dev/vda: clean, 1926/17352 files, 55718/69348 blocks
/ # fsck.ext4 -y /dev/vda
e2fsck 1.43-WIP (18-May-2014)
Superblock last write time (Tue Oct 27 02:41:48 2015,
        now = Wed Jan  1 01:01:11 2014) is in the future.
Fix? yes

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/vda: ***** FILE SYSTEM WAS MODIFIED *****
/dev/vda: ***** REBOOT LINUX *****
/dev/vda: 1926/17352 files (0.7% non-contiguous), 55729/69348 blocks
/ # fsck.ext4 -f /dev/vda
e2fsck 1.43-WIP (18-May-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vda: 1926/17352 files (0.7% non-contiguous), 55729/69348 blocks</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55802</commentid>
    <comment_count>21</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2015-10-27 09:37:56 +0000</bug_when>
    <thetext>Merged into YP 2.0:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=jethro&amp;id=c1d5e897909bc659eee6151d097781dd3c7931c7</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55904</commentid>
    <comment_count>22</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2015-10-28 12:47:03 +0000</bug_when>
    <thetext>(In reply to comment #21)
&gt; Merged into YP 2.0:
&gt; 
&gt; http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/
&gt; ?h=jethro&amp;id=c1d5e897909bc659eee6151d097781dd3c7931c7

Hi Robert,

I am trying to verify the fix, but I can&apos;t tell if it&apos;s fixed or not. Maybe you can tell me how to try and reproduce the issue.
I am using jethro/8a0d8eee432924433c3e70198aaeab3161476c5f


I built core-image-minimal for qemux86 with the following changes in local.conf:
CORE_IMAGE_EXTRA_INSTALL += &quot;e2fsprogs&quot;

Then I ran with:
runqemu qemux86 core-image-minimal ext4 serial nographic kvm &apos;bootparams=ro init=/bin/sh&apos; &apos;qemuparams=-monitor none&apos;

In the shell, I ran:


/ # date
Wed Oct 28 12:11:58 UTC 2015
/ # mount -t proc proc /proc
/ # date 010101012014
Wed Jan  1 01:01:00 UTC 2014
/ # fsck.ext
fsck.ext2     fsck.ext3     fsck.ext4     fsck.ext4dev
/ # fsck.ext4 -n /dev/vda
e2fsck 1.42.9 (28-Dec-2013)
Superblock last write time (Wed Oct 28 12:11:21 2015,
        now = Wed Jan  1 01:01:10 2014) is in the future.
Fix? no

/dev/vda: clean, 799/2624 files, 8204/10492 blocks
/ # fsck.ext4 /dev/vda
e2fsck 1.42.9 (28-Dec-2013)
Superblock last write time (Wed Oct 28 12:11:21 2015,
        now = Wed Jan  1 01:01:28 2014) is in the future.
Fix&lt;y&gt;? yes
/dev/vda: clean, 799/2624 files, 8204/10492 blocks
/ # fsck.ext4 /dev/vda
e2fsck 1.42.9 (28-Dec-2013)
/dev/vda: clean, 799/2624 files, 8204/10492 blocks
/ # fsck.ext4 -f /dev/vda
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/vda: ***** FILE SYSTEM WAS MODIFIED *****
/dev/vda: ***** REBOOT LINUX *****
/dev/vda: 799/2624 files (0.8% non-contiguous), 8206/10492 blocks
/ # mount -
/ # df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 8.9M      6.7M      1.5M  81% /
devtmpfs                119.6M         0    119.6M   0% /dev
/ #


Thanks,
AlexG</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55907</commentid>
    <comment_count>23</comment_count>
    <who name="Alexandru Georgescu">alexandru.c.georgescu</who>
    <bug_when>2015-10-28 12:59:54 +0000</bug_when>
    <thetext>(In reply to comment #22)
&gt; (In reply to comment #21)
&gt; &gt; Merged into YP 2.0:
&gt; &gt; 
&gt; &gt; http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/
&gt; &gt; ?h=jethro&amp;id=c1d5e897909bc659eee6151d097781dd3c7931c7
&gt; 
&gt; Hi Robert,
&gt; 
&gt; I am trying to verify the fix, but I can&apos;t tell if it&apos;s fixed or not. Maybe
&gt; you can tell me how to try and reproduce the issue.
&gt; I am using jethro/8a0d8eee432924433c3e70198aaeab3161476c5f
&gt; 
&gt; 
&gt; I built core-image-minimal for qemux86 with the following changes in
&gt; local.conf:
&gt; CORE_IMAGE_EXTRA_INSTALL += &quot;e2fsprogs&quot;
&gt; 
&gt; Then I ran with:
&gt; runqemu qemux86 core-image-minimal ext4 serial nographic kvm &apos;bootparams=ro
&gt; init=/bin/sh&apos; &apos;qemuparams=-monitor none&apos;
&gt; 
&gt; In the shell, I ran:
&gt; 
&gt; 
&gt; / # date
&gt; Wed Oct 28 12:11:58 UTC 2015
&gt; / # mount -t proc proc /proc
&gt; / # date 010101012014
&gt; Wed Jan  1 01:01:00 UTC 2014
&gt; / # fsck.ext
&gt; fsck.ext2     fsck.ext3     fsck.ext4     fsck.ext4dev
&gt; / # fsck.ext4 -n /dev/vda
&gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; Superblock last write time (Wed Oct 28 12:11:21 2015,
&gt;         now = Wed Jan  1 01:01:10 2014) is in the future.
&gt; Fix? no
&gt; 
&gt; /dev/vda: clean, 799/2624 files, 8204/10492 blocks
&gt; / # fsck.ext4 /dev/vda
&gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; Superblock last write time (Wed Oct 28 12:11:21 2015,
&gt;         now = Wed Jan  1 01:01:28 2014) is in the future.
&gt; Fix&lt;y&gt;? yes
&gt; /dev/vda: clean, 799/2624 files, 8204/10492 blocks
&gt; / # fsck.ext4 /dev/vda
&gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; /dev/vda: clean, 799/2624 files, 8204/10492 blocks
&gt; / # fsck.ext4 -f /dev/vda
&gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; Pass 1: Checking inodes, blocks, and sizes
&gt; Pass 2: Checking directory structure
&gt; Pass 3: Checking directory connectivity
&gt; Pass 3A: Optimizing directories
&gt; Pass 4: Checking reference counts
&gt; Pass 5: Checking group summary information
&gt; 
&gt; /dev/vda: ***** FILE SYSTEM WAS MODIFIED *****
&gt; /dev/vda: ***** REBOOT LINUX *****
&gt; /dev/vda: 799/2624 files (0.8% non-contiguous), 8206/10492 blocks
&gt; / # mount -
&gt; / # df -h
&gt; Filesystem                Size      Used Available Use% Mounted on
&gt; /dev/root                 8.9M      6.7M      1.5M  81% /
&gt; devtmpfs                119.6M         0    119.6M   0% /dev
&gt; / #
&gt; 
&gt; 
&gt; Thanks,
&gt; AlexG

reminder for myself to investigate the kernel panic that I encountered when exiting the session:


/dev/vda: ***** FILE SYSTEM WAS MODIFIED *****
/dev/vda: ***** REBOOT LINUX *****
/dev/vda: 799/2624 files (0.8% non-contiguous), 8206/10492 blocks
/ # mount -
/ # df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 8.9M      6.7M      1.5M  81% /
devtmpfs                119.6M         0    119.6M   0% /dev
/ # exit
Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000

CPU: 0 PID: 1 Comm: sh Not tainted 4.1.8-yocto-standard #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
 00000000 00000000 cf89ff28 c186350e c1b68fa0 cf89ff40 c1861b93 cf13e438
 c1b68fa0 cf13e438 cf8a0000 cf89ff8c c1052994 c1a62f00 00000000 c1052c4b
 cf8a8000 00000001 00000005 cf8a0000 00000001 cf13e438 00000000 00000000
Call Trace:
 [&lt;c186350e&gt;] dump_stack+0x4b/0x75
 [&lt;c1861b93&gt;] panic+0x81/0x17b
 [&lt;c1052994&gt;] do_exit+0xab4/0xac0
 [&lt;c1052c4b&gt;] ? SyS_wait4+0x6b/0xc0
 [&lt;c1052a11&gt;] do_group_exit+0x31/0x90
 [&lt;c1052a86&gt;] SyS_exit_group+0x16/0x20
 [&lt;c1869e0e&gt;] syscall_call+0x7/0x7
Kernel Offset: disabled
---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55944</commentid>
    <comment_count>24</comment_count>
    <who name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</who>
    <bug_when>2015-10-28 16:01:54 +0000</bug_when>
    <thetext>Trying to reproduce with smack layer:



First attempt:
==================

Write protecting the kernel text: 8680k
Write protecting the kernel read-only data: 2960k
/bin/sh: can&apos;t access tty; job control turned off
/ # date
Thu Oct 29 01:46:51 UTC 2015
/ # mount -t proc proc /proc
/ # date 010101012014
Wed Jan  1 01:01:00 UTC 2014
/ # fsck.ext
/bin/sh: fsck.ext: not found
/ # fs
fsck                   fsck.ext4dev           fsfreeze
fsck.ext2              fsck.minix             fstrim
fsck.ext3              fsck.minix.util-linux
fsck.ext4              fsck.util-linux
/ # fsck.ext4 -n /dev/vda
e2fsck 1.43-WIP (18-May-2014)
Superblock last mount time (Thu Oct 29 01:43:03 2015,
	now = Wed Jan  1 01:01:14 2014) is in the future.
Fix? no

Superblock last write time (Thu Oct 29 01:43:03 2015,
	now = Wed Jan  1 01:01:14 2014) is in the future.
Fix? no

/dev/vda: clean, 2074/18504 files, 59227/73729 blocks
/ # fsck.ext4 /dev/vda
e2fsck 1.43-WIP (18-May-2014)
Superblock last mount time (Thu Oct 29 01:43:03 2015,
	now = Wed Jan  1 01:01:21 2014) is in the future.
Fix&lt;y&gt;? yes
Superblock last write time (Thu Oct 29 01:43:03 2015,
	now = Wed Jan  1 01:01:21 2014) is in the future.
Fix&lt;y&gt;? yes
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Setting filetype for entry &apos;mkfs.ext3&apos; in /sbin (471) to 1.
Setting filetype for entry &apos;mkfs.ext4dev&apos; in /sbin (471) to 1.
Setting filetype for entry &apos;e2fsck&apos; in /sbin (471) to 1.
Setting filetype for entry &apos;vt200&apos; in /etc/terminfo/v (1968) to 1.
Setting filetype for entry &apos;fsck.ext4&apos; in /sbin (471) to 1.
Setting filetype for entry &apos;fsck.ext4dev&apos; in /sbin (471) to 1.
Setting filetype for entry &apos;mke2fs&apos; in /sbin (471) to 1.
Setting filetype for entry &apos;mkfs.ext4&apos; in /sbin (471) to 1.
Setting filetype for entry &apos;fsck.ext3&apos; in /sbin (471) to 1.
Pass 3: Checking directory connectivity
Pass 3A: Optimizing directories
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/vda: ***** FILE SYSTEM WAS MODIFIED *****
/dev/vda: ***** REBOOT LINUX *****
/dev/vda: 2074/18504 files (0.8% non-contiguous), 59239/73729 blocks
/ # fsck.ext4 -f /dev/vda
e2fsck 1.43-WIP (18-May-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vda: 2074/18504 files (0.8% non-contiguous), 59239/73729 blocks
/ # mount -
mount: can&apos;t find - in /etc/fstab
/ # mount 
/dev/vda on / type ext4 (ro,relatime,data=ordered)
devtmpfs on /dev type devtmpfs (rw,relatime,size=122404k,nr_inodes=30601,mode=755)
proc on /proc type proc (rw,relatime)
/ # df -h 
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        66M   52M  9.2M  85% /
devtmpfs        120M     0  120M   0% /dev


==================

Then I restarted the qemu and repeated the steps: 
==================

EXT4-fs (vda): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) readonly on device 253:0.
devtmpfs: mounted
Freeing unused kernel memory: 732K (c1c0c000 - c1cc3000)
Write protecting the kernel text: 8680k
Write protecting the kernel read-only data: 2960k
/bin/sh: can&apos;t access tty; job control turned off
/ # date
Thu Oct 29 01:59:50 UTC 2015
/ # mount -t proc proc /proc
/ # date 010101012014
Wed Jan  1 01:01:00 UTC 2014
/ # fs
fsck                   fsck.ext4dev           fsfreeze
fsck.ext2              fsck.minix             fstrim
fsck.ext3              fsck.minix.util-linux
fsck.ext4              fsck.util-linux
/ # fsck
fsck from util-linux 2.26.2
/ # fsck.ext4 -n /dev/vda
e2fsck 1.43-WIP (18-May-2014)
Superblock last mount time is in the future.
	(by less than a day, probably due to the hardware clock being incorrectly set)  Fix? no

Superblock last write time is in the future.
	(by less than a day, probably due to the hardware clock being incorrectly set).  Fix? no

/dev/vda: clean, 2074/18504 files, 59239/73729 blocks
/ # fsck.ext4 -y /dev/vda
e2fsck 1.43-WIP (18-May-2014)
Superblock last write time is in the future.
	(by less than a day, probably due to the hardware clock being incorrectly set).  Fix? yes

Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vda: 2074/18504 files (0.8% non-contiguous), 59239/73729 blocks
/ # fsck.ext4 /dev/vda
e2fsck 1.43-WIP (18-May-2014)
/dev/vda: clean, 2074/18504 files, 59239/73729 blocks
/ # fsck.ext4 -f /dev/vda
e2fsck 1.43-WIP (18-May-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vda: 2074/18504 files (0.8% non-contiguous), 59239/73729 blocks
/ # date
Wed Jan  1 01:01:51 UTC 2014

 
So please advise!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55955</commentid>
    <comment_count>25</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2015-10-29 02:02:18 +0000</bug_when>
    <thetext>(In reply to comment #23)
&gt; (In reply to comment #22)
&gt; &gt; (In reply to comment #21)
&gt; &gt; &gt; Merged into YP 2.0:
&gt; &gt; &gt; 
&gt; &gt; &gt; http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/
&gt; &gt; &gt; ?h=jethro&amp;id=c1d5e897909bc659eee6151d097781dd3c7931c7
&gt; &gt; 
&gt; &gt; Hi Robert,
&gt; &gt; 
&gt; &gt; I am trying to verify the fix, but I can&apos;t tell if it&apos;s fixed or not. Maybe
&gt; &gt; you can tell me how to try and reproduce the issue.
&gt; &gt; I am using jethro/8a0d8eee432924433c3e70198aaeab3161476c5f
&gt; &gt; 
&gt; &gt; 
&gt; &gt; I built core-image-minimal for qemux86 with the following changes in
&gt; &gt; local.conf:
&gt; &gt; CORE_IMAGE_EXTRA_INSTALL += &quot;e2fsprogs&quot;
&gt; &gt; 
&gt; &gt; Then I ran with:
&gt; &gt; runqemu qemux86 core-image-minimal ext4 serial nographic kvm &apos;bootparams=ro
&gt; &gt; init=/bin/sh&apos; &apos;qemuparams=-monitor none&apos;
&gt; &gt; 
&gt; &gt; In the shell, I ran:
&gt; &gt; 
&gt; &gt; 
&gt; &gt; / # date
&gt; &gt; Wed Oct 28 12:11:58 UTC 2015
&gt; &gt; / # mount -t proc proc /proc
&gt; &gt; / # date 010101012014
&gt; &gt; Wed Jan  1 01:01:00 UTC 2014
&gt; &gt; / # fsck.ext
&gt; &gt; fsck.ext2     fsck.ext3     fsck.ext4     fsck.ext4dev
&gt; &gt; / # fsck.ext4 -n /dev/vda
&gt; &gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; &gt; Superblock last write time (Wed Oct 28 12:11:21 2015,
&gt; &gt;         now = Wed Jan  1 01:01:10 2014) is in the future.
&gt; &gt; Fix? no
&gt; &gt; 
&gt; &gt; /dev/vda: clean, 799/2624 files, 8204/10492 blocks
&gt; &gt; / # fsck.ext4 /dev/vda
&gt; &gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; &gt; Superblock last write time (Wed Oct 28 12:11:21 2015,
&gt; &gt;         now = Wed Jan  1 01:01:28 2014) is in the future.
&gt; &gt; Fix&lt;y&gt;? yes
&gt; &gt; /dev/vda: clean, 799/2624 files, 8204/10492 blocks
&gt; &gt; / # fsck.ext4 /dev/vda
&gt; &gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; &gt; /dev/vda: clean, 799/2624 files, 8204/10492 blocks
&gt; &gt; / # fsck.ext4 -f /dev/vda
&gt; &gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; &gt; Pass 1: Checking inodes, blocks, and sizes
&gt; &gt; Pass 2: Checking directory structure
&gt; &gt; Pass 3: Checking directory connectivity
&gt; &gt; Pass 3A: Optimizing directories
&gt; &gt; Pass 4: Checking reference counts
&gt; &gt; Pass 5: Checking group summary information
&gt; &gt; 
&gt; &gt; /dev/vda: ***** FILE SYSTEM WAS MODIFIED *****
&gt; &gt; /dev/vda: ***** REBOOT LINUX *****
&gt; &gt; /dev/vda: 799/2624 files (0.8% non-contiguous), 8206/10492 blocks
&gt; &gt; / # mount -
&gt; &gt; / # df -h
&gt; &gt; Filesystem                Size      Used Available Use% Mounted on
&gt; &gt; /dev/root                 8.9M      6.7M      1.5M  81% /
&gt; &gt; devtmpfs                119.6M         0    119.6M   0% /dev
&gt; &gt; / #
&gt; &gt; 
&gt; &gt; 
&gt; &gt; Thanks,
&gt; &gt; AlexG
&gt; 
&gt; reminder for myself to investigate the kernel panic that I encountered when
&gt; exiting the session:
&gt; 
&gt; 
&gt; /dev/vda: ***** FILE SYSTEM WAS MODIFIED *****
&gt; /dev/vda: ***** REBOOT LINUX *****
&gt; /dev/vda: 799/2624 files (0.8% non-contiguous), 8206/10492 blocks
&gt; / # mount -
&gt; / # df -h
&gt; Filesystem                Size      Used Available Use% Mounted on
&gt; /dev/root                 8.9M      6.7M      1.5M  81% /
&gt; devtmpfs                119.6M         0    119.6M   0% /dev
&gt; / # exit
&gt; Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
&gt; 
&gt; CPU: 0 PID: 1 Comm: sh Not tainted 4.1.8-yocto-standard #1
&gt; Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
&gt; rel-1.8.2-0-g33fbe13 by qemu-project.org 04/01/2014
&gt;  00000000 00000000 cf89ff28 c186350e c1b68fa0 cf89ff40 c1861b93 cf13e438
&gt;  c1b68fa0 cf13e438 cf8a0000 cf89ff8c c1052994 c1a62f00 00000000 c1052c4b
&gt;  cf8a8000 00000001 00000005 cf8a0000 00000001 cf13e438 00000000 00000000
&gt; Call Trace:
&gt;  [&lt;c186350e&gt;] dump_stack+0x4b/0x75
&gt;  [&lt;c1861b93&gt;] panic+0x81/0x17b
&gt;  [&lt;c1052994&gt;] do_exit+0xab4/0xac0
&gt;  [&lt;c1052c4b&gt;] ? SyS_wait4+0x6b/0xc0
&gt;  [&lt;c1052a11&gt;] do_group_exit+0x31/0x90
&gt;  [&lt;c1052a86&gt;] SyS_exit_group+0x16/0x20
&gt;  [&lt;c1869e0e&gt;] syscall_call+0x7/0x7
&gt; Kernel Offset: disabled
&gt; ---[ end Kernel panic - not syncing: Attempted to kill init!
&gt; exitcode=0x00000000

The kernel panic issue doesn&apos;t related to fsck, you can get the issue everytime when you you exit it (w/o fsck). I think that it is because of &apos;bootparams=ro init=/bin/sh&apos;, if you remove it from command line, it will be OK.

Use jethro to test it is OK, if you want to use meta-security-smack, you need apply another similar patch to its e2fsprogs recipe, the layer has its own e2fsprogs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55958</commentid>
    <comment_count>26</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-29 07:47:50 +0000</bug_when>
    <thetext>The kernel panic is caused by the init process exiting. That&apos;s normal in this situation, because without that process, what it is kernel supposed to run? Just power off instead.

We&apos;ve also seen the same panic when the init process cannot be loaded because of severe file system corruption. That also is just a follow-up error can then can be ignored.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55984</commentid>
    <comment_count>27</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-29 12:21:53 +0000</bug_when>
    <thetext>(In reply to comment #22)
&gt; /dev/vda: clean, 799/2624 files, 8204/10492 blocks
&gt; / # fsck.ext4 /dev/vda
&gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; Superblock last write time (Wed Oct 28 12:11:21 2015,
&gt;         now = Wed Jan  1 01:01:28 2014) is in the future.
&gt; Fix&lt;y&gt;? yes
&gt; /dev/vda: clean, 799/2624 files, 8204/10492 blocks
&gt; / # fsck.ext4 /dev/vda
&gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; /dev/vda: clean, 799/2624 files, 8204/10492 blocks
&gt; / # fsck.ext4 -f /dev/vda
&gt; e2fsck 1.42.9 (28-Dec-2013)
&gt; Pass 1: Checking inodes, blocks, and sizes
&gt; Pass 2: Checking directory structure
&gt; Pass 3: Checking directory connectivity
&gt; Pass 3A: Optimizing directories
&gt; Pass 4: Checking reference counts
&gt; Pass 5: Checking group summary information

That shows that the hardlink issue is fixed.

(In reply to comment #24)
&gt; Trying to reproduce with smack layer:
...
&gt; /dev/vda: clean, 2074/18504 files, 59227/73729 blocks
&gt; / # fsck.ext4 /dev/vda
&gt; e2fsck 1.43-WIP (18-May-2014)
&gt; Superblock last mount time (Thu Oct 29 01:43:03 2015,
&gt; 	now = Wed Jan  1 01:01:21 2014) is in the future.
&gt; Fix&lt;y&gt;? yes
&gt; Superblock last write time (Thu Oct 29 01:43:03 2015,
&gt; 	now = Wed Jan  1 01:01:21 2014) is in the future.
&gt; Fix&lt;y&gt;? yes
&gt; Pass 1: Checking inodes, blocks, and sizes
&gt; Pass 2: Checking directory structure
&gt; Setting filetype for entry &apos;mkfs.ext3&apos; in /sbin (471) to 1.
&gt; Setting filetype for entry &apos;mkfs.ext4dev&apos; in /sbin (471) to 1.
&gt; Setting filetype for entry &apos;e2fsck&apos; in /sbin (471) to 1.
&gt; Setting filetype for entry &apos;vt200&apos; in /etc/terminfo/v (1968) to 1.
&gt; Setting filetype for entry &apos;fsck.ext4&apos; in /sbin (471) to 1.
&gt; Setting filetype for entry &apos;fsck.ext4dev&apos; in /sbin (471) to 1.
&gt; Setting filetype for entry &apos;mke2fs&apos; in /sbin (471) to 1.
&gt; Setting filetype for entry &apos;mkfs.ext4&apos; in /sbin (471) to 1.
&gt; Setting filetype for entry &apos;fsck.ext3&apos; in /sbin (471) to 1.
&gt; Pass 3: Checking directory connectivity
&gt; Pass 3A: Optimizing directories
&gt; Pass 4: Checking reference counts
&gt; Pass 5: Checking group summary information

This is what you get when e2fsprogs has the hardlink bug.

It&apos;s expected that you get this when using the current meta-intel-iot-security/meta-smack layer, because it has the broken e2fsprogs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55988</commentid>
    <comment_count>28</comment_count>
    <who name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</who>
    <bug_when>2015-10-29 12:42:44 +0000</bug_when>
    <thetext>Thank you, very much, Patrick! 
Do we need to wait for the patch for e2e2fsprogs from smack layer, or we can close the bug, since smack it is outside our project?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>55989</commentid>
    <comment_count>29</comment_count>
    <who name="Patrick Ohly">patrick.ohly</who>
    <bug_when>2015-10-29 13:09:44 +0000</bug_when>
    <thetext>Feel free to close this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>56013</commentid>
    <comment_count>30</comment_count>
    <who name="Bogdan Alexandru Voiculescu">bogdanx.a.voiculescu</who>
    <bug_when>2015-10-29 15:29:01 +0000</bug_when>
    <thetext>Thank you, Patrick.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>