From: Vladimir Zapolskiy Date: Wed, 24 Sep 2014 15:21:04 +0000 (+0300) Subject: fs: sysfs: return EGBIG on write if offset is larger than file size X-Git-Tag: omap-for-v3.19/fixes-rc1~85^2~19 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0936896056365349afa867c16e9f9100a6707cbf;p=pandora-kernel.git fs: sysfs: return EGBIG on write if offset is larger than file size According to the user expectations common utilities like dd or sh redirection operator > should work correctly over binary files from sysfs. At the moment doing excessive write can not be completed: write(1, "\0\0\0\0\0\0\0\0", 8) = 4 write(1, "\0\0\0\0", 4) = 0 write(1, "\0\0\0\0", 4) = 0 write(1, "\0\0\0\0", 4) = 0 ... Fix the problem by returning EFBIG described in man 2 write. Signed-off-by: Vladimir Zapolskiy Cc: Greg Kroah-Hartman Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed