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

llapi_open_by_fid open should not be cached systematically

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.16.0
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      llapi_open_by_fid() uses open_by_handle_at() since https://review.whamcloud.com/36603 ("LU-8585 llapi: use open_by_handle_at in llapi_open_by_fid"). But handle are used by NFS and cache open in that case to limit the number of open-close (close are sent to MDT only on lock conflict or cache shrinks, http://review.whamcloud.com/20354).

      This breaks the llsom_sync util, because it used llapi_open_by_fid and "trusted.som" xattrs are synchronized on close requests:

      [root@client client]# touch test                                                
      [root@client client]# dd if=/dev/zero of=test bs=1M count=1                     
      1+0 records in                                                                  
      1+0 records out                                                                 
      1048576 bytes (1.0 MB) copied, 0.00145669 s, 720 MB/s                           
      [root@client client]# lfs getsom test && stat test                              
      file: test size: 1048576 blocks: 0 flags: 4                                     
        File: ‘test’                                                                  
        Size: 1048576         Blocks: 2048       IO Block: 4194304 regular file       
      Device: 481510a2h/1209340066d   Inode: 144115205507383305  Links: 1             
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)        
      Access: 2023-01-12 11:22:03.000000000 +0100                                     
      Modify: 2023-01-12 11:22:07.000000000 +0100                                     
      Change: 2023-01-12 11:22:07.000000000 +0100                                     
       Birth: -                                                                       
      [root@client client]# cat test                                                                      
      [root@client client]# lfs getsom test && stat test                                                  
      file: test size: 1048576 blocks: 2048 flags: 4                                                      <----  updated
        File: ‘test’                                                                                      
        Size: 1048576         Blocks: 2048       IO Block: 4194304 regular file                           
      Device: 481510a2h/1209340066d   Inode: 144115205507383305  Links: 1                                 
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)                            
      Access: 2023-01-12 11:22:27.000000000 +0100                                                         
      Modify: 2023-01-12 11:22:07.000000000 +0100                                                         
      Change: 2023-01-12 11:22:07.000000000 +0100                                                         
       Birth: -                                                                                           
      [root@client client]# dd if=/dev/zero of=test bs=1M count=2 conv=notrunc                            
      2+0 records in                                                                                      
      2+0 records out                                                                                     
      2097152 bytes (2.1 MB) copied, 0.00210231 s, 998 MB/s                                               
      [root@client client]# lfs getsom test && stat test                                                  
      file: test size: 2097152 blocks: 2048 flags: 4                                                      
        File: ‘test’                                                                                      
        Size: 2097152         Blocks: 4096       IO Block: 4194304 regular file                           
      Device: 481510a2h/1209340066d   Inode: 144115205507383305  Links: 1                                 
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)                            
      Access: 2023-01-12 11:22:27.000000000 +0100                                                         
      Modify: 2023-01-12 11:23:02.000000000 +0100                                                         
      Change: 2023-01-12 11:23:02.000000000 +0100                                                         
       Birth: -                                                                                           
      [root@client client]# llsom_sync -u cl11 -m lustrefs-MDT0000 /media/lustrefs/client                 
      Start to sync 1 records.                                                                            
      [root@client client]# lfs getsom test && stat test                                                  
      file: test size: 2097152 blocks: 2048 flags: 4                                                       <---- not updated
        File: ‘test’                                                                                      
        Size: 2097152         Blocks: 4096       IO Block: 4194304 regular file                           
      Device: 481510a2h/1209340066d   Inode: 144115205507383305  Links: 1                                 
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)                            
      Access: 2023-01-12 11:22:27.000000000 +0100                                                         
      Modify: 2023-01-12 11:23:02.000000000 +0100                                                         
      Change: 2023-01-12 11:23:02.000000000 +0100                                                         
       Birth: -                                                                                           
      [root@client client]# cat test                                                                      
      [root@client client]# lfs getsom test && stat test                                                  
      file: test size: 2097152 blocks: 2048 flags: 4                                                      <---- not updated
        File: ‘test’                                                                                      
        Size: 2097152         Blocks: 4096       IO Block: 4194304 regular file                           
      Device: 481510a2h/1209340066d   Inode: 144115205507383305  Links: 1                                 
      Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)                            
      Access: 2023-01-12 11:24:29.000000000 +0100                                                         
      Modify: 2023-01-12 11:23:02.000000000 +0100                                                         
      Change: 2023-01-12 11:23:02.000000000 +0100                                                         
       Birth: -                                                                                           
      

      This is not seen by "sanity test 807" because https://review.whamcloud.com/32158 "LU-10948 llite: Introduce inode open heat counter" clears lock caches before calling "lfs getsom" (in check_lsom_data/check_lsom_size).

      Attachments

        Issue Links

          Activity

            [LU-16463] llapi_open_by_fid open should not be cached systematically

            "Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51540
            Subject: LU-16463 llite: replace lld_nfs_dentry flag with opencache handling
            Project: fs/lustre-release
            Branch: b2_15
            Current Patch Set: 1
            Commit: 8851053466b545039d6719a39d9726066c651b82

            gerrit Gerrit Updater added a comment - "Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/51540 Subject: LU-16463 llite: replace lld_nfs_dentry flag with opencache handling Project: fs/lustre-release Branch: b2_15 Current Patch Set: 1 Commit: 8851053466b545039d6719a39d9726066c651b82
            pjones Peter Jones made changes -
            Fix Version/s New: Lustre 2.16.0 [ 15190 ]
            Resolution New: Fixed [ 1 ]
            Status Original: Open [ 1 ] New: Resolved [ 5 ]
            pjones Peter Jones added a comment -

            Landed for 2.16

            pjones Peter Jones added a comment - Landed for 2.16

            "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/49237/
            Subject: LU-16463 llite: replace lld_nfs_dentry flag with opencache handling
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: d7a85652f4fcb83192262cfc1a0211890f404c7c

            gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/49237/ Subject: LU-16463 llite: replace lld_nfs_dentry flag with opencache handling Project: fs/lustre-release Branch: master Current Patch Set: Commit: d7a85652f4fcb83192262cfc1a0211890f404c7c
            simmonsja James A Simmons added a comment - - edited

            Personally I like to see us move away from opencache since its rarely needed anymore. Let me update my patch. Now I don't like your idea of using a flag I could see passing in an open count limit. By default it would be zero but it would allow the user to cache the open if they wanted after a certain open count. That would be powerful.

            simmonsja James A Simmons added a comment - - edited Personally I like to see us move away from opencache since its rarely needed anymore. Let me update my patch. Now I don't like your idea of using a flag I could see passing in an open count limit. By default it would be zero but it would allow the user to cache the open if they wanted after a certain open count. That would be powerful.

            "Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/49616
            Subject: LU-16463 llite: fix the opencache for llapi_open_by_fid()
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: 49d440cd9132d799a98e3264494015e3faaa4fba

            gerrit Gerrit Updater added a comment - "Etienne AUJAMES <eaujames@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/49616 Subject: LU-16463 llite: fix the opencache for llapi_open_by_fid() Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 49d440cd9132d799a98e3264494015e3faaa4fba

            Can you try patch https://review.whamcloud.com/#/c/fs/lustre-release/+/49237

            I have read the patch, that should work.
            I was working on the following patch to avoid caching opens only for llapi_open_by_fid().

            eaujames Etienne Aujames added a comment - Can you try patch https://review.whamcloud.com/#/c/fs/lustre-release/+/49237 I have read the patch, that should work. I was working on the following patch to avoid caching opens only for llapi_open_by_fid().
            pjones Peter Jones made changes -
            Assignee Original: WC Triage [ wc-triage ] New: Etienne Aujames [ eaujames ]
            simmonsja James A Simmons added a comment - Can you try patch https://review.whamcloud.com/#/c/fs/lustre-release/+/49237
            eaujames Etienne Aujames made changes -
            Link New: This issue is related to LU-10948 [ LU-10948 ]

            People

              eaujames Etienne Aujames
              eaujames Etienne Aujames
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: