int Client::_read(Fh *f, int64_t offset, uint64_t size, bufferlist *bl)
{
+ const md_config_t *conf = cct->_conf;
Inode *in = f->inode;
//bool lazy = f->mode == CEPH_FILE_MODE_LAZY;
movepos = true;
}
- if (have & CEPH_CAP_FILE_CACHE)
+ if (!conf->client_debug_force_sync_read && have & CEPH_CAP_FILE_CACHE)
r = _read_async(f, offset, size, bl);
else
r = _read_sync(f, offset, size, bl);
flock.Unlock();
client_lock.Lock();
+ // if we get ENOENT from OSD, assume 0 bytes returned
+ if (r == -ENOENT)
+ r = 0;
if (r < 0)
return r;
if (tbl.length()) {
OPTION(client_oc_target_dirty, OPT_INT, 1024*1024* 8) // target dirty (keep this smallish)
OPTION(client_oc_max_dirty_age, OPT_DOUBLE, 5.0) // max age in cache before writeback
OPTION(client_oc_max_objects, OPT_INT, 1000) // max objects in cache
+OPTION(client_debug_force_sync_read, OPT_BOOL, false) // always read synchronously (go to osds)
// note: the max amount of "in flight" dirty data is roughly (max - target)
OPTION(fuse_use_invalidate_cb, OPT_BOOL, false) // use fuse 2.8+ invalidate callback to keep page cache consistent
OPTION(fuse_big_writes, OPT_BOOL, true)