From: Andrew Morton <akpm@linux-foundation.org>
To: Dmitry Vyukov <dvyukov@google.com>
Cc: akinobu.mita@gmail.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH v2] fault-inject: support systematic fault injection
Date: Thu, 30 Mar 2017 16:04:11 -0700 [thread overview]
Message-ID: <20170330160411.06fb19fa0f80eafe7190d045@linux-foundation.org> (raw)
In-Reply-To: <20170328130128.101773-1-dvyukov@google.com>
On Tue, 28 Mar 2017 15:01:28 +0200 Dmitry Vyukov <dvyukov@google.com> wrote:
> +static ssize_t proc_fail_nth_write(struct file *file, const char __user *buf,
> + size_t count, loff_t *ppos)
> +{
> + struct task_struct *task;
> + int err, n;
> +
> + task = get_proc_task(file_inode(file));
> + if (!task)
> + return -ESRCH;
> + put_task_struct(task);
> + if (task != current)
> + return -EPERM;
> + err = kstrtoint_from_user(buf, count, 10, &n);
> + if (err)
> + return err;
> + if (n < 0 || n == INT_MAX)
> + return -EINVAL;
> + current->fail_nth = n + 1;
> + return len;
> +}
Well that didn't go too well.
--- a/fs/proc/base.c~fault-inject-support-systematic-fault-injection-fix
+++ a/fs/proc/base.c
@@ -1377,7 +1377,7 @@ static ssize_t proc_fail_nth_write(struc
if (n < 0 || n == INT_MAX)
return -EINVAL;
current->fail_nth = n + 1;
- return len;
+ return count;
}
static ssize_t proc_fail_nth_read(struct file *file, char __user *buf,
Are you sure I merged the correct version of this?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2017-03-30 23:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-28 13:01 [PATCH v2] fault-inject: support systematic fault injection Dmitry Vyukov
2017-03-28 21:40 ` Andrew Morton
2017-03-28 23:41 ` Akinobu Mita
2017-03-30 23:04 ` Andrew Morton [this message]
2017-04-04 14:57 ` Akinobu Mita
2017-04-06 18:33 ` Michal Hocko
2017-04-07 16:47 ` Akinobu Mita
2017-04-08 17:40 ` Dmitry Vyukov
2017-04-09 10:39 ` Akinobu Mita
2017-05-24 10:22 ` Dmitry Vyukov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170330160411.06fb19fa0f80eafe7190d045@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=akinobu.mita@gmail.com \
--cc=dvyukov@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).