Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-12244

lfs check subcommand no longer works as non-root user

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • None
    • Lustre 2.10.6
    • Client/Server: lustre-2.10.6_2.chaos-1.ch6.x86_64
      kernel: 3.10.0-957.5.1.3chaos.ch6.x86_64
    • 3
    • 9223372036854775807

    Description

      With the Lustre 2.10 client, non-root users appear to no longer be able to run "lfs check <servers|osts|mds>". Strace of the command shows a "Permission denied" error accessing /sys/kernel/debug/lustre/devices, resulting in the following error at runtime: error: check: mds status failed

      Our Operations staff w/o root access needs "lfs check ..." functionality to monitor and fix file system issues, so fixing this issue would helpful for us.

      statfs("/sys/kernel/debug/", {f_type=DEBUGFS_MAGIC, f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096, f_flags=ST_VALID|ST_RELATIME}) = 0
      stat("/sys/fs/lnet/devices", 0x7fffffff8760) = -1 ENOENT (No such file or directory)
      stat("/sys/fs/lustre/devices", 0x7fffffff8760) = -1 ENOENT (No such file or directory)
      stat("/sys/kernel/debug/lnet/devices", 0x7fffffff8740) = -1 EACCES (Permission denied)
      stat("/sys/kernel/debug/lustre/devices", 0x7fffffff8740) = -1 EACCES (Permission denied)
      stat("/proc/fs/lnet/devices", 0x7fffffff8760) = -1 ENOENT (No such file or directory)
      stat("/proc/fs/lustre/devices", 0x7fffffff8760) = -1 ENOENT (No such file or directory)
      stat("/proc/sys/lnet/devices", 0x7fffffff8760) = -1 ENOENT (No such file or directory)
      stat("/proc/sys/lustre/devices", 0x7fffffff8760) = -1 ENOENT (No such file or directory)
      write(2, "error: check: mds status failed\n", 32error: check: mds status failed
      ) = 32
      exit_group(2)                           = ?
      +++ exited with 2 +++
      

      Attachments

        Issue Links

          Activity

            [LU-12244] lfs check subcommand no longer works as non-root user
            ofaaland Olaf Faaland added a comment - - edited

            For our own recordkeeping, our local ticket: TOSS-4503

            ofaaland Olaf Faaland added a comment - - edited For our own recordkeeping, our local ticket: TOSS-4503
            ofaaland Olaf Faaland added a comment -

            Yep, that patch worked without any other patches or modification.

            ofaaland Olaf Faaland added a comment - Yep, that patch worked without any other patches or modification.
            ofaaland Olaf Faaland added a comment -

            Andreas, we haven't tried it, but we can do so today and post back.

            ofaaland Olaf Faaland added a comment - Andreas, we haven't tried it, but we can do so today and post back.

            Cameron, did you try out the patch for b2_10? Did it solve your problem? It only affects the userspace tools on the client, so you wouldn't need to upgrade all of the kernel modules or take an outage to install it.

            adilger Andreas Dilger added a comment - Cameron, did you try out the patch for b2_10? Did it solve your problem? It only affects the userspace tools on the client, so you wouldn't need to upgrade all of the kernel modules or take an outage to install it.
            charr Cameron Harr added a comment -

            ... And I had searched only on 2.10. Thanks.

            charr Cameron Harr added a comment - ... And I had searched only on 2.10. Thanks.

            LU-11850 only impacts 2.12 LTS users. 

            simmonsja James A Simmons added a comment - LU-11850 only impacts 2.12 LTS users. 
            charr Cameron Harr added a comment -

            Thank you both. My search for related tickets missed LU-11850, which is very similar.

            Sparing Redhat from some blame, we only recently started rolling out 2.10 clients (from 2.8) so this is only affecting us now.

            charr Cameron Harr added a comment - Thank you both. My search for related tickets missed LU-11850 , which is very similar. Sparing Redhat from some blame, we only recently started rolling out 2.10 clients (from 2.8) so this is only affecting us now.

            I've cherry-picked the patch to b2_10:

            https://review.whamcloud.com/34782

            adilger Andreas Dilger added a comment - I've cherry-picked the patch to b2_10: https://review.whamcloud.com/34782

            The move of the /proc/fs/lustre/devices file from procfs to debugfs was done as part of patch https://review.whamcloud.com/23428 "LU-8066 obdclass: move lustre sysctl to sysfs" landed for 2.9.56, so it has been in all 2.10 releases.

            I suspect the reason it is a problem now is that RedHat has backported a change from newer kernels to their kernel that makes debugfs root-only.

            adilger Andreas Dilger added a comment - The move of the /proc/fs/lustre/devices file from procfs to debugfs was done as part of patch https://review.whamcloud.com/23428 " LU-8066 obdclass: move lustre sysctl to sysfs" landed for 2.9.56, so it has been in all 2.10 releases. I suspect the reason it is a problem now is that RedHat has backported a change from newer kernels to their kernel that makes debugfs root-only.
            simmonsja James A Simmons added a comment - - edited

            We have fixes for that which landed to newer lustre versions. You need patch:

            https://review.whamcloud.com/33799

            simmonsja James A Simmons added a comment - - edited We have fixes for that which landed to newer lustre versions. You need patch: https://review.whamcloud.com/33799

            People

              pjones Peter Jones
              charr Cameron Harr
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: