Skip to content

Commit

Permalink
librbd: Add ictx check to avoid AIO_TYPE_NONE completion
Browse files Browse the repository at this point in the history
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
  • Loading branch information
yuyuyu101 committed Aug 21, 2015
1 parent 6936ac2 commit a23b84b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/librbd/AioCompletion.cc
Expand Up @@ -95,7 +95,7 @@ namespace librbd {

lock.Lock();
done = true;
if (event_notify && ictx->event_socket.is_valid()) {
if (ictx && event_notify && ictx->event_socket.is_valid()) {
ictx->completed_reqs_lock.Lock();
ictx->completed_reqs.push_back(&m_xlist_item);
ictx->completed_reqs_lock.Unlock();
Expand Down
2 changes: 1 addition & 1 deletion src/librbd/AioCompletion.h
Expand Up @@ -138,7 +138,7 @@ namespace librbd {
int n = --ref;
lock.Unlock();
if (!n) {
if (event_notify) {
if (ictx && event_notify) {
ictx->completed_reqs_lock.Lock();
m_xlist_item.remove_myself();
ictx->completed_reqs_lock.Unlock();
Expand Down

0 comments on commit a23b84b

Please sign in to comment.