Project

General

Profile

Actions

Bug #4800

closed

krbd: avoid dropping extra reference in rbd_free_disk()

Added by Alex Elder almost 11 years ago. Updated almost 11 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

I found during some failure injection testing that the call to
rbd_free_disk() in the error path of rbd_dev_probe_finish() was
dropping an extra reference to the disk queue. The problem
occurred when put_disk tried to drop a reference to the disk's
queue. A call to blk_cleanup_queue() just prior to that will have
also dropped a reference to the queue.

The problem is that the reference dropped by put_disk() is assumed
to have been taken by add_disk(). Our code has error paths that can
occur after the disk and its queue are initialized, but before the
call to add_disk(), and in those paths we won't have that extra
reference.

The fix is easy though. In rbd_free_disk() we're already checking
the disk's GENHD_FL_UP flag. That flag is an indication that
add_disk() has been called, so just call blk_cleanup_queue()
conditional on that flag being set.

Signed-off-by: Alex Elder <>


Related issues 1 (0 open1 closed)

Related to rbd - Bug #4802: krbd: walk through error paths and fix themResolvedAlex Elder04/24/2013

Actions
Actions #1

Updated by Alex Elder almost 11 years ago

  • Subject changed from rbd: avoid dropping extra reference in rbd_free_disk() to krbd: avoid dropping extra reference in rbd_free_disk()

This is basically done.

As I look through the code though I see there are other places
where error handling does not work the way it should (in the
rbd code itself, not related to this block layer anomaly) that
really need to be fixed. I am going to open up a separate bug
to remedy those.

Actions #2

Updated by Alex Elder almost 11 years ago

  • Project changed from Ceph to rbd
  • Target version deleted (v0.62a)
Actions #3

Updated by Alex Elder almost 11 years ago

  • Status changed from In Progress to Fix Under Review

(Nevermind. Will be ready for review shortly.)

Actions #4

Updated by Alex Elder almost 11 years ago

  • Status changed from Fix Under Review to In Progress
Actions #5

Updated by Alex Elder almost 11 years ago

  • Status changed from In Progress to Fix Under Review

The following has been posted for review:

rbd: avoid dropping extra reference in rbd_free_disk()
Actions #6

Updated by Alex Elder almost 11 years ago

  • Status changed from Fix Under Review to Resolved

This has been committed to the ceph-client "testing" branch:

b1557a5 rbd: avoid dropping extra reference in rbd_free_disk()

Actions

Also available in: Atom PDF