From: 黄涛 Date: Sat, 30 Jul 2011 14:45:13 +0000 (+0800) Subject: Revert "yaffs: Fix yaffs_file_write to not return -ENOSPC when there is nothing to... X-Git-Tag: firefly_0821_release~9932 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2c3912086af7c5441d09cc9e2f4fdc52c7d86275;p=firefly-linux-kernel-4.4.55.git Revert "yaffs: Fix yaffs_file_write to not return -ENOSPC when there is nothing to write" This reverts commit 567940aa0a576440a6f64b8bb2517c378f6b6886. --- diff --git a/fs/yaffs2/yaffs_fs.c b/fs/yaffs2/yaffs_fs.c index 2288eeee2d77..30ae7c7e259a 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 && n) ? -ENOSPC : nWritten; + return nWritten == 0 ? -ENOSPC : nWritten; } /* Space holding and freeing is done to ensure we have space available for write_begin/end */