diff options
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 1993b7186cdb..8c804e24f96f 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -2222,7 +2222,11 @@ ftrace_regex_write(struct file *file, const char __user *ubuf, | |||
2222 | read++; | 2222 | read++; |
2223 | cnt--; | 2223 | cnt--; |
2224 | 2224 | ||
2225 | if (!(iter->flags & ~FTRACE_ITER_CONT)) { | 2225 | /* |
2226 | * If the parser haven't finished with the last write, | ||
2227 | * continue reading the user input without skipping spaces. | ||
2228 | */ | ||
2229 | if (!(iter->flags & FTRACE_ITER_CONT)) { | ||
2226 | /* skip white space */ | 2230 | /* skip white space */ |
2227 | while (cnt && isspace(ch)) { | 2231 | while (cnt && isspace(ch)) { |
2228 | ret = get_user(ch, ubuf++); | 2232 | ret = get_user(ch, ubuf++); |
@@ -2232,8 +2236,9 @@ ftrace_regex_write(struct file *file, const char __user *ubuf, | |||
2232 | cnt--; | 2236 | cnt--; |
2233 | } | 2237 | } |
2234 | 2238 | ||
2239 | /* only spaces were written */ | ||
2235 | if (isspace(ch)) { | 2240 | if (isspace(ch)) { |
2236 | file->f_pos += read; | 2241 | *ppos += read; |
2237 | ret = read; | 2242 | ret = read; |
2238 | goto out; | 2243 | goto out; |
2239 | } | 2244 | } |
@@ -2262,12 +2267,12 @@ ftrace_regex_write(struct file *file, const char __user *ubuf, | |||
2262 | if (ret) | 2267 | if (ret) |
2263 | goto out; | 2268 | goto out; |
2264 | iter->buffer_idx = 0; | 2269 | iter->buffer_idx = 0; |
2265 | } else | 2270 | } else { |
2266 | iter->flags |= FTRACE_ITER_CONT; | 2271 | iter->flags |= FTRACE_ITER_CONT; |
2272 | iter->buffer[iter->buffer_idx++] = ch; | ||
2273 | } | ||
2267 | 2274 | ||
2268 | 2275 | *ppos += read; | |
2269 | file->f_pos += read; | ||
2270 | |||
2271 | ret = read; | 2276 | ret = read; |
2272 | out: | 2277 | out: |
2273 | mutex_unlock(&ftrace_regex_lock); | 2278 | mutex_unlock(&ftrace_regex_lock); |