When determining if a write is buffered or not, take into account
the client_oc config. This option allows non-buffered writes when
caps normally used in buffered writes are present.
Fixes: https://tracker.ceph.com/issues/70568
Signed-off-by: Christopher Hoffman <choffman@redhat.com>
if (f->flags & O_DIRECT)
have &= ~(CEPH_CAP_FILE_BUFFER | CEPH_CAP_FILE_LAZYIO);
- bool buffered_write = (have & (CEPH_CAP_FILE_BUFFER | CEPH_CAP_FILE_LAZYIO));
+ bool buffered_write = (cct->_conf->client_oc && (have & (CEPH_CAP_FILE_BUFFER | CEPH_CAP_FILE_LAZYIO)));
ceph::ref_t<WriteEncMgr> enc_mgr;
if (buffered_write) {