Stop use of LOCAL_MODULE_STEM for libraries.

Bug: 5573756
The uses of LOCAL_MODULE_STEM are unnecessary here.
To implement the feature requested by bug 5573756, we need  library
name to be the same as its module name.

Change-Id: Ibbea9c1e1f4f8f2f5af0b467787ccb214c47d3fd
Update e2fsprogs to version 1.41.14

Change-Id: Ia1ae1df03ba5ae95f9437686285a6f5119c5aa9b
Xcode 4.3 compatibility checkin

Compilation on Xcode 4.3 does not handle inlined functions well and so the
compile fails.

This patch ensures that inlines are not used on that compiler.

Signed-off-by: Al Sutton <al@funkyandroid.com>
Fix the mac host build of e2fsprogs

Mac OS doesn't support the O_DIRECT flag, so use the F_NOCACHE
option of fcntl() instead.  Fix taken from the libext2 project
on soruceforge.

Change-Id: I1e88a95e53f1bbbd8dbcfc7aa43a27443dfd6807
Fix the mac build of e2fsprogs

Android builds for MacOS 10.5.  The new version version of e2fsprogs requires
posix_memalign(), which was added in MacOS 10.6.  Since MacOS doesn't provide
memalign() either, the only option is to use valloc().  This patch was inspired
by a patch to e2fsprogs that came from the macports port of e2fsprogs.

Change-Id: If1334ce409985c1bdba4384ada8ecbc3dec56d81
Merge "Xcode 4.3 compatibility checkin"
am 3e60e44f: Merge "Xcode 4.3 compatibility checkin"

* commit '3e60e44fae35febb9da905394698b21b45ad7301':
  Xcode 4.3 compatibility checkin
am a2e05ead: am 3e60e44f: Merge "Xcode 4.3 compatibility checkin"

* commit 'a2e05ead45f57030aa86a82bbaf891f28f7d5a58':
  Xcode 4.3 compatibility checkin
Fix e2fsck to run a full check if only the journal has recorded an error

If only the journal superblock had recorded an error, but not the ext4
superblock, e2fsck would mark the superblock as containing an error.
However, it was never flushed to disk before e2fsck restarted itself
after recovering the journal, and the full check didn't happen.

Change-Id: I2952b50d3f27c6b72b6167903dbc5a26c188df0c
am 8c157a2c: Fix e2fsck to run a full check if only the journal has recorded an error

* commit '8c157a2c73b27b3f3ae566be78279460a35ccbc1':
  Fix e2fsck to run a full check if only the journal has recorded an error
am 82ca75b8: am 8c157a2c: Fix e2fsck to run a full check if only the journal has recorded an error

* commit '82ca75b8ac7270a54aa5349a76e1df618023997d':
  Fix e2fsck to run a full check if only the journal has recorded an error
Better fix for marking fs err in superblock if err set in journal superblock.

The previous fix of flushing out the superblock after setting the
EXT2_ERROR_FS flag was erroneous because running the journal could have
updated the superblock (but not the in-memory copy the code referenced).
So instead, check the journal error conditions after running the journal
and freeing and re-opening the filesystem.  Also, make sure to flush
the error state of the superblock to disk before clearing the error state
of the journal.

Change-Id: Ia5cde1a367d86992c9bd3bca652a1289935d1380
am 46e96be1: Better fix for marking fs err in superblock if err set in journal superblock.

* commit '46e96be157785a3582844efb27f4eef38943400b':
  Better fix for marking fs err in superblock if err set in journal superblock.
am 1f0e651e: am 46e96be1: Better fix for marking fs err in superblock if err set in journal superblock.

* commit '1f0e651eb5b5d45bb68ef3902c40d9c32399bc9f':
  Better fix for marking fs err in superblock if err set in journal superblock.
Revert "Better fix for marking fs err in superblock if err set in journal superblock."

This reverts commit 46e96be157785a3582844efb27f4eef38943400b.
Revert "Fix e2fsck to run a full check if only the journal has recorded an error"

This reverts commit 8c157a2c73b27b3f3ae566be78279460a35ccbc1.
e2fsck: handle an already recovered journal with a non-zero s_error field

If a file system was remounted read-only after a file system
corruption is detected, and then that file system is mounted and
unmounted by the kernel, the journal would have been recovered, but
the kernel currently leaves the s_errno field still set.  This is
arguably a bug, since it has already propgated the non-zero s_errno
field to the file system superblock, where it will be retained until
e2fsck has been run.

However, e2fsck should handle this case for existing kernel by
checking the journal superblock's s_errno field even if journal
recovery is not required.

Without this commit, e2fsck would not notice anything wrong with the
file system, but a subsequent mount of the file system by the kernel
would mark the file system's superblock as needing checking (since the
journal's s_errno field would still be set), resulting an full e2fsck
run at the next reboot, which would find nothing wrong --- and then
when the file system was mounted, the whole cycle would repeat again.

I had seen reports of this in the past, but it wasn't until recently
that I realized exactly how this had come about, since normally e2fsck
would be run automatically before the file system is mounted again,
thus avoiding this problem.  However, a user using a rescue CD who
didn't run e2fsck before mounting the a file system in this condition
could trigger this situation, and unfortunately, with previous
versions of e2fsprogs and the kernel, there would be no way out no
matter what the user tried to do.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck: correctly propagate error from journal to superblock

If the file system is mounted read-only after a file system error has
been detected, the fact that an error occurred is written to the
journal.  This is important because while the journal is getting
replayed, the error indication in the superblock may very well get
overwritten.

Unfortunately, the code to propagate the error indication from the
journal to superblock was broken because this was being done before
the old file system handle is thrown away and the file system is
re-opened to ensure that no stale data is in the file system handle.
As a result, the error indication in the superblock was never written
out.

To fix this, we need to move the check if the journal's error
indicator has been set after the file system has been freed and
re-open.

Reported-by: Ken Sumrall <ksumrall@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
am a8948fce: Revert "Better fix for marking fs err in superblock if err set in journal superblock."

* commit 'a8948fce2be374a697f38bcefc8c33271b83b432':
  Revert "Better fix for marking fs err in superblock if err set in journal superblock."
am 97bd1b76: Revert "Fix e2fsck to run a full check if only the journal has recorded an error"

* commit '97bd1b76758fc5c78b000df9a8bc3840e4f1d31c':
  Revert "Fix e2fsck to run a full check if only the journal has recorded an error"