This patch causes an error to be returned if the user attempts to write a
sysfs file at a nonzero offset. Because sysfs store methods do not
support a position parameter, the behavior in this case would be
unpredictable. Thus, we return an error, because at least now we're
consistent.
This patch generated from 2.6.11-rc1.
Now with tabs.
Signed-off-by: Mitch Williams <[email protected]>
diff -urpN -X dontdiff linux-2.6.11-clean/fs/sysfs/file.c linux-2.6.11/fs/sysfs/file.c
--- linux-2.6.11-clean/fs/sysfs/file.c 2004-12-24 13:33:50.000000000 -0800
+++ linux-2.6.11/fs/sysfs/file.c 2005-01-25 10:47:15.000000000 -0800
@@ -232,6 +232,8 @@ sysfs_write_file(struct file *file, cons
{
struct sysfs_buffer * buffer = file->private_data;
+ if (*ppos > 0)
+ return -EIO;
down(&buffer->sem);
count = fill_write_buffer(buffer,buf,count);
if (count > 0)