]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
sysfs: fix sysfs_write_file for bin file
authorMing Lei <ming.lei@canonical.com>
Wed, 23 Oct 2013 13:44:53 +0000 (21:44 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 5 Nov 2013 21:32:18 +0000 (22:32 +0100)
commita0a4cbb171c223d60e080792b2e1e34dd529423e
tree7a9e254665f18f890c37555fb1c83d611441c60b
parentadd733598b7115647e3f07e3dbbf142749f69912
sysfs: fix sysfs_write_file for bin file

Before patch(sysfs: prepare path write for unified regular / bin
file handling), when size of bin file is zero, writting still can
continue, but this patch changes the behaviour.

The worse thing is that firmware loader is broken by this patch,
and user space application can't write to firmware bin file any more
because both firmware loader and drivers can't know at advance how
large the firmware file is and have to set its initialized size as
zero.

This patch fixes the problem and keeps behaviour of writting to bin
as before.

Reported-by: Lothar Waßmann <LW@karo-electronics.de>
Tested-by: Lothar Waßmann <LW@karo-electronics.de>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/sysfs/file.c