linux-stable/fs/kernfs
Tejun Heo dc9a5fd2f3 kernfs: fix ino wrap-around detection
commit e23f568aa6 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-17 20:38:50 +01:00
..
dir.c kernfs: fix ino wrap-around detection 2019-12-17 20:38:50 +01:00
file.c kernfs: fix regression in kernfs_fop_write caused by wrong type 2018-02-16 20:22:59 +01:00
inode.c kernfs: introduce kernfs_node_id 2017-07-29 09:00:03 -06:00
Kconfig kernfs: add CONFIG_KERNFS 2014-02-07 16:08:57 -08:00
kernfs-internal.h kernfs: don't set dentry->d_fsdata 2017-07-29 09:00:03 -06:00
Makefile
mount.c fix cgroup_do_mount() handling of failure exits 2019-03-23 14:35:18 +01:00
symlink.c kernfs: Fix range checks in kernfs_get_target_path 2019-11-20 18:00:02 +01:00