From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ob0-f172.google.com (mail-ob0-f172.google.com [209.85.214.172]) by dpdk.org (Postfix) with ESMTP id 4E8A5590C for ; Fri, 20 Nov 2015 17:38:03 +0100 (CET) Received: by obdgf3 with SMTP id gf3so91445139obd.3 for ; Fri, 20 Nov 2015 08:38:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=qL8EoxKaRoZaeP2gnpgKvGxEI+GYI+CvWcaVzpCFn04=; b=EKEqvX+Nl67liMhtR8ynHQ6Ge5Gtk5BNpj0IE+eV5DNQp7LQCE6JrnXLp1ZhKGb9Ub mP2wwBZrm6QQNLQJmH6TFyCzdaWqNayJDnxwxz7CNfj+idRRsc/ikkXAPVPTO4WSRWb9 rJ4GLS2bwnSNSHtEy41VNpph9ZH008pGDQpyAnn4O6bO2SP+PpGkRAbTk9fGc7ufv9Yd tb45TCASE1QvYkMl71U0ORyWMcJ9zhapLS4ZUGh2x1uidl38FV0/LXe0qYewj5tOW+XK u1yZvvKHhodDYfYsELeuAIkT9gyd6ugT4NcYI6IKtISoDDmW9xcKYdWT8GAv6eX+1nuS aQMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=qL8EoxKaRoZaeP2gnpgKvGxEI+GYI+CvWcaVzpCFn04=; b=j2KcmEP/kf1d8uuH1sUQt8S4MslUbJjMyizx9/KOsGXY6bWq1zcjInctxHyvqLZfEg Ue4Hq8MQxMaBR6RwkrMcCa82NuUEPVIaNeRclpghahMRgMlOGOjdAXzSoyMjKWOprKtx ttGWe9vYTBjWg82+OOBYExWSB+oqjwwTfx/EGf6mdbr3wJdJVQnbch/hOh0b8rPUVEmO J3LAdnJv6ZYjnfDsU08gSykPj9ydU7fQw99zSd7PALAs8WzECohcuMPGykpJxfAUULLt DglYDR/0an8SgTPKTEOUMT7kzhPYBVWHA/oO8YWE28ax2DPG031blDgVN34pXGhUBugl O9oA== X-Gm-Message-State: ALoCoQmWWh6zujd6yaRH8F9K4COTb8c5oABfbaZH8obqYN5cdPrqzQmrA9PPPpPoCK9XljxS3Nis MIME-Version: 1.0 X-Received: by 10.60.95.193 with SMTP id dm1mr9688154oeb.16.1448037481769; Fri, 20 Nov 2015 08:38:01 -0800 (PST) Received: by 10.76.131.166 with HTTP; Fri, 20 Nov 2015 08:38:01 -0800 (PST) In-Reply-To: <923ebe527219fa16ca91e74b416b978803056d70.1447829123.git.pmatilai@redhat.com> References: <923ebe527219fa16ca91e74b416b978803056d70.1447829123.git.pmatilai@redhat.com> Date: Fri, 20 Nov 2015 17:38:01 +0100 Message-ID: From: David Marchand To: Panu Matilainen Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH] eal: fix plugindir processing to be filesystem agnostic X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Nov 2015 16:38:03 -0000 Hello Panu, On Wed, Nov 18, 2015 at 7:45 AM, Panu Matilainen wrote: > 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 > --- > 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; > } It looks like you would skip the symbolic links while you were not before. Intended ? -- David Marchand