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

When nfs exports lustre, chmod the strip directory under the strip directory will have a Permission Deny occurs error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Minor
    • None
    • Lustre 2.12.4
    • None

    Description

       

      nfs server(lustre client):

      # lfs getdirstripe test
      lmv_stripe_count: 8 lmv_stripe_offset: 0 lmv_hash_type: fnv_1a_64
      mdtidx           FID[seq:oid:ver]
           0           [0x200000400:0xe:0x0]
           1           [0x7c0000407:0xe:0x0]
           2           [0x280000405:0xe:0x0]
           3           [0x240000405:0xe:0x0]
           4           [0x340000403:0xe:0x0]
           5           [0x2c0000405:0xe:0x0]
           6           [0x380000404:0xe:0x0]
           7           [0x300000403:0xe:0x0] 
      
      # cd test
      # ls
      debug
      # lfs getdirstripe debug
      lmv_stripe_count: 8 lmv_stripe_offset: 0 lmv_hash_type: fnv_1a_64
      mdtidx           FID[seq:oid:ver]
           0           [0x200000bd0:0x4:0x0]
           1           [0x7c0000bd1:0x4:0x0]
           2           [0x280000bd1:0x4:0x0]
           3           [0x240000bd1:0x4:0x0]
           4           [0x340000bd1:0x4:0x0]
           5           [0x2c0000bd2:0x4:0x0]
           6           [0x380000bd1:0x4:0x0]
           7           [0x300000bd1:0x4:0x0]

      nfs client:

       

      # cd /mnt/nfs3/test
      # ls
      debug
      # chmod 755 debug
      # ls
      ls: cannot access debug: Permission denied
      ls: reading directory .: Permission denied
      debug
      # ls
      ls: reading directory .: Permission denied

       

      When I execute ls in the directory of the nfs server, the nfs client ls can return to normal

      nfs server(lustre client):

       

      # pwd
      /muzitest/test
      # ls
      debug

      nfs client:

      # ls
      debug 

      I tried to check on the nfs server (lustre client) and found that the parent_fid in ll_dir_get_parent_fid was incorrectly obtained. This function should correctly obtain the fid of the parent directory of debug, but it lacked the fid of debug itself.

      Therefore, I started to investigate the code on the server side and found that the step to return the debug directory fid is in the mdt_raw_lookup function:

      The mdo_lookup call chain is as follows:

       

      mdt_raw_lookup --> mdd_lookup --> dio_lookup --> lod_lookup --> osd_index_ea_lookup --> osd_ea_lookup_rec

      In the osd_ea_lookup_rec function, I found that the fid is obtained in the osd_get_fid_from_dentry function, and the content of struct ldiskfs_dir_entry_2 *de is filled in osd_ldiskfs_find_entry. But I can't find the code related to osd_ldiskfs_find_entry in the source code, so I can't analyze it further.

      Attachments

        Issue Links

          Activity

            People

              wc-triage WC Triage
              jiahaoli Jiahao Li
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: