[LU-11988] Some lctl *_param values only readable by root Created: 21/Feb/19  Updated: 25/Feb/19  Resolved: 25/Feb/19

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.12.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Christopher Morrone Assignee: Patrick Farrell (Inactive)
Resolution: Duplicate Votes: 0
Labels: llnl

Issue Links:
Duplicate
duplicates LU-11850 Relocating /proc/fs/lustre/ost to /sy... In Progress
Related
is related to LU-11850 Relocating /proc/fs/lustre/ost to /sy... In Progress
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

Some lustre stats that used to be in /proc now reside in debugfs.  This seems all for the better, but it looks like the lctl [get|set|list]_param commands were not updated to look for the values in the new location.  Since the lctl *_param functions are meant to make these kinds of moves transparent to users, we think it is important to have lctl look in debugfs as well.

For example, in going from 2.10 to 2.12, we noticed that 'llite.*.stats' seem to have disappeared (but really are just hiding in debugfs):

$ lctl get_param 'llite.*.stats'
error: get_param: param_path 'llite/*/stats': No such file or directory


 Comments   
Comment by Patrick Farrell (Inactive) [ 21/Feb/19 ]

Hmm, it does look there, and has since well before 2.12.  lctl finds the llite stats just fine on my node here, and it's definitely in debugfs.

Let's check a few things.

cat /proc/version

mount -t lustre
lctl --version

Verify the file is really there in debugfs - maybe debugfs isn't mounted or Lustre isn't mounted or something else is weird...?

Show the exact path in debugfs, in case something odd is up with that...?

Then, strace -v your lctl get_param command, and let's see if we learn anything else.

 

BTW, this is the patch that added it:

LU-5030 libcfs: create cfs_get_paths() function

With the move of the upstream client to sysfs the
lustre and lnet utilites no long should directly
access the proc file system. To avoid this a new
function is created to support both the traditional
procfs lustre/lnet parameters as well as the new
sysfs lustre/lnet parameters as well. Besides the
creation of these functions the LNet utilites are
converted to use these new functions.

Change-Id: I78788f41955073e1e48126103ef2aec13d64812b
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Signed-off-by: Wang Chao <chao.ornl@gmail.com>
Reviewed-on: http://review.whamcloud.com/17459
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Ryan Haasken <haasken@cray.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>

Comment by Patrick Farrell (Inactive) [ 21/Feb/19 ]

We do assume a mount point for debugfs:

{/sys/\{fs,kernel/debug}

/{lnet,lustre}/,
ie, /sys/kernel/debug/

Comment by James A Simmons [ 21/Feb/19 ]

Are you attempting to run as a non-root user? By default debugfs only allows root access.

Comment by Christopher Morrone [ 21/Feb/19 ]

Doh!  Yeah, it is just a permissions problem, my bad.

What is the approach to address this from Lustre folks so far?  I assume that debugfs is probably root-only access for a reason, but there are things in there that we want to allow non-root processes to access. 

Also, if lctl had returned a permissions error rather than a not-found error, that might have made it more obvious what I was looking for.

Comment by James A Simmons [ 25/Feb/19 ]

To let you know I'm work on a solution to resolve this (LU-11850). Its up to Peter if its okay to backport to 2.12 LTS.

Comment by Christopher Morrone [ 25/Feb/19 ]

Resolving as duplicate of LU-11850.

Generated at Sat Feb 10 02:48:41 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.