lkml.org 
[lkml]   [2015]   [Aug]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sysfs: correctly handle short reads on PREALLOC attrs.
On Thu, Aug 06, 2015 at 08:27:55AM +1000, NeilBrown wrote:
>
>
> attributes declared with __ATTR_PREALLOC use sysfs_kf_read()
> which ignores the 'count' arg.
> So a 1-byte read request can return more bytes than that.
>
> This is seen with the 'dash' shell when 'read' is used on
> some 'md' sysfs attributes.
>
> So only return the 'min' of count and the attribute length.
>
> Signed-off-by: NeilBrown <neilb@suse.com>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

--
tejun


\
 
 \ /
  Last update: 2015-08-06 16:21    [W:0.062 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site