[PATCH] mm: return ENOBUFS instead of ENOMEM in generic_file_buffered_write

Pekka J Enberg
2005-08-23T08:46:50Z

As noticed by Dmitry Torokhov, write() can not return ENOMEM:

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

Therefore fixup generic_file_buffered_write() in mm/filemap.c (pointed out by
Nathan Scott).

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---

filemap.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

Index: 2.6-mm/mm/filemap.c
===================================================================
--- 2.6-mm.orig/mm/filemap.c
+++ 2.6-mm/mm/filemap.c
@@ -1942,7 +1942,7 @@ generic_file_buffered_write(struct kiocb

page = __grab_cache_page(mapping,index,&cached_page,&lru_pvec);
if (!page) {
- status = -ENOMEM;
+ status = -ENOBUFS;
break;
}