跳转到主内容

是否在 ONTAP 文件系统中使用 fcntl 或 LockFileEx 来实现独占锁定?

Views:
Visibility:
Public
Votes:
0
Category:
ontap-9
Specialty:
nas
Last Updated:

适用于

ONTAP 9

问题解答

  • 否,ONTAP 文件系统不使用 fcntlLockFileEx 在文件系统级别提供独占锁定。
  • 对于 NFSv3 访问,文件锁定由 Network Lock Manager (NLM) 管理。 
    • NLM 仅提供建议锁。
    • 建议锁需要客户端应用程序来检查和兑现锁。
    • 如果应用程序未检查锁定,客户端可以访问锁定的文件或区域。
  • 对于 NFSv4.x,通过共享保留锁定机制支持强制锁定。 
    • 共享预订锁定在协议级别强制执行。
    • 使用共享预订锁定锁定文件时,将根据锁定类型阻止来自其他客户端的访问。
    • 有关 NFSv4 的强制锁定的详细信息,请参阅ONTAP 9 上 NFSv4 的强制锁定支持方式
  • fcntl 在 UNIX/Linux 上使用 POSIX 咨询字节范围(记录)锁定。 
    • 在 NFSv4.x 上,内核将 fcntl 锁定映射到 NFSv4 锁定操作。
    • NFSv4 共享保留锁与 fcntl 锁不同;它是 OPEN 操作和控制文件打开模式(share_accessshare_deny)的一部分。
    • POSIX 不会通过 fcntl 公开共享拒绝语义。
    • 大多数 UNIX/Linux NFSv4 客户端默认使用 share_deny-none
  • 对于 Windows 客户端,LockFileEx 用于通过 CIFS/SMB 进行建议锁定。 

锁定实施取决于应用程序和协议行为。

  • NFSv3 不支持强制锁定。
  • NFSv4.x 支持通过 Share Reservation Lock 强制锁定,但 POSIX API (fcntl) 不提供请求共享拒绝语义的方法

追加信息

additionalInformation_text
NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.