Re: simplify ext4_sb_read_encoding regression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 14, 2023 at 04:01:47PM -0700, William McVicker wrote:
> I believe I figured out what is going on here since I am hitting a similar
> issue with CONFIG_UNICODE. If you take a look at the .config from Stephen's
> message, you'll see that he sets:
> 
>   CONFIG_TRIM_UNUSED_KSYMS=y
>   CONFIG_UNUSED_KSYMS_WHITELIST=""
> 
> When trimming is enabled, kbuild will strip all exported symbols that are not
> listed in the whitelist. As a result, when utf8-core.c calls:
> 
>   um->tables = symbol_request(utf8_data_table);
> 
> it will fail since `utf8_data_table` doesn't exist in the exported section of
> the kernel symbol table. For me on Android, this leads to the userdata
> partition failing to mount. To be clear, this happens when CONFIG_UNICODE=y.
> 
> One question I have is -- Why are we using symbol_request()/symbol_put() when
> `utf8_data_table` is exported? Why can't we directly reference the
> `utf8_data_table` symbol?

We could, but that would require to always include the huge utf8
case folding tables into the kernel.

The idea here is that there is no sane way to move the utf8 handling code
into a module that only gets used some times, because common file systems
like ext4 call into it.  But they only actually use the case folding for
the very rare case of someone actually using the case insensitive file
system feature, so we only load the module containing the table for that
case.

> If we need to use symbol_request() when CONFIG_UNICODE=m, then can we apply the
> below patch to fix this when CONFIG_UNICODE=y? I have verified this works for
> me with CONFIG_UNICODE=y and CONFIG_TRIM_UNUSED_KSYMS=y.

We could do that, but it seems a bit ugly.  What prevents symbol_request
from working properly for this case in your setup?



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux