HSM _not only_ small fixes and to do list goes here (LU-3647)

[LU-3869] landing HSM broke a clustered samba support and NFS v4 Created: 31/Aug/13  Updated: 04/Sep/13  Resolved: 04/Sep/13

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.5.0
Fix Version/s: None

Type: Technical task Priority: Blocker
Reporter: Alexey Lyashkov Assignee: WC Triage
Resolution: Not a Bug Votes: 0
Labels: None

Rank (Obsolete): 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.



 Comments   
Comment by Alexey Lyashkov [ 31/Aug/13 ]

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.

Comment by Jinshan Xiong (Inactive) [ 31/Aug/13 ]

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().

Comment by Andreas Dilger [ 04/Sep/13 ]

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

Generated at Sat Feb 10 01:37:37 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.