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

"lfs quota" output is difficult to read

Details

    • Improvement
    • Resolution: Done
    • Minor
    • None
    • None
    • 2.12.9 on my VM
    • 9223372036854775807

    Description

      Sometime I need to work with customer on quota issue.

      And all time I need to think twice on the way the command display things.

      For example on a simple test : 

       

      root@es522vm0:/lustre/testfs/client/test/ lfs setquota   -u user1000 -b 100m -B 200M -i 10000  -I 20000  /lustre/testfs/client/   
      
      root@es522vm0:/lustre/testfs/client/test/ lfs quota -h -u user1000 /lustre/testfs/client/                                                           
      Disk quotas for usr user1000 (uid 1000):
           Filesystem    used   quota   limit   grace   files   quota   limit   grace
      /lustre/testfs/client/
                          16k    100M    200M       -       2   10000   20000       - 

      Here, if you are not familiar with quota ( and I'm not ). 

      Having some hint from the banner which say "block" are on the left, inode are on the right, grace is in "time" could help lots and lots of people like me.

       

      The following function display the title : lustre/utils/lfs.c

       

      static void print_quota_title(char *name, struct if_quotactl *qctl,
                                    bool human_readable, bool show_default)
      {
              if (show_default) {
                      printf("Disk default %s quota:\n", qtype_name(qctl->qc_type));
                      printf("%15s %8s%8s%8s %8s%8s%8s\n",
                             "Filesystem", "bquota", "blimit", "bgrace",
                             "iquota", "ilimit", "igrace");
              } else {
                      printf("Disk quotas for %s %s (%cid %u):\n",
                             qtype_name(qctl->qc_type), name,
                             *qtype_name(qctl->qc_type), qctl->qc_id);
                      printf("%15s%8s %7s%8s%8s%8s %7s%8s%8s\n",
                             "Filesystem", human_readable ? "used" : "kbytes",
                             "quota", "limit", "grace",
                             "files", "quota", "limit", "grace");
              }
      }

      Is it possible in the future to standardized the display like it is done with "Default User", "Default Group", "Default Project". Because here, we know we are talking about inode or block.

      To be honnest, it's hard to read if you don't do that daily.

      At the same time, it could allow to fix the allignment of the "printf" between "defaultUser/Group/Project"  and the standard output.

       

      Attachments

        Issue Links

          Activity

            [LU-18220] "lfs quota" output is difficult to read
            fdilger Fred Dilger added a comment -

            Resolved by the patch for LU-18097

            fdilger Fred Dilger added a comment - Resolved by the patch for LU-18097
            fdilger Fred Dilger added a comment -

            These header changes have now been added in LU-18079

            fdilger Fred Dilger added a comment - These header changes have now been added in LU-18079

            fdilger I think your patch "LU-18079 utils: argument parse opts for lfs quota" can fix this issue easily with a minor simplification, so it may as well be done there.

            adilger Andreas Dilger added a comment - fdilger I think your patch " LU-18079 utils: argument parse opts for lfs quota " can fix this issue easily with a minor simplification, so it may as well be done there.

            I don't think there would be any problem to change the header line for the "lfs quota" output to print "bquota", "blimit", "bgrace" and "iquota", "ilimit", "igrace". In patch https://review.whamcloud.com/55894 "LU-18079 utils: argument parse opts for lfs quota" it is actually having to add complexity to not print the bquota, ... headers, so this should just be changed.

            I don't think this will break anything (why would output scripts be parsing the header lines?) and the LU-18079 patch is also adding the ability to print individual quota fields (to avoid parsing the quota output at all).

            adilger Andreas Dilger added a comment - I don't think there would be any problem to change the header line for the " lfs quota " output to print " bquota ", " blimit ", " bgrace " and " iquota ", " ilimit ", " igrace ". In patch https://review.whamcloud.com/55894 " LU-18079 utils: argument parse opts for lfs quota " it is actually having to add complexity to not print the bquota , ... headers, so this should just be changed. I don't think this will break anything (why would output scripts be parsing the header lines?) and the LU-18079 patch is also adding the ability to print individual quota fields (to avoid parsing the quota output at all).

            I know it's far to be a miracle patch, but just this would be better : 

            root@es522vm0:/scratch/lustre-2.12.3_ddn44/ diff -Naur ./lustre/utils/lfs.c.orig ./lustre/utils/lfs.c
            --- ./lustre/utils/lfs.c.orig   2021-12-15 12:02:29.624223066 +0000
            +++ ./lustre/utils/lfs.c        2021-12-15 12:03:50.182383723 +0000
            @@ -6196,8 +6196,8 @@
                                   *qtype_name(qctl->qc_type), qctl->qc_id);
                            printf("%15s%8s %7s%8s%8s%8s %7s%8s%8s\n",
                                   "Filesystem", human_readable ? "used" : "kbytes",
            -                      "quota", "limit", "grace",
            -                      "files", "quota", "limit", "grace");
            +                      "bquota", "blimit", "bgrace",
            +                      "files", "iquota", "ilimit", "igrace");
                    }
             }
             
            
            root@es522vm0:/scratch/lustre-2.12.3_ddn44/ lustre/utils/lfs quota -h -u user1000   /lustre/testfs/client/
            Disk quotas for usr user1000 (uid 1000):
                 Filesystem    used  bquota  blimit  bgrace   files  iquota  ilimit  igrace
            /lustre/testfs/client/
                                16k    100M    200M       -       2   10000   20000       -
             
            jpeyrard Johann Peyrard (Inactive) added a comment - I know it's far to be a miracle patch, but just this would be better :  root@es522vm0:/scratch/lustre-2.12.3_ddn44/ diff -Naur ./lustre/utils/lfs.c.orig ./lustre/utils/lfs.c --- ./lustre/utils/lfs.c.orig   2021-12-15 12:02:29.624223066 +0000 +++ ./lustre/utils/lfs.c        2021-12-15 12:03:50.182383723 +0000 @@ -6196,8 +6196,8 @@                        *qtype_name(qctl->qc_type), qctl->qc_id);                 printf( "%15s%8s %7s%8s%8s%8s %7s%8s%8s\n" ,                         "Filesystem" , human_readable ? "used" : "kbytes" , -                       "quota" , "limit" , "grace" , -                       "files" , "quota" , "limit" , "grace" ); +                       "bquota" , "blimit" , "bgrace" , +                       "files" , "iquota" , "ilimit" , "igrace" );         }  }   root@es522vm0:/scratch/lustre-2.12.3_ddn44/ lustre/utils/lfs quota -h -u user1000   /lustre/testfs/client/ Disk quotas for usr user1000 (uid 1000):      Filesystem    used  bquota  blimit  bgrace   files  iquota  ilimit  igrace /lustre/testfs/client/                     16k    100M    200M       -       2   10000   20000       -

            People

              fdilger Fred Dilger
              jpeyrard Johann Peyrard (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: