Skip to content

Commit ee7289b

Browse files
majianpengSage Weil
authored and
Sage Weil
committed
ceph: allow sync_read/write return partial successed size of read/write.
For sync_read/write, it may do multi stripe operations.If one of those met erro, we return the former successed size rather than a error value. There is a exception for write-operation met -EOLDSNAPC.If this occur,we retry the whole write again. Signed-off-by: Jianpeng Ma <[email protected]>
1 parent 02ae66d commit ee7289b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/ceph/file.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ static int striped_read(struct inode *inode,
374374
goto more;
375375
}
376376

377-
if (ret >= 0) {
377+
if (read > 0) {
378378
ret = read;
379379
/* did we bounce off eof? */
380380
if (pos + left > inode->i_size)
@@ -612,6 +612,8 @@ static ssize_t ceph_sync_write(struct file *file, const char __user *data,
612612
if (check_caps)
613613
ceph_check_caps(ceph_inode(inode), CHECK_CAPS_AUTHONLY,
614614
NULL);
615+
} else if (ret != -EOLDSNAPC && written > 0) {
616+
ret = written;
615617
}
616618
return ret;
617619
}

0 commit comments

Comments
 (0)