[Yaffs] YAFFS2 commit_write return 0 for success

Todd Poynor tpoynor at mvista.com
Wed Oct 19 08:10:56 BST 2005


Return zero, not number of bytes written, for success (and non-zero for
error) in the commit_write method.  Some callers, notably the loopback
mount driver, treat non-zero return as an error.

Signed-off-by: Todd Poynor <tpoynor at mvista.com>

Index: yaffs_fs.c
===================================================================
RCS file: /home/aleph1/cvs/yaffs2/yaffs_fs.c,v
retrieving revision 1.31
diff -u -r1.31 yaffs_fs.c
--- yaffs_fs.c	21 Sep 2005 01:14:03 -0000	1.31
+++ yaffs_fs.c	19 Oct 2005 06:58:36 -0000
@@ -604,9 +604,10 @@
 	}
 
 	T(YAFFS_TRACE_OS,
-	  (KERN_DEBUG "yaffs_commit_write returning %d\n", nWritten));
+	  (KERN_DEBUG "yaffs_commit_write returning %d\n", 
+	   nWritten == nBytes ? 0 : -1));
 
-	return nWritten;
+	return nWritten == nBytes ? 0 : -1;
 
 }
 



More information about the yaffs mailing list