Skip to content

sysfs representation of stacked devices (dm/md) (rev.2)

Jun'ichi Nomura dm-devel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3sysfs representation of stacked devices (common) (rev.2)fs/block_dev.c fs/partitions/check.c include/linux/fs.h +1 more+193 -26 replies
2/3sysfs representation of stacked devices (dm) (rev.2)drivers/md/dm-ioctl.c drivers/md/dm-table.c drivers/md/dm.h+55 -144 replies
3/3sysfs representation of stacked devices (md) (rev.2)drivers/md/md.c+2 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] sysfs representation of stacked devices (dm/md) (rev.2)

Hello,

This is a revised set of pathces which provides common representation of dependencies between stacked devices (dm and md) in sysfs.

Variants of bd_claim/bd_release are added to accept a kobject and create symlinks between the claimed bdev and the holder.

dm/md will give a child of its gendisk kobject to bd_claim. For example, if dm-0 maps to sda, we have the following symlinks;
/sys/block/dm-0/slaves/sda --> /sys/block/sda /sys/block/sda/holders/dm-0 --> /sys/block/dm-0

Comments are welcome.

A few points I would appreciate comments/reviews from maintainers:
About sysfs
- I confirmed sysfs_remove_symlink() and kobject_del() don't allocate memory in 2.6.15 and it seems true on the git head. I would like to make sure it's true in future versions of kernel because they are called during device-mapper's table swapping where I/O to free memory could deadlock on the dm device. What is the recommended way to do that?
Or can I just expect these functions will not allocate memory in future versions of kernel?
About dm
- To get a reference to mapped_device, table_load() do dm_get() before populating table. It will dm_put() when the table is being discarded or the table is being activated.
About md
- Rather than carrying mddev pointer around, bd_claim is now made twice. First is not changed at lock_rdev().
The second is at bind_rdev_to_array() where kobject is passed and symlinks are created.

Signature · 1 line
Jun'ichi Nomura, NEC Solutions (America), Inc.