]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix reading leftover inlined symlinks
authorZhang Yi <yi.zhang@huawei.com>
Thu, 30 Jun 2022 09:01:00 +0000 (17:01 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 3 Aug 2022 03:37:50 +0000 (23:37 -0400)
commitdec8980573d56795bd10396d0155d9f7f4d848e5
tree3bb1b03bbc9eb3a7e9dbdd205dd6dd25a832ccd6
parent17aa3251ca69d5289712bca6b152158fdac13263
ext4: fix reading leftover inlined symlinks

Since commit 0f488c1e59f5 ("ext4: convert symlink external data block
mapping to bdev"), create new symlink with inline_data is not supported,
but it missing to handle the leftover inlined symlinks, which could
cause below error message and fail to read symlink.

 ls: cannot read symbolic link 'foo': Structure needs cleaning

 EXT4-fs error (device sda): ext4_map_blocks:605: inode #12: block
 2021161080: comm ls: lblock 0 mapped to illegal pblock 2021161080
 (length 1)

Fix this regression by adding ext4_read_inline_link(), which read the
inline data directly and convert it through a kmalloced buffer.

Fixes: 0f488c1e59f5 ("ext4: convert symlink external data block mapping to bdev")
Cc: stable@kernel.org
Reported-by: Torge Matthies <openglfreak@googlemail.com>
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Tested-by: Torge Matthies <openglfreak@googlemail.com>
Link: https://lore.kernel.org/r/20220630090100.2769490-1-yi.zhang@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/ext4.h
fs/ext4/inline.c
fs/ext4/symlink.c