summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorArve Hjønnevåg <arve@android.com>2009-05-06 17:37:10 -0700
committerArve Hjønnevåg <arve@android.com>2009-05-07 17:58:08 -0700
commit37db7a3d4d75ce64b621484563d852a0813737e1 (patch)
tree3810b17b68c7fcadc61f82465ff11453fdcfc588 /fs
parent3a5c584e5a7bda713a5fd971ab351ee4b8b8930d (diff)
yaffs: Fix yaffs_file_write to not return -ENOSPC when there is nothing to write
yaffs_write_end may get called with copied == 0 if the requested write was interrupted by a signal, but user-space will not restart the write if -ENOSPC is returned. Signed-off-by: Arve Hjønnevåg <arve@android.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/yaffs2/yaffs_fs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/yaffs2/yaffs_fs.c b/fs/yaffs2/yaffs_fs.c
index 30ae7c7e259a..2288eeee2d77 100644
--- a/fs/yaffs2/yaffs_fs.c
+++ b/fs/yaffs2/yaffs_fs.c
@@ -1075,7 +1075,7 @@ static ssize_t yaffs_file_write(struct file *f, const char *buf, size_t n,
}
yaffs_GrossUnlock(dev);
- return nWritten == 0 ? -ENOSPC : nWritten;
+ return (!nWritten && n) ? -ENOSPC : nWritten;
}
/* Space holding and freeing is done to ensure we have space available for write_begin/end */