writes maybe failed in Client::_write, so do not move f->pos when write
successfully.
Signed-off-by: Junhui Tang <tangjunhui@sangfor.com.cn>
Fixes: https://tracker.ceph.com/issues/37546
int64_t Client::_write(Fh *f, int64_t offset, uint64_t size, const char *buf,
const struct iovec *iov, int iovcnt)
{
+ uint64_t fpos = 0;
+
if ((uint64_t)(offset+size) > mdsmap->get_max_filesize()) //too large!
return -EFBIG;
}
}
offset = f->pos;
- f->pos = offset+size;
+ fpos = offset+size;
unlock_fh_pos(f);
}
lat -= start;
logger->tinc(l_c_wrlat, lat);
+ if (fpos) {
+ lock_fh_pos(f);
+ f->pos = fpos;
+ unlock_fh_pos(f);
+ }
totalwritten = size;
r = (int64_t)totalwritten;