BACKPORT: fs: limit filesystem stacking depth

BACKPORT-NOTE: fs/overlayfs/super.c did not exist in this kernel version.
Minor conflict resolution in fs.h super_block struct.

Add a simple read-only counter to super_block that indicates how deep this
is in the stack of filesystems.  Previously ecryptfs was the only stackable
filesystem and it explicitly disallowed multiple layers of itself.

Overlayfs, however, can be stacked recursively and also may be stacked
on top of ecryptfs or vice versa.

To limit the kernel stack usage we must limit the depth of the
filesystem stack.  Initially the limit is set to 2.

Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
(cherry picked from commit 69c433ed2ecd2d3264efd7afec4439524b319121)
Signed-off-by: Bernie Thompson <bhthompson@google.com>

Change-Id: I92e915a3f75cb8e40b32d9f3cbdf89e571617f85
(cherry picked from commit 754dd1a441b5fec333828e579dbfdccd58436a9a)
Signed-off-by: Bernie Thompson <bhthompson@google.com>
Reviewed-on: https://chromium-review.googlesource.com/469112
Commit-Ready: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
(cherry picked from commit dd3d87e7865a4b9ef5bcf9248e0f9ea5c543f031)
Reviewed-on: https://chromium-review.googlesource.com/471389
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Queue: Bernie Thompson <bhthompson@chromium.org>
2 files changed