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

llapi_open_by_fid open should not be cached systematically

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • Lustre 2.16.0
    • 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

            People

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

              Dates

                Created:
                Updated:
                Resolved: