diff options
-rw-r--r-- | fs/overlayfs/dir.c | 10 |
1 files changed, 7 insertions, 3 deletions
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 @@ | |||
12 | #include <linux/xattr.h> | 12 | #include <linux/xattr.h> |
13 | #include <linux/security.h> | 13 | #include <linux/security.h> |
14 | #include <linux/cred.h> | 14 | #include <linux/cred.h> |
15 | #include <linux/module.h> | ||
15 | #include <linux/posix_acl.h> | 16 | #include <linux/posix_acl.h> |
16 | #include <linux/posix_acl_xattr.h> | 17 | #include <linux/posix_acl_xattr.h> |
17 | #include <linux/atomic.h> | 18 | #include <linux/atomic.h> |
18 | #include <linux/ratelimit.h> | 19 | #include <linux/ratelimit.h> |
19 | #include "overlayfs.h" | 20 | #include "overlayfs.h" |
20 | 21 | ||
22 | static unsigned short ovl_redirect_max = 256; | ||
23 | module_param_named(redirect_max, ovl_redirect_max, ushort, 0644); | ||
24 | MODULE_PARM_DESC(ovl_redirect_max, | ||
25 | "Maximum length of absolute redirect xattr value"); | ||
26 | |||
21 | void ovl_cleanup(struct inode *wdir, struct dentry *wdentry) | 27 | void ovl_cleanup(struct inode *wdir, struct dentry *wdentry) |
22 | { | 28 | { |
23 | int err; | 29 | int err; |
@@ -777,13 +783,11 @@ static bool ovl_can_move(struct dentry *dentry) | |||
777 | !d_is_dir(dentry) || !ovl_type_merge_or_lower(dentry); | 783 | !d_is_dir(dentry) || !ovl_type_merge_or_lower(dentry); |
778 | } | 784 | } |
779 | 785 | ||
780 | #define OVL_REDIRECT_MAX 256 | ||
781 | |||
782 | static char *ovl_get_redirect(struct dentry *dentry, bool samedir) | 786 | static char *ovl_get_redirect(struct dentry *dentry, bool samedir) |
783 | { | 787 | { |
784 | char *buf, *ret; | 788 | char *buf, *ret; |
785 | struct dentry *d, *tmp; | 789 | struct dentry *d, *tmp; |
786 | int buflen = OVL_REDIRECT_MAX + 1; | 790 | int buflen = ovl_redirect_max + 1; |
787 | 791 | ||
788 | if (samedir) { | 792 | if (samedir) { |
789 | ret = kstrndup(dentry->d_name.name, dentry->d_name.len, | 793 | ret = kstrndup(dentry->d_name.name, dentry->d_name.len, |