Patch from Todd Poyner (tpoynor@mvista.com)
[yaffs2.git] / yaffs_fs.c
index fcf111e43af1f5390eb81dc8f7494a4b1a05ca70..873de3e698d2fe059d1a3f2e40127ec02dafee81 100644 (file)
@@ -31,7 +31,7 @@
  */
 
 const char *yaffs_fs_c_version =
-    "$Id: yaffs_fs.c,v 1.30 2005-09-20 05:22:43 charles Exp $";
+    "$Id: yaffs_fs.c,v 1.32 2005-10-27 07:22:49 marty Exp $";
 extern const char *yaffs_guts_c_version;
 
 #include <linux/config.h>
@@ -604,9 +604,10 @@ static int yaffs_commit_write(struct file *f, struct page *pg, unsigned offset,
        }
 
        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;
 
 }
 
@@ -1133,8 +1134,10 @@ static int yaffs_rename(struct inode *old_dir, struct dentry *old_dentry,
        yaffs_GrossUnlock(dev);
 
        if (retVal == YAFFS_OK) {
-               new_dentry->d_inode->i_nlink--;
-               mark_inode_dirty(new_dentry->d_inode);
+               if(target) {
+                       new_dentry->d_inode->i_nlink--;
+                       mark_inode_dirty(new_dentry->d_inode);
+               }
 
                return 0;
        } else {