On Tue, May 07, 2019 at 05:48:47PM +0800, litaibaichina@xxxxxxxxx wrote: > I am running btrfs on a 4.4.178 kernel, I want to support a longer > file name, now the NAME_MAX is 255, can I just increase the NAME_MAX > macro and recompile the kernel to support longer file name ? I guess > I will break sth, but I am not sure what part will be broken. NAME_MAX is system-wide and defined in limits.h. This is not btrfs specific, you'd need to recompile the whole userspace too and who knows what would break. 255 fits into a byte and I think some filesystems use that as maximum that can be stored in their metdata, ie. not possible to change without wider thanges. Btrfs has space in btrfs_dir_item as it stores the name as 16bit number.
