summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Golle <daniel@makrotopia.org>2021-07-23 22:30:56 +0100
committerDaniel Golle <daniel@makrotopia.org>2021-07-23 22:31:03 +0100
commit9cc96af29362db4a9280d492925b0f0dd891dd0f (patch)
tree37c2b6ccb0b22876f4153c60be911b22def9e3b7
parent59f7c11de7eb67def76e24b8f98c2db66d5518f2 (diff)
downloadfstools-9cc96af29362db4a9280d492925b0f0dd891dd0f.tar.gz
Revert "block: resolve /dev/mapper/* name for /dev/dm-0 when hotplugging"
Turns out using the device nodes /dev/mapper/* turns out to be a bad idea to begin with. Will use /dev/dm-* instead. This reverts commit 2f42515977adef7c026eb380ed2423c533cf8f3d. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rw-r--r--block.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/block.c b/block.c
index 4416c91..5b0517e 100644
--- a/block.c
+++ b/block.c
@@ -1171,28 +1171,7 @@ static int mount_action(char *action, char *device, int type)
static int main_hotplug(int argc, char **argv)
{
- char *devname = getenv("DEVNAME");
-
- /* resolve device mapper name for dm-* if possible */
- if (devname && strlen(devname) >= 2 && !strncmp(devname, "dm-", 3)) {
- char *dmdevnamep;
- char dmname[256];
-
- if (asprintf(&dmdevnamep, "/sys/%s/dm/name", getenv("DEVPATH")) == -1)
- exit(ENOMEM);
-
- FILE *fp = fopen(dmdevnamep, "r");
- free(dmdevnamep);
-
- if (fp) {
- if (fgets(dmname, sizeof(dmname), fp))
- devname = dmname;
-
- fclose(fp);
- }
- }
-
- return mount_action(getenv("ACTION"), devname, TYPE_HOTPLUG);
+ return mount_action(getenv("ACTION"), getenv("DEVNAME"), TYPE_HOTPLUG);
}
static int main_autofs(int argc, char **argv)