]> git.itanic.dy.fi Git - linux-stable/commit
f2fs: factor out victim_entry usage from general rb_tree use
authorJaegeuk Kim <jaegeuk@kernel.org>
Fri, 10 Mar 2023 18:04:26 +0000 (10:04 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 12:01:59 +0000 (14:01 +0200)
commit72f9a761b03514b66610e94022e4a70756b488b4
tree837fe582b7ae647088df03664b6a294bb5cb168f
parent6e6df8bc3dc0187c49e2677340231703be0239cb
f2fs: factor out victim_entry usage from general rb_tree use

commit 043d2d00b44310f84c0593c63e51fae88c829cdd upstream.

Let's reduce the complexity of mixed use of rb_tree in victim_entry from
extent_cache and discard_cmd.

This should fix arm32 memory alignment issue caused by shared rb_entry.

[struct victim_entry]              [struct rb_entry]
[0] struct rb_node rb_node;        [0] struct rb_node rb_node;
                                       union {
                                         struct {
                                           unsigned int ofs;
                                           unsigned int len;
                                         };
[16] unsigned long long mtime;     [12] unsigned long long key;
                                       } __packed;

Cc: <stable@vger.kernel.org>
Fixes: 093749e296e2 ("f2fs: support age threshold based garbage collection")
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/extent_cache.c
fs/f2fs/f2fs.h
fs/f2fs/gc.c
fs/f2fs/gc.h
fs/f2fs/segment.c