On 8/23/05, Nathan Scott <[email protected]> wrote:
> FWIW, all filesystems using the generic page cache routines are able
> to return this - see mm/filemap.c -> generic_file_buffered_write...
I don't think it makes much sense to fix this in individual
filesystems as many functions returning -NOMEM can be used in other
paths as well where they're ok.
Andrew, please consider picking this up for -mm. (I've included it as
an attachment as well as gmail will surely mess up the patch. Sorry.)
Pekka
[PATCH] VFS: return ENOBUFS instead of ENOMEM for vfs_write()
As noticed by Dmitry Torokhov, write() can not return ENOMEM:
http://www.opengroup.org/onlinepubs/000095399/functions/write.html
Currently almost all filesystems can return -ENOMEM due to
generic_file_buffered_write() in mm/filemap.c so filter out the invalid
error code in vfs_write().
Signed-off-by: Pekka Enberg <[email protected]>
---
read_write.c | 2 ++
1 files changed, 2 insertions(+)
Index: 2.6-mm/fs/read_write.c
===================================================================
--- 2.6-mm.orig/fs/read_write.c
+++ 2.6-mm/fs/read_write.c
@@ -310,6 +310,8 @@ ssize_t vfs_write(struct file *file, con
}
}
+ if (ret == -ENOMEM)
+ ret = -ENOBUFS;
return ret;
}
[PATCH] VFS: return ENOBUFS instead of ENOMEM for vfs_write()
As noticed by Dmitry Torokhov, write() can not return ENOMEM:
http://www.opengroup.org/onlinepubs/000095399/functions/write.html
Currently almost all filesystems can return -ENOMEM due to
generic_file_buffered_write() in mm/filemap.c so filter out the invalid
error code in vfs_write().
Signed-off-by: Pekka Enberg <[email protected]>
---
read_write.c | 2 ++
1 files changed, 2 insertions(+)
Index: 2.6-mm/fs/read_write.c
===================================================================
--- 2.6-mm.orig/fs/read_write.c
+++ 2.6-mm/fs/read_write.c
@@ -310,6 +310,8 @@ ssize_t vfs_write(struct file *file, con
}
}
+ if (ret == -ENOMEM)
+ ret = -ENOBUFS;
return ret;
}
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
|
|