android_kernel_motorola_sm6225/fs/kernfs
Tejun Heo 18493bac1a kernfs: fix ino wrap-around detection
commit e23f568aa63f64cd6b355094224cc9356c0f696b upstream.

When the 32bit ino wraps around, kernfs increments the generation
number to distinguish reused ino instances.  The wrap-around detection
tests whether the allocated ino is lower than what the cursor but the
cursor is pointing to the next ino to allocate so the condition never
triggers.

Fix it by remembering the last ino and comparing against that.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Fixes: 4a3ef68aca ("kernfs: implement i_generation")
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: stable@vger.kernel.org # v4.14+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-12-13 08:52:43 +01:00
..
dir.c kernfs: fix ino wrap-around detection 2019-12-13 08:52:43 +01:00
file.c
inode.c
Kconfig
kernfs-internal.h
Makefile
mount.c
symlink.c kernfs: Fix range checks in kernfs_get_target_path 2019-11-20 18:46:47 +01:00