1
0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2026-01-11 00:50:21 +00:00

Change since last update:

- Don't bother with s_stack_depth increasing to band-aid
    regressions in some composefs mount setups (EROFS + ovl^2)
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEQ0A6bDUS9Y+83NPFUXZn5Zlu5qoFAmlh3l4RHHhpYW5nQGtl
 cm5lbC5vcmcACgkQUXZn5Zlu5qry/A/+M2JIV6Cu9IW2MZ/8X+mlTK0NOP/fKq1z
 tbtcTvkIXP31L+/ANOPRRlyYC+mNLFvUbig2nbKChkriQxX7Sw/oy9qCOKLUCwmN
 bV1Hv6kbAAAI/+G2DOSUw8pgvrgbT/7cj3EYQHslwdkkgSI/6IjZggU/KjrtAK32
 xlXe2bNR6ATfsUIP8URLdqLEwp2U/mzEbJTa5FhrWYmsDyFWSYbe9g3GHKjO1v/V
 gH/RYl1GETNccuGWQBQOagSWx4tUQZgvhnabPTwT31UyNnAR6+uRDS94zBeLzbku
 6f0MiK69ZsbB7ToelKw0Vj5nWCAFnAIOnMKM0TDY7uuOXlhUx8YOvcrD7/9b0mZ1
 YVq14vKEhZKVj5s9dPu78nq+64UkHwBIhbs95ssu+P1HymyzGtCxaWkVsKkMQRzs
 vK0uoTqfdBgttF7e4mQZEn9KA0VyWIwoGmNlCyABKfuRfvqK/SxX1NFYfl8Zhn++
 b7ifrjuzLG+c0kf4VBWeauIjga+m7NBEqGgCfqulZp9CnWrmiA/8RsevUZLUAhFf
 nGkhBX3IlrZFfsD/gzyh1NWtLlLkmFaZe65pR3cJSJi3+Dl+1pqa0R6fNZAH0WKZ
 B7+VlLPyi3NtHACXWEV5Oqv8qh2G28Yz/54afMzYI7hetUsApVUKbler49qNZEaG
 BbV+G77l7fY=
 =irvd
 -----END PGP SIGNATURE-----

Merge tag 'erofs-for-6.19-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs

Pull erofs fix from Gao Xiang:

 - Don't increase s_stack_depth which caused regressions in some
   composefs mount setups (EROFS + ovl^2)

   Instead just allow one extra unaccounted fs stacking level for
   straightforward cases.

* tag 'erofs-for-6.19-rc5-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs:
  erofs: don't bother with s_stack_depth increasing for now
This commit is contained in:
Linus Torvalds 2026-01-09 19:34:50 -10:00
commit b6151c4e60

View File

@ -644,14 +644,20 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
* fs contexts (including its own) due to self-controlled RO
* accesses/contexts and no side-effect changes that need to
* context save & restore so it can reuse the current thread
* context. However, it still needs to bump `s_stack_depth` to
* avoid kernel stack overflow from nested filesystems.
* context.
* However, we still need to prevent kernel stack overflow due
* to filesystem nesting: just ensure that s_stack_depth is 0
* to disallow mounting EROFS on stacked filesystems.
* Note: s_stack_depth is not incremented here for now, since
* EROFS is the only fs supporting file-backed mounts for now.
* It MUST change if another fs plans to support them, which
* may also require adjusting FILESYSTEM_MAX_STACK_DEPTH.
*/
if (erofs_is_fileio_mode(sbi)) {
sb->s_stack_depth =
file_inode(sbi->dif0.file)->i_sb->s_stack_depth + 1;
if (sb->s_stack_depth > FILESYSTEM_MAX_STACK_DEPTH) {
erofs_err(sb, "maximum fs stacking depth exceeded");
inode = file_inode(sbi->dif0.file);
if ((inode->i_sb->s_op == &erofs_sops && !sb->s_bdev) ||
inode->i_sb->s_stack_depth) {
erofs_err(sb, "file-backed mounts cannot be applied to stacked fses");
return -ENOTBLK;
}
}