diff --git a/fs/ceph/file.c b/fs/ceph/file.c index 1ac0a59867dc..5de16f5ac7e9 100644 --- a/fs/ceph/file.c +++ b/fs/ceph/file.c @@ -373,7 +373,7 @@ static int striped_read(struct inode *inode, goto more; } - if (ret >= 0) { + if (read > 0) { ret = read; /* did we bounce off eof? */ if (pos + left > inode->i_size) @@ -611,6 +611,8 @@ static ssize_t ceph_sync_write(struct file *file, const char __user *data, if (check_caps) ceph_check_caps(ceph_inode(inode), CHECK_CAPS_AUTHONLY, NULL); + } else if (ret != -EOLDSNAPC && written > 0) { + ret = written; } return ret; }