os/filestore/FileStore.cc: In member function ‘int FileStore::_zero(const coll_t&, const ghobject_t&, uint64_t, size_t)’:
os/filestore/FileStore.cc:3294:24: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (offset + len > st.st_size) {
^
Signed-off-by: Sage Weil <sage@redhat.com>
os/filestore: require offset == length == 0 for full object read; add test
Reviewed-by: Sage Weil <sage@redhat.com>
Reviewed-by: Igor Fedotov <ifedotov@mirantis.com>
When change write mode of FileWrite(in _flush_range) from buffer to
direct. osd met segment fault.
This because call _close_writer don't check related ios whether
complete.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
When StupidAllocator searches for free extents, if hint is not 0(most times),
it will search extents starting from hint and up in each applicable bin,
if not found, then search all extents in those bins again.
If the extent to find(>= needs) exists below hint and is not in the choose_bin(),
let's say it's in the bin_X; then during this twice searches, all extents from
hint and up in bins before bin_X will be searched twice. This patch will eliminate
those unnecessary searches.
Signed-off-by: Jianjian Huo <samuel.huo@gmail.com>
Previously we will call rte_eal_init in caller thread as well as dpdk
resources will init in that thread. It will cause all threads spawned
later will bind to the specified core.
And io thread will be spawned via dpdk api, otherwise, dpdk memory
has huge performance degraded problem.
Signed-off-by: Haomai Wang <haomai@xsky.com>
The create_checkpoint() is not a standard system-call, it may return
some customized error code, thus no conversion is needed here.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
Also move the definition of 'written' ahead to make
old-compiler happy. In my local testbed, it keeps
complaining "crosses initialization of ‘int64_t written’"
accompanying with this change.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
At present lfn_close is a noop, so duplicated call to lfn_close
does no harm and this patch only tries to tidy up.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
The problem here is if we fail to remove one of the existing xattr
stored with fd, and we spill out more xattrs to ObjectMap, we'll
go on to cleaning up the remaining xattrs in ObjectMap, and thus
the real failure might be covered.
This commit solves the above problem by making a quick exit if
we fail to remove any xattr bound with file.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
bluestore_sync_submit_transaction = false, it submit transaction.
If bluestore_sync_transaction = true and
bluestore_sync_submit_transaction = false, it will submit 2 times.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
For bluestore_sync_transaction = true, first update metadata into kv and
then update fm alloca/release infos. If Before updating fm, the host
power off, it make bluestore inconformity.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
In _txc_finish_io, it get the lock of osr and call _txc_state_proc.
If bluestore_sync_transaction == true adn txd->wal_txn == null, it will
call _txc_finish which need get lock of osr. So the deadlock occru.
The simple wal is put txc in kv_queue whether sync or async.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
If the file has an alt attr, there are two possible matching
ghobjects. We want to make sure we choose the right one for
the short name we have. If we don't, a split while there are
two objects linking to the same inode will result in one of
the links being orphaned in the source directory, resulting
in #14766.
Signed-off-by: Samuel Just <sjust@redhat.com>
os/bluestore/KernelDevice.cc: In member function ‘virtual int KernelDevice::open(std::string)’:
os/bluestore/KernelDevice.cc:128:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (block_size != st.st_blksize) {
Signed-off-by: Sage Weil <sage@redhat.com>
Can't silent these and we have no users left. They'll be removed
soon, but I'm tired of sifting through all the warnings.
Signed-off-by: Sage Weil <sage@redhat.com>
If we punch a hole that extends past EOF, ObjectStore semantics are
that the file size is also extended. Do that.
Note that this bug was hidden before because we weren't passing
KEEP_SIZE to fallocate until 7bd95b595f
and the fallocate was *always* failing with EOPNOTSUPP (making us fall
back to writing actual zeros).
Signed-off-by: Sage Weil <sage@redhat.com>