]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
tools: rados put /dev/null should write() and not create() 2858/head
authorLoic Dachary <loic-201408@dachary.org>
Thu, 2 Oct 2014 07:23:55 +0000 (09:23 +0200)
committerDavid Zafman <dzafman@redhat.com>
Wed, 5 Nov 2014 03:52:07 +0000 (19:52 -0800)
commitf111bc8eac8a521b13340f4a75418d839725e010
tree33058e4c688890273ee862df4e8e99cb2861e710
parentf410d764d2e6795389cb320b4436cff3607927bd
tools: rados put /dev/null should write() and not create()

In the rados.cc special case to handle put an empty objects, use
write_full() instead of create().

A special case was introduced 6843a0b81f10125842c90bc63eccc4fd873b58f2
to create() an object if the rados put file is empty. Prior to this fix
an attempt to rados put an empty file was a noop. The problem with this
fix is that it is not idempotent. rados put an empty file twice would
fail the second time and rados put a file with one byte would succeed as
expected.

Signed-off-by: Loic Dachary <loic-201408@dachary.org>
(cherry picked from commit 50e80407f3c2f74d77ba876d01e7313c3544ea4d)
src/tools/rados/rados.cc