summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@hq.newdream.net>2010-02-23 18:16:23 +0000
committerSage Weil <sage@newdream.net>2010-02-23 14:26:36 -0800
commit88d892a37fc231ab2aa3b1c40ca9d67224616594 (patch)
tree48ce9b4645716848a20852f552efa8cad87eabe2 /fs
parenta1ea787c7b6ec036d169d84e08cca7b6e399ba70 (diff)
downloadop-kernel-dev-88d892a37fc231ab2aa3b1c40ca9d67224616594.zip
op-kernel-dev-88d892a37fc231ab2aa3b1c40ca9d67224616594.tar.gz
ceph: don't clobber write return value when using O_SYNC
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/ceph/file.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 2c4ae44..88932c9 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -807,7 +807,7 @@ static ssize_t ceph_aio_write(struct kiocb *iocb, const struct iovec *iov,
struct ceph_osd_client *osdc = &ceph_client(inode->i_sb)->osdc;
loff_t endoff = pos + iov->iov_len;
int got = 0;
- int ret;
+ int ret, err;
if (ceph_snap(inode) != CEPH_NOSNAP)
return -EROFS;
@@ -838,9 +838,12 @@ retry_snap:
if ((ret >= 0 || ret == -EIOCBQUEUED) &&
((file->f_flags & O_SYNC) || IS_SYNC(file->f_mapping->host)
- || ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_NEARFULL)))
- ret = vfs_fsync_range(file, file->f_path.dentry,
+ || ceph_osdmap_flag(osdc->osdmap, CEPH_OSDMAP_NEARFULL))) {
+ err = vfs_fsync_range(file, file->f_path.dentry,
pos, pos + ret - 1, 1);
+ if (err < 0)
+ ret = err;
+ }
}
if (ret >= 0) {
spin_lock(&inode->i_lock);
OpenPOWER on IntegriCloud