Subject: sysfs: write should return ENOBUFS

From: Dmitry Torokhov <[email-masked]>
Date: Fri, 19 Aug 2005 00:55:25 -0500

According to the SuS write() can not return ENOMEM, only ENOBUFS is allowed
(surprisingly read() is allowed to use both ENOMEM and ENOBUFS):

http://www.opengroup.org/onlinepubs/000095399/functions/write.html

Signed-off-by: Dmitry Torokhov <[email-masked]>
Signed-off-by: Greg Kroah-Hartman <[email-masked]>

---
 fs/sysfs/file.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- gregkh-2.6.orig/fs/sysfs/file.c	2005-08-19 00:17:45.000000000 -0700
+++ gregkh-2.6/fs/sysfs/file.c	2005-08-19 00:21:39.000000000 -0700
@@ -180,7 +180,7 @@ fill_write_buffer(struct sysfs_buffer * 
 	if (!buffer->page)
 		buffer->page = (char *)get_zeroed_page(GFP_KERNEL);
 	if (!buffer->page)
-		return -ENOMEM;
+		return -ENOBUFS;
 
 	if (count >= PAGE_SIZE)
 		count = PAGE_SIZE;