Skip to contentSkip to conversation

bcache: decouple emitting a cached_dev CHANGE uevent

PATCH New Joseph Salisbury 1 participant 3 messages Mar 1, 2018 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 bcache: decouple emitting a cached_dev CHANGE uevent

From: Ryan Harper <[email protected]>

A bug is preventing /dev/bcache/by-uuid links from being created after reboot. It appears that since the initramfs loads the bcache module which probes and finds all of the cache devices and backing devices then once the rootfs is mounted and udev gets to run, the bcache kernel module does not emit the CACHED_UUID value into the environment if the underlying devices are already registered.

With this patch, instead of just failing with "device already registered" the kernel emits another uevent with CACHED_UUID which would be processed another time to set up a symlink.

- decouple emitting a cached_dev CHANGE uevent which includes dev.uuid and dev.label from bch_cached_dev_run() which only happens when a bcacheX device is bound to the actual backing block device (bcache0 -> vdb)

- update bch_cached_dev_run() to invoke bch_cached_dev_emit_change() as needed; no functional code path changes here

- Modify register_bcache to detect a re-registering of a bcache cached_dev, and in that case call bcache_cached_dev_emit_change() to

---
 drivers/md/bcache/bcache.h |  1 +
 drivers/md/bcache/super.c  | 53 +++++++++++++++++++++++++++++++++++++---------
 2 files changed, 44 insertions(+), 10 deletions(-)
drivers/md/bcache/bcache.h +1 -0
index 02619ca..8ed7e7a 100644
@@ -906,6 +906,7 @@ int bch_flash_dev_create(struct cache_set *c, uint64_t size);
 
 int bch_cached_dev_attach(struct cached_dev *, struct cache_set *);
 void bch_cached_dev_detach(struct cached_dev *);
+void bch_cached_dev_emit_change(struct cached_dev *);
 void bch_cached_dev_run(struct cached_dev *);
 void bcache_device_stop(struct bcache_device *);
 
drivers/md/bcache/super.c +43 -10

92 lines not on this page · raw message

Signature · 1 line
2.7.4
#2 lore raw

PATCH 1/1 bcache: decouple emitting a cached_dev CHANGE uevent

In reply to a message not in the archive

From: Ryan Harper <[email protected]>

A bug is preventing /dev/bcache/by-uuid links from being created after reboot. It appears that since the initramfs loads the bcache module which probes and finds all of the cache devices and backing devices then once the rootfs is mounted and udev gets to run, the bcache kernel module does not emit the CACHED_UUID value into the environment if the underlying devices are already registered.

With this patch, instead of just failing with "device already registered" the kernel emits another uevent with CACHED_UUID which would be processed another time to set up a symlink.

- decouple emitting a cached_dev CHANGE uevent which includes dev.uuid and dev.label from bch_cached_dev_run() which only happens when a bcacheX device is bound to the actual backing block device (bcache0 -> vdb)

- update bch_cached_dev_run() to invoke bch_cached_dev_emit_change() as needed; no functional code path changes here

- Modify register_bcache to detect a re-registering of a bcache cached_dev, and in that case call bcache_cached_dev_emit_change() to

---
 drivers/md/bcache/bcache.h |  1 +
 drivers/md/bcache/super.c  | 53 +++++++++++++++++++++++++++++++++++++---------
 2 files changed, 44 insertions(+), 10 deletions(-)
drivers/md/bcache/bcache.h +1 -0
index 02619ca..8ed7e7a 100644
@@ -906,6 +906,7 @@ int bch_flash_dev_create(struct cache_set *c, uint64_t size);
 
 int bch_cached_dev_attach(struct cached_dev *, struct cache_set *);
 void bch_cached_dev_detach(struct cached_dev *);
+void bch_cached_dev_emit_change(struct cached_dev *);
 void bch_cached_dev_run(struct cached_dev *);
 void bcache_device_stop(struct bcache_device *);
 
drivers/md/bcache/super.c +43 -10

92 lines not on this page · raw message

Signature · 1 line
2.7.4
#3 lore raw

PATCH 1/1 bcache: decouple emitting a cached_dev CHANGE uevent

In reply to a message not in the archive

From: Ryan Harper <[email protected]>

A bug is preventing /dev/bcache/by-uuid links from being created after reboot. It appears that since the initramfs loads the bcache module which probes and finds all of the cache devices and backing devices then once the rootfs is mounted and udev gets to run, the bcache kernel module does not emit the CACHED_UUID value into the environment if the underlying devices are already registered.

With this patch, instead of just failing with "device already registered" the kernel emits another uevent with CACHED_UUID which would be processed another time to set up a symlink.

- decouple emitting a cached_dev CHANGE uevent which includes dev.uuid and dev.label from bch_cached_dev_run() which only happens when a bcacheX device is bound to the actual backing block device (bcache0 -> vdb)

- update bch_cached_dev_run() to invoke bch_cached_dev_emit_change() as needed; no functional code path changes here

- Modify register_bcache to detect a re-registering of a bcache cached_dev, and in that case call bcache_cached_dev_emit_change() to

---
 drivers/md/bcache/bcache.h |  1 +
 drivers/md/bcache/super.c  | 53 +++++++++++++++++++++++++++++++++++++---------
 2 files changed, 44 insertions(+), 10 deletions(-)
drivers/md/bcache/bcache.h +1 -0
index 02619ca..8ed7e7a 100644
@@ -906,6 +906,7 @@ int bch_flash_dev_create(struct cache_set *c, uint64_t size);
 
 int bch_cached_dev_attach(struct cached_dev *, struct cache_set *);
 void bch_cached_dev_detach(struct cached_dev *);
+void bch_cached_dev_emit_change(struct cached_dev *);
 void bch_cached_dev_run(struct cached_dev *);
 void bcache_device_stop(struct bcache_device *);
 
drivers/md/bcache/super.c +43 -10

92 lines not on this page · raw message

Signature · 1 line
2.7.4