|
@@ -2278,7 +2278,11 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
|
|
read++;
|
|
read++;
|
|
cnt--;
|
|
cnt--;
|
|
|
|
|
|
- if (!(iter->flags & ~FTRACE_ITER_CONT)) {
|
|
|
|
|
|
+ /*
|
|
|
|
+ * If the parser haven't finished with the last write,
|
|
|
|
+ * continue reading the user input without skipping spaces.
|
|
|
|
+ */
|
|
|
|
+ if (!(iter->flags & FTRACE_ITER_CONT)) {
|
|
/* skip white space */
|
|
/* skip white space */
|
|
while (cnt && isspace(ch)) {
|
|
while (cnt && isspace(ch)) {
|
|
ret = get_user(ch, ubuf++);
|
|
ret = get_user(ch, ubuf++);
|
|
@@ -2288,8 +2292,9 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
|
|
cnt--;
|
|
cnt--;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* only spaces were written */
|
|
if (isspace(ch)) {
|
|
if (isspace(ch)) {
|
|
- file->f_pos += read;
|
|
|
|
|
|
+ *ppos += read;
|
|
ret = read;
|
|
ret = read;
|
|
goto out;
|
|
goto out;
|
|
}
|
|
}
|
|
@@ -2319,12 +2324,12 @@ ftrace_regex_write(struct file *file, const char __user *ubuf,
|
|
if (ret)
|
|
if (ret)
|
|
goto out;
|
|
goto out;
|
|
iter->buffer_idx = 0;
|
|
iter->buffer_idx = 0;
|
|
- } else
|
|
|
|
|
|
+ } else {
|
|
iter->flags |= FTRACE_ITER_CONT;
|
|
iter->flags |= FTRACE_ITER_CONT;
|
|
|
|
+ iter->buffer[iter->buffer_idx++] = ch;
|
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
|
- file->f_pos += read;
|
|
|
|
-
|
|
|
|
|
|
+ *ppos += read;
|
|
ret = read;
|
|
ret = read;
|
|
out:
|
|
out:
|
|
mutex_unlock(&ftrace_regex_lock);
|
|
mutex_unlock(&ftrace_regex_lock);
|