Method and system for locking file in network file system, equipment and medium

A network file system and file locking technology, applied in the field of file locking by network file system, can solve problems such as loss of lock status information and problems with NFS applications.

Pending Publication Date: 2022-01-28
INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] After the NFS-server process fails and restarts or the storage node fails, the lock status information added by the client to the file through the NFS network file system will be lost, resulting in the actual lock status of the storage node and the client, resulting in the NFS of the client. application problem

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and system for locking file in network file system, equipment and medium
  • Method and system for locking file in network file system, equipment and medium
  • Method and system for locking file in network file system, equipment and medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0044] Embodiment 1 of the present invention proposes a method for locking files in a network file system. The present invention provides the receiving and processing of file lock requests in the network file system, and recovery of file locks in the network file system under abnormal conditions.

[0045] Such as figure 1 A flow chart of a method for locking a file in a network file system according to Embodiment 1 of the present invention is given

[0046] In step S101, a file lock request is received, and a lock record is generated;

[0047] The NFS-server receives the lock request and generates a lock record, where the lock record includes the client ID, file handle, the starting position of the file lock, the scope of the file lock, the type of the file lock and the status of the file lock. The initial file lock status is unlock status.

[0048] In step S102, if query the original file lock list according to the lock record, there is no lock record with the same and the ...

Embodiment 2

[0077] Based on the method for locking files by a network file system proposed in Embodiment 1 of the present invention, a system for locking files by a network file system is also proposed. Such as Figure 5 It is a system schematic diagram of locking files by a network file system according to Embodiment 2 of the present invention. The system includes a receiving module and a locking module;

[0078] The receiving module is used to receive file lock requests and generate lock records;

[0079] The lock module is used to query the original file lock list according to the lock record, which does not have the same and the same range of lock records, and does not have conflicting locks; then add the lock record to the original file lock list to obtain the first file lock list, and write the first file lock list into the database; then perform file locking.

[0080] The method of querying the lock records that do not have the same and the same range in the original file lock l...

Embodiment 3

[0087] The invention also proposes a device comprising:

[0088] memory for storing computer programs;

[0089] When the processor is used to execute the computer program, the method steps are as follows:

[0090] Such as figure 1 A flow chart of a method for locking a file in a network file system according to Embodiment 1 of the present invention is given

[0091] In step S101, a file lock request is received, and a lock record is generated;

[0092] The NFS-server receives the lock request and generates a lock record, where the lock record includes the client ID, file handle, the starting position of the file lock, the scope of the file lock, the type of the file lock and the status of the file lock. The initial file lock status is unlock status.

[0093] In step S102, if query the original file lock list according to the lock record, there is no lock record with the same and the same range, nor conflict lock; then add the lock record to the original file lock list to o...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention provides a method and system for locking a file in a network file system, equipment and a medium. The method comprises the following steps: receiving a file locking request, and generating a locking record; if the lock list of the original file is inquired according to the lock records, indicating that the lock records in the same range and the lock records in the same range do not exist, and the conflict lock does not exist; if so, adding the locking record into the original file lock list to obtain a first file lock list, and writing the first file lock list into a database; and executing file locking. The method comprises the steps of file unlocking, file repairing and file sharing. Based on the method, the invention further provides a system for locking the file in the network file system, equipment and the medium. The continuity of the lock state is kept according to the lock state recorded in the database before the data is recovered, the use experience of the NFS network file system is improved, the NFS process can realize fault recovery on all file lock requests, and the stability and the reliability of the NFS are improved.

Description

technical field [0001] The invention belongs to the technical field of file storage, and in particular relates to a method, system, device and medium for locking files by a network file system. Background technique [0002] NFS (Network File System) is a network file system, which is one of the file systems supported by FreeBSD, which allows resources to be shared between computers in the network. In NFS applications, local NFS client applications can transparently read and write files located on remote NFS servers, just like accessing local files. The NFS sharing service is a service process that provides file sharing in the NAS cluster storage system. The characteristics of storage require that this type of process must run stably for a long time, especially for dual-controller storage systems. [0003] After the NFS-server process fails and restarts or the storage node fails, the lock status information added by the client to the file through the NFS network file system ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/176G06F16/178G06F16/182G06F16/27
CPCG06F16/1774G06F16/178G06F16/183G06F16/27
Inventor 刘相乐
Owner INSPUR SUZHOU INTELLIGENT TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products