[PATCH] NFS: fix fsync return code

From: Takashi Iwai
Date: Mon Aug 16 2010 - 06:25:19 EST


With the commit af7fa16506bf9b6323e862a61e14c20555152bb3
NFS: Fix up the fsync code
fsync returns a postive number for success incorrectly because now it
calls nfs_commit_inode() which returns the number of pages.

This patch makes fsync simply ignore a positive return value.

Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
---
fs/nfs/file.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index 2d141a7..eb51bd6 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -323,7 +323,7 @@ nfs_file_fsync(struct file *file, int datasync)
have_error |= test_bit(NFS_CONTEXT_ERROR_WRITE, &ctx->flags);
if (have_error)
ret = xchg(&ctx->error, 0);
- if (!ret)
+ if (!ret && status < 0)
ret = status;
return ret;
}
--
1.7.2.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/