Skip to content

RFC configfs: Pin config_items when in use by other subsystems

Joel Becker linux-fsdevel ocfs2-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2configfs: config item dependancies.fs/configfs/configfs_internal.h fs/configfs/dir.c include/linux/configfs.h+212 -30 replies
2/2ocfs2: Depend on configfs heartbeat items.fs/ocfs2/cluster/heartbeat.c fs/ocfs2/cluster/heartbeat.h fs/ocfs2/cluster/nodemanager.c +4 more+92 -170 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/2] [RFC] configfs: Pin config_items when in use by other subsystems

Many folks know that I've been pretty stubborn on the subject of
configfs item removal. configfs_rmdir() cannot currently be aborted by a client driver. This is to ensure that userspace has control - if userspace wants to remove an item, it should have that ability. The client driver is left to handle the event.
However, there are dependencies in the kernel. One kernel
subsystem may depend on a configfs item and be unable to handle that item disappearing. So we need a mechanism to describe this dependency. After lots of beating me over my head, I've been convinced to give it a shot.
The canonical example is ocfs2 and its heartbeat. Today, you
can stop o2cb heartbeat (o2hb) by rmdir(2) of the heartbeat object in configfs. o2hb handles this just fine - all of o2hb's clients get node-down notifications. However, ocfs2 can't handle this. When the node stops speaking to the cluster it can't just continue, and it can't force an unmount of itself. It only has one solution - crash. This is ugly any way you look at it.
With the configfs_depend_item() API,
heartbeat_register_callback() can then pin the heartbeat item. Any rmdir(2) of the heartbeat item will return -EBUSY until heartbeat_unregister_callback() removes the dependancy. A similar API can be created for any other configfs client driver.
The first patch is the configfs mechanism. The second patch is
the heartbeat use thereof.
Comments and curses welcome.

Joel

Signature · 11 lines
"You must remember this:
 A kiss is just a kiss,
 A sigh is just a sigh.
 The fundamental rules apply
 As time goes by."

Joel Becker
Principal Software Developer
Oracle
E-mail: [email protected]
Phone: (650) 506-8127