diff options
author | NeilBrown <neilb@suse.com> | 2015-08-06 08:27:55 +1000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-04 19:42:22 +0100 |
commit | 65da3484d9be5664f5f7d2378e438bb2794f40b8 (patch) | |
tree | 886ed45dc33cdfd927a395fceccbe2bd3d5cc4b5 /lib | |
parent | cfcf6a91aa0d59faddb423a65230eea7f230d057 (diff) | |
download | linux-65da3484d9be5664f5f7d2378e438bb2794f40b8.tar.gz linux-65da3484d9be5664f5f7d2378e438bb2794f40b8.tar.bz2 linux-65da3484d9be5664f5f7d2378e438bb2794f40b8.zip |
sysfs: correctly handle short reads on PREALLOC attrs.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions