UPSTREAM: ext4: fix reading new encrypted symlinks on no-journal file systems

On a filesystem with no journal, a symlink longer than about 32
characters (exact length depending on padding for encryption) could not
be followed or read immediately after being created in an encrypted
directory.  This happened because when the symlink data went through the
delayed allocation path instead of the journaling path, the symlink was
incorrectly detected as a "fast" symlink rather than a "slow" symlink
until its data was written out.

To fix this, disable delayed allocation for symlinks, since there is
no benefit for delayed allocation anyway.

Reported-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>

BUG=b:37189798
TEST=compile.

(cherry picked from commit 4db0d88e2ebc4f47092adc01f9885a43ad748995)
Change-Id: Ibb40cacfa62c6d2960092bc81bc335a70095dbf0
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/474992
Commit-Ready: Gwendal Grignou <gwendal@google.com>
Tested-by: Gwendal Grignou <gwendal@google.com>
Reviewed-by: Gwendal Grignou <gwendal@google.com>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
1 file changed