From: Miklos Szeredi Date: Fri, 16 Dec 2016 10:02:57 +0000 (+0100) Subject: ovl: allow setting max size of redirect X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3ea22a71b65b6743a53e286ff4991a06b9d2597c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ovl: allow setting max size of redirect Add a module option to allow tuning the max size of absolute redirects. Default is 256. Size of relative redirects is naturally limited by the the underlying filesystem's max filename length (usually 255). Signed-off-by: Miklos Szeredi --- diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c index 4257a4a0ed72..b84d61b353cd 100644 --- a/fs/overlayfs/dir.c +++ b/fs/overlayfs/dir.c @@ -12,12 +12,18 @@ #include #include #include +#include #include #include #include #include #include "overlayfs.h" +static unsigned short ovl_redirect_max = 256; +module_param_named(redirect_max, ovl_redirect_max, ushort, 0644); +MODULE_PARM_DESC(ovl_redirect_max, + "Maximum length of absolute redirect xattr value"); + void ovl_cleanup(struct inode *wdir, struct dentry *wdentry) { int err; @@ -777,13 +783,11 @@ static bool ovl_can_move(struct dentry *dentry) !d_is_dir(dentry) || !ovl_type_merge_or_lower(dentry); } -#define OVL_REDIRECT_MAX 256 - static char *ovl_get_redirect(struct dentry *dentry, bool samedir) { char *buf, *ret; struct dentry *d, *tmp; - int buflen = OVL_REDIRECT_MAX + 1; + int buflen = ovl_redirect_max + 1; if (samedir) { ret = kstrndup(dentry->d_name.name, dentry->d_name.len,