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

Add open_by_handle() syscall for Lustre clients

Details

    • New Feature
    • Resolution: Fixed
    • Minor
    • Lustre 2.6.0
    • None
    • 8271

    Description

      The open_by_handle_at() and name_to_handle() functions were added to Linux 2.6.38, and allow opening files by a file handle instead of path traversal. This may be useful for HPC applications to reduce loading on the metadata server from repeated path traversal.

      There is some chance this feature already works on Lustre, due to the re-use of the NFS exportfs_encode_fh() and exportfs_decode_fh() functions. This code needs a regression test in Lustre to verify it is working correctly, along with documentation in the user manual.

      Attachments

        Issue Links

          Activity

            [LU-3344] Add open_by_handle() syscall for Lustre clients
            pjones Peter Jones added a comment -

            Fixed in 2.6

            pjones Peter Jones added a comment - Fixed in 2.6

            The last patch http://review.whamcloud.com/#/c/7247 has been merged. This ticket can be closed.

            simmonsja James A Simmons added a comment - The last patch http://review.whamcloud.com/#/c/7247 has been merged. This ticket can be closed.

            Patch http://review.whamcloud.com/#/c/7247 has been updated and tested.

            [root@spoon46 tests]# ./check_fhandle_syscalls temp-file /lustre/barry
            fh_bytes: 32
            fh_type: 151
            fh_data: 0 4 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
            check_fhandle_syscalls test Passed!

            simmonsja James A Simmons added a comment - Patch http://review.whamcloud.com/#/c/7247 has been updated and tested. [root@spoon46 tests] # ./check_fhandle_syscalls temp-file /lustre/barry fh_bytes: 32 fh_type: 151 fh_data: 0 4 0 0 2 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 check_fhandle_syscalls test Passed!

            I updated the patch. Even tho I was testing with a 3.11 kernel I couldn't get this to work but then I realized the kernel has to be configured with CONFIG_FHANDLE so I updated the autoconf test to handle this case. I also removed the FC18 condition for the sanity test since this is not the case for me.

            simmonsja James A Simmons added a comment - I updated the patch. Even tho I was testing with a 3.11 kernel I couldn't get this to work but then I realized the kernel has to be configured with CONFIG_FHANDLE so I updated the autoconf test to handle this case. I also removed the FC18 condition for the sanity test since this is not the case for me.
            pjones Peter Jones added a comment -

            Yu, Jian will take over ensuring that this patch lands

            pjones Peter Jones added a comment - Yu, Jian will take over ensuring that this patch lands
            pjones Peter Jones added a comment -

            Bobbie

            Could you please review and take care of this patch?

            Thanks

            Peter

            pjones Peter Jones added a comment - Bobbie Could you please review and take care of this patch? Thanks Peter

            As noted in the ticket description the syscalls and the structure file_handle were added in Linux kernel 2.6.39

            I have added a config time check which checks whether file_handle, name_to_handle_at() and open_by_handle_at() can be resolved.
            I expect this patch (http://review.whamcloud.com/#/c/7247/5) to solve the build errors on targets where these syscalls aren't supported.

            spimpale Swapnil Pimpale (Inactive) added a comment - As noted in the ticket description the syscalls and the structure file_handle were added in Linux kernel 2.6.39 I have added a config time check which checks whether file_handle, name_to_handle_at() and open_by_handle_at() can be resolved. I expect this patch ( http://review.whamcloud.com/#/c/7247/5 ) to solve the build errors on targets where these syscalls aren't supported.

            While testing these syscalls on FC18 client, I hit this (https://jira.hpdd.intel.com/browse/LU-3717) panic in ll_enocde_fh()

            spimpale Swapnil Pimpale (Inactive) added a comment - While testing these syscalls on FC18 client, I hit this ( https://jira.hpdd.intel.com/browse/LU-3717 ) panic in ll_enocde_fh()

            Please note that the above patch (http://review.whamcloud.com/#/c/7129/) is abandoned.

            I have added a new patch here (http://review.whamcloud.com/#/c/7247/)
            As mentioned in the previous comment, these syscalls are supported in glibc >= 2.14
            So currently this test is run only on FC18 clients which have 2.16 glibc and skipped otherwise.

            spimpale Swapnil Pimpale (Inactive) added a comment - Please note that the above patch ( http://review.whamcloud.com/#/c/7129/ ) is abandoned. I have added a new patch here ( http://review.whamcloud.com/#/c/7247/ ) As mentioned in the previous comment, these syscalls are supported in glibc >= 2.14 So currently this test is run only on FC18 clients which have 2.16 glibc and skipped otherwise.

            Status : Work In Progress

            Here is the initial patch for sanity tests to check 'name_to_handle_at' and 'open_by_handle_at' syscalls.
            http://review.whamcloud.com/#/c/7129/

            Currently the patch is incomplete because 'name_to_handle_at' and 'open_by_handle_at' are updated in glibc 2.14. Current Glibc version is 2.12. So for now we are calling the syscalls with syscall numbers directly.

            gmahajan Gaurav Mahajan (Inactive) added a comment - Status : Work In Progress Here is the initial patch for sanity tests to check 'name_to_handle_at' and 'open_by_handle_at' syscalls. http://review.whamcloud.com/#/c/7129/ Currently the patch is incomplete because 'name_to_handle_at' and 'open_by_handle_at' are updated in glibc 2.14. Current Glibc version is 2.12. So for now we are calling the syscalls with syscall numbers directly.

            People

              yujian Jian Yu
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: