DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eal: fix plugindir processing to be filesystem agnostic
@ 2015-11-18  6:45 Panu Matilainen
  2015-11-20 16:38 ` David Marchand
  2015-11-23 15:39 ` Thomas Monjalon
  0 siblings, 2 replies; 7+ messages in thread
From: Panu Matilainen @ 2015-11-18  6:45 UTC (permalink / raw)
  To: dev

Not all filesystems supply struct dirent d_type field, in which case
everything in the specified directory would go ignored. One such
filesystem being XFS which RHEL 7 defaults to... stat() the entries
instead.

Fixes: 9f8eb1d9ca0f ("eal: support driver loading from directory")

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
---
 lib/librte_eal/common/eal_common_options.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c
index bed7385..e51fa12 100644
--- a/lib/librte_eal/common/eal_common_options.c
+++ b/lib/librte_eal/common/eal_common_options.c
@@ -191,12 +191,14 @@ eal_plugindir_init(const char *path)
 	}
 
 	while ((dent = readdir(d)) != NULL) {
-		if (dent->d_type != DT_REG && dent->d_type != DT_LNK)
-			continue;
+		struct stat sb;
 
 		snprintf(sopath, PATH_MAX-1, "%s/%s", path, dent->d_name);
 		sopath[PATH_MAX-1] = 0;
 
+		if (!(stat(sopath, &sb) == 0 && S_ISREG(sb.st_mode)))
+			continue;
+
 		if (eal_plugin_add(sopath) == -1)
 			break;
 	}
-- 
2.5.0

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-11-23 15:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-18  6:45 [dpdk-dev] [PATCH] eal: fix plugindir processing to be filesystem agnostic Panu Matilainen
2015-11-20 16:38 ` David Marchand
2015-11-23  6:04   ` Panu Matilainen
2015-11-23 10:41     ` Thomas Monjalon
2015-11-23 11:42       ` Panu Matilainen
2015-11-23 13:54         ` Thomas Monjalon
2015-11-23 15:39 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).