John Wilkins [Mon, 3 Nov 2014 23:08:11 +0000 (15:08 -0800)]
Merge pull request #2854 from ceph/wip-doc-openstack-juno
doc: Update for OpenStack Juno.
New users working with Nova (Juno) noted that libvirt settings are now under a [libvirt] section, and truncate the leading libvirt_. Made subsections for Havana and Icehouse, added a new subsection for Juno.
Sage Weil [Sat, 1 Nov 2014 04:29:42 +0000 (21:29 -0700)]
buffer: implement list::get_contiguous
Return a pointer to a contiguous range of the bufferlist, rebuilding
into a contiguous region as needed. For now, if we need to rebuild,
we just do the whole thing. We can obviously optimize this later to
rebuild on the necessary region, but this is good enough for the
(presumably) common case where the needed region is already in fact
contiguous.
In most time, this works well, But the programm occasionally
hangs forever. Output of gstack:
Thread 1 (Thread 0x7fe0afba0760 (LWP 18509)):
0 0x000000330f20822d in pthread_join () from /lib64/libpthread.so.0
1 0x000000347566cea2 in Thread::join(void**) () from
/usr/lib64/librados.so.2
2 0x00000034755ac535 in librados::RadosClient::shutdown() () from
/usr/lib64/librados.so.2
3 0x0000003475592269 in rados_shutdown () from /usr/lib64/librados.so.2
4 0x0000000000402349 in main ()
Thread 4 (Thread 0x7fe0ab14d700 (LWP 18541)):
0 0x000000330f20e264 in __lll_lock_wait () from /lib64/libpthread.so.0
1 0x000000330f209508 in _L_lock_854 () from /lib64/libpthread.so.0
2 0x000000330f2093d7 in pthread_mutex_lock () from
/lib64/libpthread.so.0
3 0x0000003475633af1 in Mutex::Lock(bool) () from
/usr/lib64/librados.so.2
4 0x00000034755abd37 in librados::RadosClient::put() () from
/usr/lib64/librados.so.2
5 0x0000003475592501 in librados::Rados::shutdown() () from
/usr/lib64/librados.so.2
6 0x00007fe0afbba9f7 in
libradosstriper::RadosStriperImpl::CompletionData::~CompletionData() ()
from /usr/lib64/libradosstriper.so.1
7 0x00007fe0afbbaad9 in
libradosstriper::RadosStriperImpl::WriteCompletionData::~WriteCompletionData()
() from /usr/lib64/libradosstriper.so.1
8 0x00007fe0afbc1d75 in RefCountedObject::put() () from
/usr/lib64/libradosstriper.so.1
9 0x00007fe0afbc224d in
libradosstriper::MultiAioCompletionImpl::safe_request(long) () from
/usr/lib64/libradosstriper.so.1
10 0x00000034755c5ce8 in librados::C_AioSafe::finish(int) () from
/usr/lib64/librados.so.2
11 0x00000034755a0e89 in Context::complete(int) () from
/usr/lib64/librados.so.2
12 0x000000347564d4c8 in Finisher::finisher_thread_entry() () from
/usr/lib64/librados.so.2
13 0x000000330f2079d1 in start_thread () from /lib64/libpthread.so.0
14 0x000000330eae886d in clone () from /lib64/libc.so.6
It is obvious that librados::Rados::shutdown is not a thread-safe
function here. It will hang forever. The culprit of this is when
CompletionData is released, it will first notify
"rados_aio_wait_for_safe" to continue, and CompletionData will call
put() to release other data. But if the main thread(Thread 1 here) runs
fast enough, rados_striper_destroy will be executed before other
thread(Thread 4 here)'s releasing refcnf. In this situation, main thread
runs Rados::shutdown() while other thread runs Rados::shutdown() in the
same time.
My suggestion is to let RadosStriperImpl::aio_flush to block until all
the CompletionData has been released. This makes sure other thread will
never call rados_shutdown.
Sage Weil [Thu, 30 Oct 2014 17:56:36 +0000 (10:56 -0700)]
osdc/Objecter: fix null dref when pool dne
If the base pool does not exist, we need to avoid dereferencing pi.
This simplest fix is to return with POOL_DNE early and skip all of the
checks.
Note that there is one other small semantic change in this function: if
we are using the precalc_pgid then base_oloc pool has to match. But
the list_objects() caller does that, so we're fine.
Backport: giant Fixes: #9944 Signed-off-by: Sage Weil <sage@redhat.com>
Sébastien Han [Thu, 30 Oct 2014 10:59:14 +0000 (11:59 +0100)]
doc: update RBD for Juno
This commit introduces some updates for the OpenStack Juno release. New
flags have been added, many trailing spaces were removed and a new
recommendation for Glance cache management has been added too.
Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
John Spray [Mon, 27 Oct 2014 12:02:17 +0000 (12:02 +0000)]
client: allow xattr caps in inject_release_failure
Because some test environments generate spurious
rmxattr operations, allow the client to release
'X' caps. Allows xattr operations to proceed
while still preventing client releasing other caps.
Vicente Cheng [Wed, 29 Oct 2014 04:21:11 +0000 (12:21 +0800)]
rbd: Fix the rbd export when image size more than 2G
When using export <image-name> <path> and the size of image is more
than 2G, the previous version about finish() could not handle in
seeking the offset in image and return error.
This is caused by the incorrect variable type. Try to use the correct
variable type to fixed it.
I use another variable which type is uint64_t for confirming seeking
and still use the previous r for return error.
uint64_t is more better than type int for handle lseek64().
For testing injectargs a configuration option was changed that has side
effects on the cluster. It could introduce random failures later. It is
replaced with a configuration option that cannot have adverse side
effects on the cluster.
John Spray [Mon, 27 Oct 2014 12:02:17 +0000 (12:02 +0000)]
client: allow xattr caps in inject_release_failure
Because some test environments generate spurious
rmxattr operations, allow the client to release
'X' caps. Allows xattr operations to proceed
while still preventing client releasing other caps.
Fixes: #9800 Signed-off-by: John Spray <john.spray@redhat.com>
huangjun [Tue, 28 Oct 2014 07:05:37 +0000 (15:05 +0800)]
Fix the match error when starting OSD daemons.
If we have osd.7 and osd.77 on the same host, osd.7 will not be mounted if
osd.77 is mounted. Signed-off-by: huangjun <hjwsm1989@gmail.com>
Greg Farnum [Thu, 23 Oct 2014 00:16:31 +0000 (17:16 -0700)]
client: cast m->get_client_tid() to compare to 16-bit Inode::flushing_cap_tid
m->get_client_tid() is 64 bits (as it should be), but Inode::flushing_cap_tid
is only 16 bits. 16 bits should be plenty to let the cap flush updates
pipeline appropriately, but we need to cast in the proper direction when
comparing these differently-sized versions. So downcast the 64-bit one
to 16 bits.
Yan, Zheng [Mon, 27 Oct 2014 20:57:16 +0000 (13:57 -0700)]
client: fix I_COMPLETE_ORDERED checking
Current code marks a directory inode as complete and ordered when readdir
finishes, but it does not check if the directory was modified in the middle
of readdir. This is wrong, directory inode should not be marked as ordered
if it was modified during readddir
The fix is introduce a new counter to the inode data struct, we increase
the counter each time the directory is modified. When readdir finishes, we
check the counter to decide if the directory should be marked as ordered.
Fix indentation to the same as the original fsx.c .
Fix for Coverity issue:
CID 1219473 (#1-2 of 2): Nesting level does not match indentation
(NESTING_INDENT_MISMATCH)
uncle: This statement is indented to column 25, as if it were
nested within the preceding parent statement, but it is not.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Fix memory leak caused by using std::string to hold result
of strdup call returned from getObjName().
Fix for Coverity issues:
CID 1221525 (#1 of 1): Resource leak (RESOURCE_LEAK)
leaked_storage: Failing to save or free storage allocated by
this->getObjName(soid, 0UL) leaks it.
CID 1221526 (1-3 of 3): Resource leak (RESOURCE_LEAK)
leaked_storage: Failing to save or free storage allocated by
this->getObjName(soid, *) leaks it.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Mon, 27 Oct 2014 10:09:01 +0000 (11:09 +0100)]
rgw/rgw_formats.cc: fix realloc memory leak
Fix handling of realloc. If realloc() fails it returns NULL, assigning
the return value of realloc() directly to the pointer without checking
for the result will lead to a memory leak in error case.
Use a temporary pointer to hold the result of realloc(). In error case
print error and exit, otherwise assign it to the pointer we want to realloc.
Fix also error checks for malloc to fail as soon as malloc fails and
don't try to run realloc again after failed malloc.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Sun, 26 Oct 2014 19:56:25 +0000 (20:56 +0100)]
arch/neon.c: check result of fread()
Fix for:
CID 1128384 (#1 of 1): Ignoring number of bytes read (CHECKED_RETURN)
check_return: fread(void * restrict, size_t, size_t, FILE * restrict)
returns the number of bytes read, but it is ignored.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
CID 1054853 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking is_truncated suggests that it may
be null, but it has already been dereferenced on all paths leading
to the check.
Add vim line to file.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Danny Al-Gaaf [Sun, 26 Oct 2014 17:19:58 +0000 (18:19 +0100)]
SyntheticClient.cc: check return value of getdir()
Check return value as done in all other places. Fix error messages
to print correct function name getdir and not read_dir/readdir since
the error isn't necessarily raised by read_dir().
Fix for:
CID 1219463 (#1 of 1): Unchecked return value (CHECKED_RETURN)
check_return: Calling getdir without checking return value (as
is done elsewhere 4 out of 5 times).
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>