[dpdk-dev] fbarray: make all fbarrays hidden files

Message ID 738d08e521a8987ceeb2748db5b765d8b8531e54.1524481846.git.anatoly.burakov@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Anatoly Burakov April 23, 2018, 11:14 a.m. UTC
  fbarray stores its data in a shared file, which is not hidden.
This leads to polluting user's HOME directory with visible
files when running DPDK as non-root. Change fbarray to always
create hidden files by default.

Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---

Notes:
    Is /tmp always user-accessible? Maybe not use home
    directory at all?

 lib/librte_eal/common/eal_filesystem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Bruce Richardson April 23, 2018, 12:48 p.m. UTC | #1
On Mon, Apr 23, 2018 at 12:14:13PM +0100, Anatoly Burakov wrote:
> fbarray stores its data in a shared file, which is not hidden.
> This leads to polluting user's HOME directory with visible
> files when running DPDK as non-root. Change fbarray to always
> create hidden files by default.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
> 
> Notes:
>     Is /tmp always user-accessible? Maybe not use home
>     directory at all?
> 
Good change.

Acked-by: Bruce Richardson <bruce.richardson@intel.com>

A further improvement would to put the files as not-hidden but inside a
hidden subdirectory e.g. ".dpdk"
  
Anatoly Burakov April 23, 2018, 1:47 p.m. UTC | #2
On 23-Apr-18 1:48 PM, Bruce Richardson wrote:
> On Mon, Apr 23, 2018 at 12:14:13PM +0100, Anatoly Burakov wrote:
>> fbarray stores its data in a shared file, which is not hidden.
>> This leads to polluting user's HOME directory with visible
>> files when running DPDK as non-root. Change fbarray to always
>> create hidden files by default.
>>
>> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
>> ---
>>
>> Notes:
>>      Is /tmp always user-accessible? Maybe not use home
>>      directory at all?
>>
> Good change.
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 
> A further improvement would to put the files as not-hidden but inside a
> hidden subdirectory e.g. ".dpdk"
> 

Good suggestions, I'll work on this.
  
Thomas Monjalon April 23, 2018, 7:56 p.m. UTC | #3
23/04/2018 15:47, Burakov, Anatoly:
> On 23-Apr-18 1:48 PM, Bruce Richardson wrote:
> > On Mon, Apr 23, 2018 at 12:14:13PM +0100, Anatoly Burakov wrote:
> >> fbarray stores its data in a shared file, which is not hidden.
> >> This leads to polluting user's HOME directory with visible
> >> files when running DPDK as non-root. Change fbarray to always
> >> create hidden files by default.
> >>
> >> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> >> ---
> >>
> >> Notes:
> >>      Is /tmp always user-accessible? Maybe not use home
> >>      directory at all?
> >>
> > Good change.
> > 
> > Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks


> > A further improvement would to put the files as not-hidden but inside a
> > hidden subdirectory e.g. ".dpdk"
> 
> Good suggestions, I'll work on this.

There are other places where we create file.
Please try to move all in the same place.
  

Patch

diff --git a/lib/librte_eal/common/eal_filesystem.h b/lib/librte_eal/common/eal_filesystem.h
index ad059ef..fe4c455 100644
--- a/lib/librte_eal/common/eal_filesystem.h
+++ b/lib/librte_eal/common/eal_filesystem.h
@@ -13,7 +13,7 @@ 
 
 /** Path of rte config file. */
 #define RUNTIME_CONFIG_FMT "%s/.%s_config"
-#define FBARRAY_FMT "%s/%s_%s"
+#define FBARRAY_FMT "%s/.%s_%s"
 
 #include <stdint.h>
 #include <limits.h>