diff options
| author | 2026-10-26 17:22:17 +0800 | |
|---|---|---|
| committer | 2026-10-26 11:51:05 +0100 | |
| commit | aafea970fb04633e22c7ad74cba4caf563c6d6a9 (patch) | |
| tree | 93d4a542d43ed48389ee80c289f4984ef925af24 /scripts/Makefile.thinlto | |
| parent | erofs: fix metadata reads at the end of file-backed images (diff) | |
erofs: fix disallowing superblock_share if device= is set
superblock_share together with device= is rejected in
erofs_fc_fill_super():
if (test_opt(&sbi->opt, SUPERBLOCK_SHARE) &&
sbi->devs->extra_devices)
return -EINVAL;
but extra_devices is kept in sbi->devs, not in sbi->opt, and
erofs_sb_share_test_super() compares only the backing inode, the
fsoffset and sbi->opt. So once the image is mounted with
superblock_share, a second mount with superblock_share,device= matches
that superblock and get_tree_super() reuses it without calling
fill_super() at all.
The same command line therefore either fails with -EINVAL or succeeds
with device= quietly dropped, depending on whether a compatible mount
already exists.
Refuse to match a context that brought device= options, so that it gets
a superblock of its own and fill_super() decides as it does today.
Only the incoming context can be tested: a shared superblock may have
extra_devices set itself, because erofs_scan_devices() fills the device
table from the image when no device= was given.
Fixes: cd4108319bb3 ("erofs: reuse superblock for file-backed mounts")
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
Reviewed-by: Gao Xiang <xiang@kernel.org>
Signed-off-by: Gao Xiang (Docker) <xiang@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
