[ECOS] write to full RamFS file-system always return ENOERR
Andrew Lunn
andrew@lunn.ch
Thu Jan 8 17:24:00 GMT 2004
On Thu, Jan 08, 2004 at 02:55:10PM +0100, Vincent Catros wrote:
> Hello,
>
> Writing to a file on a full RamFS file-system always return "0" instead
> of ENOSPC.
>
> This is due to a bug in "ramfs_fo_write" which always return "ENOERR".
>
> You will find below a patch to fix this issue.
Thanks for the patch. Three request for your next patch:
1) It seems like your mailer, M$ Outlook, corrupted the patch,
probably wrapping lines etc. So i had to apply the patch by
hand. Please could you either use attachments or upgrade to a none
corrupting mail tool.
2) You made the diff in the ramfs src directory. Please could you do
it from the package directory in future. It just makes it clear
exactly which file should be patched.
3) Please include a ChangeLog entry. I added one for you this
time.
Here is what i committed.
Thanks
Andrew
Index: fs/ram//current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/ram/current/ChangeLog,v
retrieving revision 1.7
diff -u -r1.7 ChangeLog
--- fs/ram//current/ChangeLog 24 Feb 2003 14:22:17 -0000 1.7
+++ fs/ram//current/ChangeLog 8 Jan 2004 17:22:57 -0000
@@ -1,3 +1,8 @@
+2004-01-08 Vincent Catros <Vincent.Catros@elios-informatique.fr>
+
+ * src/ramfs.c (ramfs_fo_write): Return ENOSPC when the filesystem
+ is full.
+
2003-02-24 Jonathan Larmour <jifl@eCosCentric.com>
* cdl/ramfs.cdl: Fix doc link.
Index: fs/ram//current/src/ramfs.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/fs/ram/current/src/ramfs.c,v
retrieving revision 1.4
diff -u -r1.4 ramfs.c
--- fs/ram//current/src/ramfs.c 23 May 2002 23:01:39 -0000 1.4
+++ fs/ram//current/src/ramfs.c 8 Jan 2004 17:23:02 -0000
@@ -2089,6 +2089,7 @@
ramfs_node *node = (ramfs_node *)fp->f_data;
off_t pos = fp->f_offset;
ssize_t resid = uio->uio_resid;
+ int err = ENOERR;
int i;
// If the APPEND mode bit was supplied, force all writes to
@@ -2115,7 +2116,6 @@
cyg_uint8 *fbuf;
size_t bsize;
off_t l = len;
- int err;
err = findbuffer_node( node, pos, &fbuf, &bsize, true );
@@ -2153,7 +2153,7 @@
uio->uio_resid = resid;
fp->f_offset = pos;
- return ENOERR;
+ return err;
}
// -------------------------------------------------------------------------
More information about the Ecos-patches
mailing list