lkml.org 
[lkml]   [2017]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/3] livepatch: Add force sysfs attribute
On Thu, Aug 10, 2017 at 12:48:13PM +0200, Miroslav Benes wrote:
> +static ssize_t force_store(struct kobject *kobj, struct kobj_attribute *attr,
> + const char *buf, size_t count)
> +{
> + /*
> + * klp_mutex lock is not grabbed here intentionally. It is not really
> + * needed. The race window is harmless and grabbing the lock would only
> + * hold the action back.
> + */
> + if (!klp_transition_patch) {
> + pr_info("no patching in progress, forced action ineffective\n");
> + return -EINVAL;
> + }
> +
> + return -EINVAL;
> +}

I think this is really a minor issue, and the -EINVAL is enough. As the
comment says, the race window is harmless. So I'd say there's no need
to scare the user with a printk.

--
Josh

\
 
 \ /
  Last update: 2017-08-11 23:14    [W:0.107 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site