[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170330160411.06fb19fa0f80eafe7190d045@linux-foundation.org>
Date: Thu, 30 Mar 2017 16:04:11 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Dmitry Vyukov <dvyukov@...gle.com>
Cc: akinobu.mita@...il.com, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Subject: Re: [PATCH v2] fault-inject: support systematic fault injection
On Tue, 28 Mar 2017 15:01:28 +0200 Dmitry Vyukov <dvyukov@...gle.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?
Powered by blists - more mailing lists