* main - fix device name from devno for partitions
@ 2021-11-05 21:25 David Teigland
0 siblings, 0 replies; only message in thread
From: David Teigland @ 2021-11-05 21:25 UTC (permalink / raw)
To: lvm-devel
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b4067e84c7884f2b46effdf31418f66cc0b902bb
Commit: b4067e84c7884f2b46effdf31418f66cc0b902bb
Parent: 62533ae3fad9fece6f27e3fae7b56e40c66438fa
Author: David Teigland <teigland@redhat.com>
AuthorDate: Fri Nov 5 16:21:23 2021 -0500
Committer: David Teigland <teigland@redhat.com>
CommitterDate: Fri Nov 5 16:21:23 2021 -0500
fix device name from devno for partitions
sysfs files for partitions are different from
whole devices and will require more work to translate
to device names.
---
lib/device/dev-cache.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index ce82a9303..e71cef38d 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -2125,7 +2125,7 @@ static char *_get_devname_from_devno(struct cmd_context *cmd, dev_t devno)
}
if (!(dir = opendir(path)))
- return NULL;
+ goto try_partition;
while ((dirent = readdir(dir))) {
if (dirent->d_name[0] == '.')
@@ -2175,6 +2175,7 @@ static char *_get_devname_from_devno(struct cmd_context *cmd, dev_t devno)
* major minor #blocks name
*/
+try_partition:
if (!(fp = fopen("/proc/partitions", "r")))
return NULL;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-11-05 21:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-05 21:25 main - fix device name from devno for partitions David Teigland
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.