mirror of
https://github.com/ceph/ceph
synced 2025-01-19 01:21:49 +00:00
rgw_file: fix write error when the write offset overlaps.
Signed-off-by: Yao Zongyou <yaozongyou@vip.qq.com>
This commit is contained in:
parent
4639b96cae
commit
872d73f945
@ -1159,6 +1159,15 @@ namespace rgw {
|
||||
}
|
||||
}
|
||||
|
||||
int overlap = 0;
|
||||
if ((static_cast<off_t>(off) < f->write_req->real_ofs) &&
|
||||
((f->write_req->real_ofs - off) <= len)) {
|
||||
overlap = f->write_req->real_ofs - off;
|
||||
off = f->write_req->real_ofs;
|
||||
buffer = static_cast<char*>(buffer) + overlap;
|
||||
len -= overlap;
|
||||
}
|
||||
|
||||
buffer::list bl;
|
||||
/* XXXX */
|
||||
#if 0
|
||||
@ -1195,7 +1204,7 @@ namespace rgw {
|
||||
rc = -EIO;
|
||||
}
|
||||
|
||||
*bytes_written = (rc == 0) ? len : 0;
|
||||
*bytes_written = (rc == 0) ? (len + overlap) : 0;
|
||||
return rc;
|
||||
} /* RGWFileHandle::write */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user