Project

General

Profile

Actions

Bug #4774

closed

krbd: don't create /dev entries for backing devices

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

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

100%

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

Description

Currently when a layered rbd device gets mapped, the
snapshot device that is its parent gets probed in the
same way as the original image. And as a result, it
gets an entry in /dev to represent it. This is no
good, so it really needs to be changed.


Subtasks 1 (0 open1 closed)

Bug #4796: krbd: don't create sysfs entries for snapshots of mapped imagesResolvedAlex Elder04/23/2013

Actions
Actions #1

Updated by Alex Elder almost 11 years ago

  • Status changed from New to In Progress

This is what I am now working on; just marking it so.

Actions #2

Updated by Alex Elder almost 11 years ago

I'm unfortunately finding what I fought with last year when
working with the initialization and teardown of rbd devices.
The code is really fragile. The various dependencies and
interactions between devices and their snapshots, and
on the timing of creation of things, makes it very hard
to change anything without hitting seemingly unexpected
problems.

This needs to be fixed though, and I think that getting
rid of the Linux devices (etc.) for parents will improve
this.

Looking at it now though, I think we should probably not
be creating devices for the snapshots of rbd devices. I
don't know what purpose these snapshot devices serve. And
having them is part of what leads to the complexity I'm
bumping into.

Maybe I'm missing something.

Actions #3

Updated by Alex Elder almost 11 years ago

  • Status changed from In Progress to Fix Under Review

I'm making headway on this now. It mostly is taking the form of
cleaning up code as I walk through how things get set up and torn
down. I'm sort of working on this together with issues 4802
and 4803, and it's not always clear where I should record
progress.

In any case, most of the patches I just posted are really
connected to this... So:

The following have been posted for review. They are available
in the "review/wip-rbd-cleanup-3" branch of the ceph-client
git respository.

The first patch of this series doesn't really belong,
but I threw it in anyway. The other three defer doing
some initialization of an rbd device until just before
it gets activated by a call to add_disk().

-Alex

[PATCH 1/4] rbd: fix up some sysfs stuff
[PATCH 2/4] rbd: only set device exists flag when ready
[PATCH 3/4] rbd: defer setting disk capacity
[PATCH 4/4] rbd: defer setting the mapping size and features

And

This series cleans up some code in the are of probing
for parent images.

-Alex

[PATCH 1/6] rbd: encapsulate probing for parent devices
[PATCH 2/6] rbd: encapsulate removing parent devices
[PATCH 3/6] rbd: kill __rbd_remove()
[PATCH 4/6] rbd: fix rbd_dev_remove_parent()
[PATCH 5/6] rbd: remove parent devices on probe error
[PATCH 6/6] rbd: probe for the parent earlier

Actions #4

Updated by Alex Elder almost 11 years ago

OK, finally getting to the point of this bug...

I just posted the following patches for review. The
last one actually stops creating device stuff for
non-mapped images.

Still a little more cleanup to do, but I finally got
to where I wanted to be.

This series does a few more things to separate the
ceph and Linux side of rbd device initialization,
and to make sure things get cleaned up in a sane
way when errors occur. The last patch makes it so
only the rbd image getting mapped has Linux device
and sysfs stuff associated with them. The parent
rbd devices for layered images never needed this
stuff, and things have now been rearranged such
that we can do away with that.

These patches are available in the ceph-client git
repository in the branch "review/wip-rbd-cleanup-5".

-Alex
[PATCH 1/5] rbd: drop module later
[PATCH 2/5] rbd: don't destroy rbd_dev in device release function
[PATCH 3/5] rbd: define rbd_dev_unprobe()
[PATCH 4/5] rbd: don't have device release destroy rbd_dev
[PATCH 5/5] rbd: set up devices only for mapped images
Actions #5

Updated by Alex Elder almost 11 years ago

  • Status changed from Fix Under Review to Resolved

The following have been committed to the "testing" branch
of the ceph-client git repository:

452a982 rbd: drop module later
0537e29 rbd: don't destroy rbd_dev in device release function
8c2cc4e rbd: define rbd_dev_unprobe()
d482c59 rbd: don't have device release destroy rbd_dev
151bdc0 rbd: set up devices only for mapped images

Actions

Also available in: Atom PDF