Details

    • Technical task
    • Resolution: Not a Bug
    • Blocker
    • None
    • Lustre 2.5.0
    • None
    • 10041

    Description

      As i see, HSM patch have a land LL_IOC_SET_LEASE support.
      but it's support invalid and don't supported NFS v4 lease functionality and clustered samba.

      first of all, if lease conflict found - we need notify an application via sending an signal to release a lease, but implementation do NOTHING in that area.
      second, lease lock should be released after some timeout unconditionally and take to new owner.

      current implementation do NOTHING for both, so broke both NFS v4 and clustered samba.

      Attachments

        Activity

          [LU-3869] landing HSM broke a clustered samba support and NFS v4

          Per discussion between Oleg and Shadow, this is not actually a bug.

          adilger Andreas Dilger added a comment - Per discussion between Oleg and Shadow, this is not actually a bug.

          Right now, lustre release is only for HSM use so it didn't implement Linux lease semantics exactly. The framework is there so it can be easily extended to linux semantic by adding notification mechanism in ll_md_blocking_lease_ast() to send signal to lease holder.

          However the major difficult is in the lease request side because there is no callback to Lustre in linux kernel, in other words, linux lease is a pure VFS stuff. This implies that it's impossible to use Lustre lease via standard lease interfaces in libc.

          If you have resources on your side, you can finish the work by composing a kernel patch to add lease callbacks to file system and finish notification interfaces in ll_md_blocking_lease_ast().

          jay Jinshan Xiong (Inactive) added a comment - Right now, lustre release is only for HSM use so it didn't implement Linux lease semantics exactly. The framework is there so it can be easily extended to linux semantic by adding notification mechanism in ll_md_blocking_lease_ast() to send signal to lease holder. However the major difficult is in the lease request side because there is no callback to Lustre in linux kernel, in other words, linux lease is a pure VFS stuff. This implies that it's impossible to use Lustre lease via standard lease interfaces in libc. If you have resources on your side, you can finish the work by composing a kernel patch to add lease callbacks to file system and finish notification interfaces in ll_md_blocking_lease_ast().

          to reference

             When a process (the "lease breaker") performs an open(2) or
                 truncate(2) that conflicts with a lease established via F_SETLEASE,
                 the system call is blocked by the kernel and the kernel notifies the
                 lease holder by sending it a signal (SIGIO by default).  The lease
                 holder should respond to receipt of this signal by doing whatever
                 cleanup is required in preparation for the file to be accessed by
                 another process (e.g., flushing cached buffers) and then either
                 remove or downgrade its lease.  A lease is removed by performing an
                 F_SETLEASE command specifying arg as F_UNLCK.  If the lease holder
                 currently holds a write lease on the file, and the lease breaker is
                 opening the file for reading, then it is sufficient for the lease
                 holder to downgrade the lease to a read lease.  This is done by
                 performing an F_SETLEASE command specifying arg as F_RDLCK.
          
                 If the lease holder fails to downgrade or remove the lease within the
                 number of seconds specified in /proc/sys/fs/lease-break-time then the
                 kernel forcibly removes or downgrades the lease holder's lease.
          

          I think someone should be read a linux man page more carefully.

          shadow Alexey Lyashkov added a comment - to reference When a process (the "lease breaker") performs an open(2) or truncate(2) that conflicts with a lease established via F_SETLEASE, the system call is blocked by the kernel and the kernel notifies the lease holder by sending it a signal (SIGIO by default). The lease holder should respond to receipt of this signal by doing whatever cleanup is required in preparation for the file to be accessed by another process (e.g., flushing cached buffers) and then either remove or downgrade its lease. A lease is removed by performing an F_SETLEASE command specifying arg as F_UNLCK. If the lease holder currently holds a write lease on the file, and the lease breaker is opening the file for reading, then it is sufficient for the lease holder to downgrade the lease to a read lease. This is done by performing an F_SETLEASE command specifying arg as F_RDLCK. If the lease holder fails to downgrade or remove the lease within the number of seconds specified in /proc/sys/fs/lease-break-time then the kernel forcibly removes or downgrades the lease holder's lease. I think someone should be read a linux man page more carefully.

          People

            wc-triage WC Triage
            shadow Alexey Lyashkov
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: