Why is the length of max mount option a page size??

From: Jungsub Shin
Date: Mon May 21 2018 - 12:47:02 EST


Hi, now i'm interested in mount lenght of max mount option.
I anaylsis ksys_mount() function in /fs/namespace.c. and find out
the length of max mount option is a page size (4096 bytes).

I know that almost mount option short and page size is enough to
contain almost mount options. but because of options for
unionfs(overlay, aufs), lenght of mount option could be exceed it
and cut.

I suffer this problem with aufs. aufs's branch option is cut and
fail to aufs mount. I know that aufs is not offical fs in linux,
but overlay fs now support multi layer mount option and could be
suffer the same problem.

I think the best is dynamic allocate mount option's kernel memory.
but I'm only have shallow knowlege of kernel, I can't guess it.
And I think If the length of mount option cannot exceed a page size,
kernel must leave warning messsage about lenght and return err.
copy_mount_options() function seems to done this.