File attribute setting method, client, storage server, equipment and system
By introducing a mechanism for batch setting of file attributes between the client and the storage server, the problem of resource consumption when setting multiple file attributes in the prior art is solved, and a more efficient file attribute setting is achieved.
Patent Information
- Application Number
- CN202311834432.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-27
- Publication Date
- 2025-06-27
AI Technical Summary
In the prior art, when setting the file attributes of multiple files, multiple setting commands are required, resulting in large consumption of network resources and low efficiency in setting file attributes. Especially in multi-level directory and large directory scenarios, the client's storage resources and computing resources are also consumed in large quantities.
The client sends a setting request to the storage server, instructing the storage server to set the file attributes of multiple files in batches, realizes the use of recursive setting parameters, and reduces the number of setting commands transmitted between the client and the storage server.
It reduces the network resource consumption between the client and the storage server, improves the efficiency of file attribute setting, and reduces the consumption of the client's storage resources and computing resources.
Smart Images

Figure CN120223704A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and in particular, to a method for setting file attributes, a client, a storage server, a device, and a system. Background Art
[0002] Currently, a client can mount shared files of a storage server and remotely access the shared files of the storage server through a network. Among them, the client can perform operations such as attribute query and attribute setting on files. Generally, the client sends a Readdir command word to the storage server to obtain a file list, and then the client performs operations such as attribute query and attribute setting on each file separately. Then, as the number of files increases, the amount of data transmitted between the client and the storage server also increases, resulting in a large consumption of network resources and a low file attribute setting efficiency. Moreover, in the scenarios of multi-level directories and large directories, due to the client caching and traversing the file list, a large amount of storage resources and computing resources of the client are consumed. Summary of the Invention
[0003] This application provides a method for setting file attributes, a client, a storage server, a device, and a system, thereby improving the file attribute setting efficiency and reducing the consumption of network resources, as well as the storage resources and computing resources of the client.
[0004] In a first aspect, a method for setting file attributes is provided. This method is executed by a client, and the method includes: the client sends a setting request to the storage server, instructing the storage server to set the file attributes of multiple files. Furthermore, a setting response is received, and the setting response is used to indicate the setting result of the file attributes of the multiple files according to the setting request.
[0005] Compared with setting the file attributes of only one file based on one setting command, when setting the file attributes of multiple files, multiple setting commands need to be sent, resulting in a large consumption of network resources and a reduction in the file attribute setting efficiency. In the solution provided by this application, the client does not need to send multiple setting commands for file attributes. Based on one setting command, the file attributes of multiple files are set, realizing batch setting of file attributes, reducing the number of setting commands transmitted between the client and the storage server. Thus, the consumption of network resources is reduced, and the file attribute setting efficiency is improved. In addition, the client does not need to send a Readdir command word to obtain the file list, does not need to store the file list, and traverses the file list to send setting commands for each file. Thus, the consumption of the storage resources and computing resources of the client is reduced.
[0006] In a possible implementation manner, the setting request includes a recursive setting parameter, and the recursive setting parameter is used to indicate setting the file attributes of the first file and the multi-level sub-files included in the first file.
[0007] In another possible implementation, the setting request includes the identifier of the first file among multiple files.
[0008] In this way, a recursive setting parameter is added to the setting request to instruct the storage server to set the file attributes of the first file and the file attributes of the multi-level sub-files included in the first file. Thus, batch setting of file attributes is achieved, reducing the number of setting commands transmitted between the client and the storage server, thereby reducing network resource consumption and improving the efficiency of file attribute setting.
[0009] In another possible implementation, the setting request further includes either a synchronization identifier or an asynchronization identifier. The synchronization identifier is used to instruct the storage server to feedback the setting response in a synchronous manner. The asynchronization identifier is used to instruct the storage server to feedback the setting response in an asynchronous manner.
[0010] Thus, the storage server can feedback the setting response in a synchronous or asynchronous manner, enabling the client to know the setting result.
[0011] In another possible implementation, the setting result is used to indicate success or failure.
[0012] Thus, it is convenient for the client to know the setting result. When the setting fails, the setting request is sent again.
[0013] In another possible implementation, the setting result is used to indicate recheck.
[0014] When the storage server has not completed setting the file attributes of multiple files, if the client determines through the setting response that the file attributes of the multiple files have not been set yet, the client waits for the storage server to set the file attributes. This enables the client to release the session channel to handle other tasks and improve resource utilization.
[0015] In another possible implementation, the setting request includes a synchronization identifier; the setting response includes a task identifier and a first error code, where the first error code is used to indicate recheck; after receiving the setting response, the method further includes: sending a setting status query request, where the setting status query request includes the task identifier; receiving a setting status query response, where the setting status query response is used to indicate the setting result of the file attributes of multiple files according to the setting request.
[0016] Thus, when the client is waiting for the storage server to set the file attributes of multiple files, the client sends a setting status query request to the storage server to obtain the progress of the storage server setting the file attributes of multiple files. If the storage server successfully sets the file attributes of multiple files, the setting status query response indicates success. If the storage server fails to set the file attributes of multiple files, the setting status query response indicates failure. The setting status query request contains a task identifier so that the storage server can determine the progress of the file attribute setting task indicated by the task identifier.
[0017] In another possible implementation, the setting result is used to indicate waiting for the setting result of the file attributes of the plurality of files by the storage server.
[0018] In another possible implementation, the setting request includes an asynchronous identifier; the setting response includes a task identifier and a first error code, and the first error code is used to indicate waiting; after receiving the setting response, the method also includes: receiving a callback message, the callback message includes the task identifier and a setting result, and the setting result includes either success or failure; sending a callback response, and the callback response is used to indicate a callback success or a callback failure.
[0019] Therefore, when the client and the storage server communicate asynchronously, the client releases the session channel to handle other tasks, improving resource utilization. The client listens to the task asynchronously, and then the client receives the callback message so that the client can know the setting result. When the setting fails, the setting request is sent again.
[0020] In another possible implementation, the callback message also includes a verification code; sending a callback response includes: when the verification of the task identifier according to the verification code is successful, sending a callback response; after receiving the callback message, the method also includes: when the verification of the task identifier according to the verification code fails, sending a second error code.
[0021] By verifying the task identifier, the accuracy of the callback response is ensured to avoid information errors and task confusion.
[0022] In another possible implementation, the method further includes: sending a setting cancellation request, the setting cancellation request is used to indicate cancellation of the task corresponding to the setting request; and receiving a setting cancellation response, the setting cancellation response is used to indicate cancellation success or cancellation failure.
[0023] If the client waits for a long time for the storage server to reply to the setting result, the client can actively send a setting cancellation request to instruct the storage server to cancel the file attribute settings of multiple files, so as to avoid the client and the storage server occupying the session channel for a long time, resulting in a waste of resources. After canceling the file attribute settings, the client can also re-initiate a file attribute setting request to instruct the storage server to re-execute the file attribute settings.
[0024] In a second aspect, a method for setting file attributes is provided. This method is executed by a storage server, and the method includes: the storage server receives a setting request from a client, sets the file attributes of multiple files according to the setting request; and sends a setting response to the client, where the setting response is used to indicate the setting result of the file attributes of the multiple files based on the setting request.
[0025] Compared with the situation where only the file attributes of one file can be set based on one setting command, when setting the file attributes of multiple files, multiple setting commands need to be received, which results in consuming more network resources and reducing the efficiency of setting file attributes. In the solution provided in this application, the storage server does not need to receive multiple setting commands for file attributes. Based on one setting command, the file attributes of multiple files are set, realizing batch setting of file attributes, reducing the number of setting commands transmitted between the client and the storage server. Thus, the consumed network resources are reduced, and the efficiency of setting file attributes is improved.
[0026] In a possible implementation manner, setting the file attributes of multiple files according to the setting request specifically includes: querying all sub-files under the file; and setting all the queried sub-files according to the file attributes.
[0027] In another possible implementation manner, the setting request includes a recursive setting parameter and the file identifier of the first file among the multiple files. The recursive setting parameter is used to indicate setting the file attributes of the first file and the file attributes of the multi-level sub-files included in the first file.
[0028] In this way, the storage server sets the file attributes of the first file and the file attributes of the multi-level sub-files included in the first file according to the recursive setting parameter added in the setting request. Thus, batch setting of file attributes is realized, reducing the number of setting commands transmitted between the client and the storage server. Thus, the consumed network resources are reduced, and the efficiency of setting file attributes is improved.
[0029] In another possible implementation manner, the setting request includes a synchronization flag; sending the setting response includes: when the timer has not timed out, sending the setting response, where the setting response is used to indicate whether the setting of the file attributes of the multiple files based on the setting request is successful or failed. The synchronization flag is used to indicate that the storage system feeds back the setting response in a synchronous manner.
[0030] In another possible implementation manner, the setting request includes a synchronization flag; sending the setting response includes: when the timer times out, sending the setting response, where the setting response is used to indicate re-checking the setting result of the file attributes of the multiple files based on the setting request.
[0031] Thus, by setting a timer, the storage server can timely feedback a setting response. After the storage server completes setting the file attributes of multiple files, if the timer has not expired, it will timely feedback success or failure; response. If the storage server has not completed setting the file attributes of multiple files and the timer has expired, it will timely feedback setting waiting. This enables the client to timely obtain the status of file attribute setting, avoiding long-term occupation of the session channel between the client and the storage server. It allows the client to release the session channel to process other tasks and improve resource utilization.
[0032] In another possible implementation, the setting response includes a task identifier and a first error code, and the first error code is used to indicate recheck; after sending the setting response, the method further includes: receiving a setting status query request, where the setting status query request includes a task identifier; sending a setting status query response, and the setting status query response is used to indicate the setting result of the file attributes of multiple files according to the setting request.
[0033] Thus, after the client waits for the storage server to set the file attributes of multiple files, it sends a setting status query request to the storage server. The storage server, according to the setting status query request sent by the client, feedbacks the progress of setting the file attributes of multiple files. If the storage server successfully sets the file attributes of multiple files, the setting status query response indicates success. If the storage server fails to set the file attributes of multiple files, the setting status query response indicates failure. The task identifier included in the setting status query request facilitates the storage server to determine the progress of the task indicated by the task identifier.
[0034] In another possible implementation, the setting status query request further includes a check code; sending the setting status query response includes: when the task identifier is successfully verified according to the check code, sending the setting status query response; the method further includes: when the task identifier is verified to fail according to the check code, sending a second error code.
[0035] Through the task identifier, the accuracy of the setting status query response is ensured, avoiding information errors that may lead to task confusion.
[0036] In another possible implementation, the setting request includes an asynchronous identifier; the setting response is used to indicate waiting for the setting result of the file attributes of multiple files according to the setting request; after sending the setting response, the method further includes: sending a callback message, where the callback message includes a task identifier and the setting result of the file attributes of multiple files, and the setting result includes either success or failure; receiving a callback response, and the callback response is used to indicate callback success or callback failure. The asynchronous identifier is used to indicate that the storage system feedbacks the setting response in an asynchronous manner.
[0037] Thus, when the client communicates with the storage server asynchronously, the client releases the session channel to handle other tasks and asynchronously listens for tasks. Furthermore, the storage server sends a callback message so that the client can learn about the setting result. When the setting fails, the setting request is sent again.
[0038] In another possible implementation, the method further includes: receiving a setting cancellation request, where the setting cancellation request is used to indicate canceling the task corresponding to the setting request; canceling the task corresponding to the setting request according to the setting cancellation request; and sending a setting cancellation response, where the setting cancellation response is used to indicate success or failure of the cancellation.
[0039] When the waiting duration for the client to wait for the storage server to reply with the setting result is relatively long, the client can actively send a setting cancellation request, and the storage server cancels the file attribute settings of multiple files, avoiding the waste of resources caused by the client and the storage server occupying the session channel for a long time. After canceling the file attribute settings, the client can also re-initiate a file attribute setting request to instruct the storage server to re-perform the file attribute settings.
[0040] In a third aspect, a client is provided, and the client includes various modules for executing the file attribute setting method in the first aspect or any possible design in the first aspect. For example, a communication module is used to send a setting request to the storage server to instruct the storage server to set the file attributes of multiple files; the communication module is also used to receive a setting response, where the setting response is used to indicate the setting result of the file attributes of multiple files based on the setting request.
[0041] In a possible implementation, the setting request includes a recursive setting parameter and the identifier of the first file among multiple files, and the recursive setting parameter is used to indicate setting the file attributes of the first file and the file attributes of the multi-level sub-files included in the first file.
[0042] In another possible implementation, the setting request further includes either a synchronization identifier or an asynchronous identifier.
[0043] In another possible implementation, the setting result is used to indicate success or failure.
[0044] In another possible implementation, the setting result is used to indicate recheck.
[0045] In another possible implementation, the setting request includes a synchronization identifier; the setting response includes a task identifier and a first error code, where the first error code is used to indicate recheck; the communication module is also used to send a setting status query request, where the setting status query request includes the task identifier; and receive a setting status query response, where the setting status query response is used to indicate the setting result of the file attributes of multiple files based on the setting request.
[0046] In another possible implementation, the setting result is used to indicate the setting result of the waiting storage system.
[0047] In another possible implementation, the setting request includes an asynchronous identifier; the setting response includes a task identifier and a first error code, where the first error code is used to indicate waiting; the communication module is further configured to receive a callback message, the callback message includes a task identifier and a setting result, and the setting result includes either success or failure; and send a callback response, where the callback response is used to indicate callback success or callback failure.
[0048] In another possible implementation, the callback message further includes a verification code; when the communication module sends a callback response, it is specifically configured to: when the verification of the task identifier based on the verification code is successful, send the callback response; the communication module is further configured to send a second error code when the verification of the task identifier based on the verification code fails.
[0049] In another possible implementation, the communication module is further configured to send a setting cancellation request, where the setting cancellation request is used to indicate canceling the task corresponding to the setting request; and receive a setting cancellation response, where the setting cancellation response is used to indicate cancellation success or failure.
[0050] In a fourth aspect, a storage server is provided. The storage server includes various modules for executing the file attribute setting method in the second aspect or any possible design of the second aspect. For example, a communication module for receiving a setting request from a client; a processing module for setting the file attributes of multiple files according to the setting request; and the communication module is further configured to send a setting response to the client, where the setting response is used to indicate the setting result of the file attributes of the multiple files based on the setting request.
[0051] In a possible implementation, when the processing module sets the file attributes of the multiple files according to the setting request, it is specifically configured to query all sub-files under the file; and set all the queried sub-files according to the file attributes.
[0052] In another possible implementation, the setting request includes a recursive setting parameter and an identifier of a first file among the multiple files; when the processing module sets the file attributes of the multiple files, it is specifically configured to: set the file attributes of the first file and the file attributes of the multi-level sub-files included in the first file.
[0053] In another possible implementation, the setting request includes a synchronization identifier; when the communication module sends a setting response, it is specifically configured to: when the timer has not timed out, send the setting response, where the setting response is used to indicate success or failure of setting the file attributes of the multiple files based on the setting request.
[0054] In another possible implementation, the setting request includes a synchronization identifier; when the communication module sends a setting response, it is specifically used to: when the timer times out, send a setting response, and the setting response is used to indicate the result of setting the file attributes of multiple files based on the setting request for rechecking.
[0055] In another possible implementation, the setting response includes a task identifier and a first error code, and the first error code is used to indicate rechecking; the communication module is further configured to receive a setting status query request, where the setting status query request includes a task identifier; and send a setting status query response, and the setting status query response is used to indicate the result of setting the file attributes of multiple files based on the setting request.
[0056] In another possible implementation, the setting status query request further includes a check code; when the communication module sends a setting status query response, it is specifically used to: when the task identifier is successfully verified according to the check code, send a setting status query response; the communication module is further configured to send a second error code when the task identifier fails to be verified according to the check code.
[0057] In another possible implementation, the setting request includes an asynchronous identifier; the setting response is used to indicate waiting for the result of setting the file attributes of multiple files based on the setting request; the communication module is further configured to send a callback message, where the callback message includes a task identifier and the result of setting the file attributes of multiple files, and the setting result includes either success or failure; and receive a callback response, where the callback response is used to indicate callback success or callback failure.
[0058] In another possible implementation, the communication module is further configured to receive a setting cancellation request, where the setting cancellation request is used to indicate canceling the task corresponding to the setting request; the processing module is further configured to cancel the task corresponding to the setting request according to the setting cancellation request; the communication module is further configured to send a setting cancellation response, and the setting cancellation response is used to indicate cancellation success or cancellation failure.
[0059] In a fifth aspect, a computer device is provided, and the computer device includes at least one processor and a memory, where the memory is used to store a set of computer instructions; when the processor executes the set of computer instructions as the client in the first aspect or any possible implementation manner of the first aspect, it executes the operation steps of the file attribute setting method in the first aspect or any possible implementation manner of the first aspect; when the processor executes the set of computer instructions as the storage server in the second aspect or any possible implementation manner of the second aspect, it executes the operation steps of the file attribute setting method in the second aspect or any possible implementation manner of the second aspect.
[0060] In a sixth aspect, a communication system is provided. The communication system includes a client and multiple storage servers, and the client mounts the multiple storage servers. The client is used to execute the operation steps of the file attribute setting method in the first aspect or any possible implementation manner of the first aspect. The storage server is used to execute the operation steps of the file attribute setting method in the second aspect or any possible implementation manner of the second aspect.
[0061] In a seventh aspect, a computer-readable storage medium is provided, including: computer software instructions; when the computer software instructions run on a computer device, the computer device is caused to execute the operation steps of the method described in the first aspect or any possible implementation manner of the first aspect; or, execute the operation steps of the method described in the second aspect or any possible implementation manner of the second aspect.
[0062] In an eighth aspect, a computer program product is provided. When the computer program product runs on a computer, the computer is caused to execute the operation steps of the method described in the first aspect or any possible implementation manner of the first aspect; or, execute the operation steps of the method described in the second aspect or any possible implementation manner of the second aspect.
[0063] For the technical effects brought by any one of the design manners in the third aspect to the eighth aspect, reference can be made to the technical effects brought by the first aspect to the second aspect or different design manners, which will not be elaborated here.
[0064] Based on the implementation manners provided in the above aspects of the present application, further combinations can be made to provide more implementation manners. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] Figure 1 It is a schematic diagram of the process of file attribute setting provided by the present application;
[0066] Figure 2 It is a schematic diagram of the architecture of a communication system provided by the present application;
[0067] Figure 3 It is a schematic flowchart of a file attribute setting method provided by the present application;
[0068] Figure 4 It is a schematic diagram of the operation of a file attribute setting command provided by the present application;
[0069] Figure 5 It is a schematic diagram of feedbacking a setting response in a synchronous manner provided by the present application;
[0070] Figure 6 It is a schematic diagram of feedbacking a setting response in an asynchronous manner provided by the present application;
[0071] Figure 7Schematic diagram of canceling file attribute settings provided by this application;
[0072] Figure 8 Schematic diagram of the structure of a client provided by this application;
[0073] Figure 9 Schematic diagram of the structure of a storage server provided by this application;
[0074] Figure 10 Schematic diagram of the structure of a computer device provided by this application. Detailed implementation manners
[0075] For ease of understanding, the main terms involved in this application are first explained.
[0076] Network Attached Storage (NAS): A technology centered around data that connects storage devices to a network to provide dedicated data and file services. NAS separates the storage server from the application server, allowing clients to access the storage server to store and retrieve data without the intervention of the application server. This releases bandwidth, improves storage performance, reduces the total cost of ownership, and protects the investment. Network Attached Storage can also refer to a dedicated data storage device, also known as a network storage server or a storage server.
[0077] The NAS described in this application can be designed based on the Client-Server (C / S) architecture. The NAS client software is installed on the client, and the NAS server software is installed on the server. The client mounts the file directory in the server, enabling the client to access the file system of the server in different languages, operating systems, and folders. Optionally, the client can be referred to as a local computer or a local device or a local end computer or a local end device. The server can be referred to as a remote computer or a remote device or a storage server or a network storage server. The client can also be referred to as a NAS client. The server can also be referred to as a NAS server.
[0078] Network Attached Storage includes storage devices (such as disk arrays, CD / DVD drives, tape drives, or removable storage media), an operating system, and a file system, etc.
[0079] The client and network-attached storage support multiple protocols (such as Network File System (NFS), Common Internet File System (CIFS), File Transfer Protocol (FTP), Hypertext Transfer Protocol (HTTP), etc.) and various operating systems.
[0080] The client accesses the network-attached storage to perform file operations on files. For example, file operations include creating files, writing files, reading files, repositioning files, deleting files, truncating files, querying file attributes, and setting file attributes, etc.
[0081] File: A collection of information stored on a computer device with the computer device as the carrier. Files can be text documents, pictures, videos, audio, programs, etc. Files usually have file extensions to indicate the file type. For example, pictures are saved in JPEG format, and the file extension of the picture is.jpg.
[0082] File folder: A data structure used to organize and manage disk files.
[0083] A file folder can refer to a directory that classifies and stores electronic files in a computer disk space and establishes an independent path. The file folder provides a path address pointing to the corresponding disk space. It can have an extension, but it does not have the function of a file extension. The file folder facilitates the sharing and protection of files.
[0084] In order to store files in an orderly manner by classification, files are organized in several directories, also known as file folders. File folders generally adopt a multi-level structure (such as a tree structure). In this structure, each disk has a root folder, and the root folder contains several files and folders. File folders can not only contain files but also contain sub-folders. In this way, the multi-level folder structure formed by analogy not only classifies and stores files of different types and functions, but also facilitates file search, and allows files in different folders to have the same file name.
[0085] File Attributes: Information that describes a file. File attributes are not the content of the file. File attributes are used to search for and organize files. File attributes can classify files into different types of files, define the nature of the files, so as to store and transmit files.
[0086] Common file attributes include system attributes, hidden attributes, permission attributes, and archive attributes.
[0087] Exemplarily, file attributes include name, identifier, type, location, size, protection, time, date, and user identification, etc. Name: That is, the file name, which is used to uniquely identify the file. Identifier: It is used to uniquely identify the file. The identifier is usually a number and is a machine-readable file name. Location: The storage location of the file. Size: The file size (in bytes, words, or blocks) and the possible maximum size allowed. Protection: Permission attributes such as read, write, execute the file, access control list (ACL), mode attribute, etc. Time, date, and user identification: Information related to the creation, last modification, and last use of the file.
[0088] Generally, when the client sets file attributes, it traverses the files by obtaining the file list, queries the file attributes of each file, and sends the new file attributes to the storage server to achieve setting the file attributes.
[0089] Exemplarily, Figure 1 This is a schematic diagram of the process for setting file attributes provided by this application. As Figure 1 shown, the client sends a Readdir command word to the storage server to obtain the file list (step 110); the storage server sends the file list to the client (step 120). The client sends an Open command word or a Getattr command word to the storage server to query the file attributes (step 130); the storage server sends the file attributes to the client (step 140). The client sends a Setattr command word to the storage server to set the file attributes (step 150); the storage server sets the file attributes and sends a response to the client (step 160). The client sends a Close command word to the storage server to close the setting of the file attributes (step 170); the storage server closes the setting of the file attributes and sends a response to the client (step 180).
[0090] However, the above process for setting file attributes needs to be executed for each file. After the client obtains the file attributes of each file, it may also need to perform summary calculations to summarize the file attributes of multiple files.
[0091] To solve the problem that when the client sets the file attributes of multiple files, it consumes a large amount of network resources between the client and the storage server to transmit file attribute setting commands, and the file attribute setting efficiency is relatively low. This application provides a file attribute setting method, where the client sends a setting request to the storage server, indicating that the storage server sets the file attributes of multiple files. That is, the storage server can set the file attributes of multiple files according to one file attribute setting command.
[0092] Thus, compared with setting the file attributes of only one file based on one setting command, when setting the file attributes of multiple files, multiple setting commands need to be sent, resulting in the consumption of more network resources and the reduction of the file attribute setting efficiency. In the solution provided by this application, the client does not need to send multiple file attribute setting commands. Based on one setting command, the file attributes of multiple files can be set, realizing the batch setting of file attributes, reducing the number of setting commands transmitted between the client and the storage server. Thus, the consumption of network resources is reduced, and the file attribute setting efficiency is improved. In addition, the client does not need to send the Readdir command word to obtain the file list, does not need to store the file list, and traverses the file list to send setting commands for each file. Thus, the consumption of the client's storage resources and computing resources is reduced.
[0093] In different operating systems, the term "file" has different meanings. In some operating systems, such as In it, a file is data for recording content. Files are, for example, text documents, pictures, videos, audios, programs, and so on. Files usually have file extensions to indicate the file types. For example, a picture saved in the JPEG format has the file extension.jpg. A directory, also known as a folder, is used to describe the index position of a file in the file system.
[0094] However, in some other operating systems, such as In it, a directory is also used to describe the path of a file; but a file can either refer to data for recording content (such as a text document, a picture, a video, an audio, a program, etc.), or refer to a directory. For the convenience of introduction, unless otherwise specified, the files in the embodiments of this application use this meaning.
[0095] For example, taking the path / root / media / spring.jpg as an example, / root, / root / media, and spring.jpg are all called files. In the embodiments of this application, descriptions such as files and sub-files are further used to distinguish the hierarchical relationships between files. Both / root / media and spring.jpg are sub-files of / root, and spring.jpeg is a sub-file of / root / media.
[0096] This application does not limit the type and function of the server described above. For example, the types of servers include blade servers, tower servers, cabinet servers, and rack servers. Another example is that the server includes a storage server with storage functions or a computing server with computing functions, and the computing server also has storage functions.
[0097] The following describes in detail the implementation manner of file attribute setting provided by this application with reference to the accompanying drawings.
[0098] The solution provided by this application can be applied to communication systems such as cluster networks and supernode interconnected networks. For example, high-performance computing (HPC) networks or high-availability (HA) networks, etc.
[0099] Exemplarily, Figure 2 is a schematic diagram of the architecture of a communication system provided by this application. As Figure 2 shown, the communication system 200 includes a client 210 and multiple servers 220.
[0100] The server 220 can be a computing node that provides computing functions. A computing node can also be called a computing server. Multiple servers that provide computing functions can form a computing cluster. For example, the server 220 can include computing units with computing capabilities such as a central processing unit (CPU), a graphics processing unit (GPU), a data processing unit (DPU), a neural processing unit (NPU), and an embedded neural-network processing unit (NPU) to provide high-performance computing.
[0101] The server 220 can also be a storage node that provides storage functions. A storage node can also be called a storage server. Multiple servers that provide storage functions can form a storage cluster. For example, the server 220 can include one or more controllers, network cards, and multiple hard disks. The hard disks are used to store data. The hard disks can be magnetic disks or other types of storage media, such as solid-state drives or shingled magnetic recording hard disks, etc. The network cards are used to communicate with the computing nodes or with the client 210. The controller is used to write data to the hard disks or read data from the hard disks according to the read / write data requests sent by the computing nodes. During the process of reading and writing data, the controller needs to convert the addresses carried in the read / write data requests into addresses that the hard disks can recognize.
[0102] Figure 2This is only a schematic diagram. The embodiments of the present application do not limit the number of devices included in the communication system. For example, the communication system may include multiple clients. One client can be connected to multiple servers and mount the directories of different servers. Different clients establish connections with different servers and mount the directories of different servers. The same server can also be mounted on different clients. Optionally, other devices may also be included in the communication system, such as network devices (e.g., switches, routers). Multiple servers are connected through network devices, and data is transmitted through network devices.
[0103] Client 210 communicates with multiple servers 220 through network 230. Network 230 may refer to an enterprise internal network (e.g., a local area network (LAN)) or the Internet.
[0104] The present application does not limit the protocol for communication between the client and the server. In some embodiments, the client and the server communicate based on the Server Message Block (SMB) protocol. The client can be an SMB client with a Windows operating system, and the server can be an SMB server with a Windows operating system.
[0105] In other embodiments, the client and the server communicate based on the NFS protocol. The client can be an NFS client with a Linux / Unix operating system, and the server can be an NFS server with a Linux / Unix operating system.
[0106] In the present application, client 210 is used to send file attribute setting commands to the server, and the server sets the file attributes of multiple files according to the file attribute setting commands to achieve batch setting of file attributes. Server 220 is used to provide the function and interface for batch setting the file attributes of devices.
[0107] Next, the file attribute setting will be described in detail with reference to the accompanying drawings.
[0108] Figure 3 This is a schematic flow diagram of a file attribute setting method provided by the present application. The client can be the Figure 1 client shown in. The server can be the Figure 1 storage server in the storage cluster described in. As Figure 3 shown, the method includes the following steps.
[0109] Step 310: The client sends a setting request.
[0110] The client responds to the operation of setting file attributes and sends a setting request to the storage server. In some embodiments, the user can operate the interface of the client, and the client responds to the file attribute setting command input by the user. Exemplarily, as Figure 4 shown in (a) of FIG. Figure 4 , the user inputs a file attribute setting command on the interface of the client. As Figure 4 shown in (b) of FIG. Figure 4 , the user selects a file attribute setting command on the interface of the client.
[0111] The client responds to the file attribute setting command input by the user. If it is recognized that the file attributes of multiple files are to be set, the setting request is used to indicate setting the file attributes of multiple files.
[0112] This application does not limit the file types and organizational structures of multiple files. For example, multiple files may include at least one of pictures, videos, audios, word documents, Portable Document Format (PDF), and folders.
[0113] In some embodiments, multiple files include multiple files at the same level, that is, there is no nesting relationship among the multiple files. The setting request is used to indicate setting the file attributes of multiple files at the same level.
[0114] In other embodiments, multiple files include nested multiple files, that is, there is a nesting relationship among the multiple files. The setting request is used to indicate setting the file attributes of multi-level files.
[0115] Multiple files include a parent file and multi-level sub-files. A file may include at least one of a file and a folder. A folder may be a type of file. A folder can not only contain files but also contain the next-level folder. Multiple files can form a multi-level structured file. For example, multiple files include a first file and a first folder. If the first folder can further include a second folder. The first folder and the second folder have a nesting relationship, the first folder is the parent file of the second folder, and the second folder is the sub-file of the first folder. The second folder includes a second file. The second folder and the second file have a nesting relationship, the second folder is the parent file of the second file, and the second file is the sub-file of the second folder.
[0116] Among them, the setting request may include a recursive setting parameter. The recursive setting parameter is used to indicate setting the file attributes of multiple files. Alternatively described, the recursive setting parameter is used to indicate setting the file attributes of a file and its multi-level sub-files. Or, the recursive setting parameter is used to indicate setting the file attributes of a directory and its sub-items.
[0117] In some embodiments, the setting request further includes the file identifiers and file attributes of multiple files, that is, the file identifiers and file attributes of multiple files are listed in the setting request. The file identifier is used to uniquely indicate a file. The file identifier includes but is not limited to: the creation time, modification time, ownership information, and permission information of the file. The file attribute may include the attribute value of the file attribute. So that the storage server can modify the attribute value of the file indicated by the file identifier to the attribute value of the file attribute included in the setting request.
[0118] In other embodiments, the setting request further includes the file identifier and file attributes of the first file among multiple files. The client sends the file identifier and file attributes of the first file among multiple files to the storage server. The storage server sets the file attributes of the first file and the multi-level sub-files included in the first file according to the recursive setting parameter and the file attributes of the first file. That is, after the file attributes of the first file and the multi-level sub-files of the first file are set, the file attributes of the first file and the multi-level sub-files of the first file are the same, and the file attributes of the first file and the multi-level sub-files of the first file are both the attribute values of the file attributes of the first file included in the setting request.
[0119] Step 320: The storage server receives the setting request sent by the client.
[0120] The client can directly access the storage server through the network based on protocols such as NFS, CIFS, FTP, HTTP, etc., that is, the client can send a setting request to the storage server through the network. The storage server receives the setting request sent by the client through the network.
[0121] Step 330: The storage server sets the file attributes of multiple files.
[0122] The setting request includes a recursive setting parameter, and the storage server determines to set the file attributes of multiple files.
[0123] In some embodiments, the setting request includes the file identifiers and file attributes of multiple files and a recursive setting parameter. The storage server sets the file attributes of multiple files stored in the storage server one by one, that is, sets the file attributes of the files stored in the storage server to the file attributes indicated by the setting request. For example, the setting request includes the first attribute value of the file attribute, the storage server obtains the file attribute of the file indicated by the file identifier stored in the storage server, the second attribute value of the file attribute, and modifies the second attribute value of the file attribute to the first attribute value.
[0124] In some other embodiments, the setting request includes the file identifier and file attributes of the first file among multiple files, as well as the recursive setting parameters. The storage server sets the file attributes of the first file stored in the storage server one by one, as well as the file attributes of the multi-level sub-files in the first file. The file attributes of the first file and the file attributes of the multi-level sub-files in the first file are set to the file attributes of the first file indicated by the setting request. The file attributes of the first file and the file attributes of the multi-level sub-files in the first file are the same.
[0125] For example, the setting request includes the first attribute value of the file attributes of the first file. The storage server sets both the file attributes of the first file and the file attributes of the multi-level sub-files in the first file to the first attribute value.
[0126] Step 340: The storage server sends a setting response.
[0127] When the client and the storage server establish a connection without creating a back channel, the storage server can send the setting response to the client in a synchronous manner. If the storage server uses an asynchronous method to feedback the setting response, the storage server sends an error code to the client. For example, the error code can be NFS4ERR_CB_PATH_DOWN.
[0128] When the client and the storage server establish a connection and create a back channel, the storage server can send the setting response to the client in a synchronous or asynchronous manner.
[0129] Optionally, the setting request includes either a synchronous identifier or an asynchronous identifier. The storage server determines the method of feedbacking the setting response according to the synchronous identifier or the asynchronous identifier.
[0130] When the setting request includes a synchronous identifier, the storage server determines to send the setting response to the client in a synchronous manner according to the synchronous identifier. The setting response is used to indicate the setting result of the file attributes of multiple files based on the setting request. The setting result is used to indicate success, failure, or recheck. For example, the setting response includes a success parameter, a failure parameter, or a recheck parameter.
[0131] When the setting request includes an asynchronous identifier, the storage server determines to send the setting response to the client in a synchronous or asynchronous manner according to the asynchronous identifier. The setting result is used to indicate success, failure, or waiting. For example, the setting response includes a success parameter, a failure parameter, or a waiting parameter.
[0132] If the storage server successfully sets the file attributes of multiple files according to the setting request, the storage server can send a success parameter to the client.
[0133] During the process of the storage server performing file attribute settings, when the number of files is large, the storage server can send recheck parameters to the client to inform the client of the setting status of the file attribute settings. So that the client can send a setting status query request to the storage server to obtain the setting result of the file attribute settings.
[0134] During the process of the storage server performing file attribute settings, when the number of files is large, the storage server can send waiting parameters to the client to inform the client to wait for the storage server to feedback the setting result of the file attribute settings. So that the client can asynchronously listen to obtain the setting result of the file attribute settings.
[0135] Thus, it reduces the channels occupied by the client and the storage server in the session and improves the utilization rate of network resources.
[0136] In some embodiments, during the process of the storage server setting the file attributes of multiple files, an error may occur, resulting in the failure of the file attribute settings. Then the storage server can feedback failure parameters to the client.
[0137] For example, during the process of the storage server setting the file attributes of multiple files, a file error may occur. The storage server can feedback an error code to the client. The error code can be the error code of the command word setattr defined in NFSv4.2, indicating that an error occurred during the recursive setting of attributes. File errors include that the storage server does not have permission to set the file attributes of multiple files and the storage server does not store multiple files, etc.
[0138] Another example is that during the process of the storage server setting the file attributes of multiple files, a system failure may occur. The storage server can feedback an error code to the client. For example, the error code can be NFS4ERR_BAD_STATEID. System failures include storage server failures, software failures, and errors in the command words included in the setting requests, etc.
[0139] The solution for the storage server to send setting responses to the client in a sampling synchronous or asynchronous manner is described in the following embodiments.
[0140] Step 350: The client receives the setting response sent by the storage server.
[0141] After receiving the setting response, the client determines the setting result according to the setting response. If the storage server successfully sets the file attributes of multiple files, the setting result is used to indicate success, and the client determines that the file attribute settings of multiple files are successful. If the storage server fails to set the file attributes of multiple files, the setting result is used to indicate failure, and the client determines that the file attribute settings of multiple files are failed.
[0142] Therefore, the present application defines a standard protocol command word, that is, a standard batch file attribute setting command word. The client does not need to send a large number of command words such as Readdir, file attribute query command words, and file attribute setting command words. Based on one setting command, the file attributes of multiple files are set, realizing batch file attribute setting, reducing the number of setting commands transmitted between the client and the storage server. Therefore, the consumption of network resources is reduced, and the file attribute setting efficiency is improved. In addition, the client does not need to send the Readdir command word to obtain the file list, does not need to store the file list, and traverses the file list to send setting commands for each file. Therefore, the consumption of the client's storage resources and computing resources is reduced.
[0143] The following elaborates in detail on the storage server's feedback of setting responses in synchronous and asynchronous manners respectively.
[0144] The storage server's sending of setting responses in synchronous manner can include the following two ways.
[0145] In the first possible implementation, the storage server feedbacks the setting response according to the setting result of file attribute setting.
[0146] The storage server needs to wait for the setting results of the file attributes of multiple files. Before the storage server obtains the setting results, it does not send the setting response to the client. Until the storage server completes the setting of the file attributes of multiple files and obtains the setting results, the storage server sends the setting response to the client. The setting response is used to indicate the setting results of the file attributes of the multiple files according to the setting request. The setting results can indicate success or failure. For example, after the client executes step 310, that is, after the client sends a setting request to the storage server, the storage server sets the file attributes of multiple files according to the setting request. Until the storage server obtains the setting results, the storage server sends the setting response to the client, and then the client executes step 350, that is, the client receives the setting response sent by the storage server.
[0147] However, a channel in a session between the storage server and the client needs to be occupied all the time, resulting in a reduction in the number of available channels. If there are multiple file attribute setting tasks maintained between the client and the storage server, multiple channels will be occupied, and in severe cases, the client will have no available channels.
[0148] In the second possible implementation, the storage server can feedback the setting response according to a timer. The duration of the timer can be set according to requirements, which is not limited in the present application. The shorter the duration of the timer, the more timely the storage server feedbacks the setting response; on the contrary, the longer the duration of the timer, the slower the storage server feedbacks the setting response.
[0149] Figure 5A schematic diagram of providing a setting response in a synchronous manner for this application. Different from the file attribute setting shown above Figure 3 is that the storage server does not need to wait for the setting results of the file attributes of multiple files, and feeds back the setting response according to the duration of the timer. The setting response is used to indicate any one of success, failure, or recheck.
[0150] In some embodiments, when the timer does not time out, after the storage server completes the setting of the file attributes of multiple files and obtains the setting results, the storage server sends a setting response to the client, and the setting results can indicate success or failure.
[0151] Exemplarily, as shown in (a) of Figure 5 , based on the method flow shown above Figure 3 , it further includes step 360. For example, after receiving the setting request, the storage server starts the timer, that is, executes step 360. Furthermore, the storage server sets the file attributes of multiple files. When the timer does not time out and the storage server obtains the setting results, the storage server sends a setting response to the client. The storage server sending a setting response to the client includes that when the timer does not time out, the storage server sends a setting response to the client.
[0152] In some other embodiments, when the timer times out and the storage server has not completed setting the file attributes of multiple files, that is, the storage server has not obtained the setting results. Then the storage server sends a setting response to the client, and the setting results can indicate recheck.
[0153] Exemplarily, as shown in (b) of Figure 5 , based on the method flow shown above Figure 3 , it further includes step 360, step 370 to step 3120.
[0154] For example, after receiving the setting request, the storage server starts the timer, that is, executes step 360. Furthermore, the storage server executes steps 330 to 350, that is, the storage server sets the file attributes of multiple files. When the timer times out and the storage server has not obtained the setting results, the storage server sends a setting response to the client, and the setting results can indicate recheck.
[0155] When the storage server sends a setting response to the client, including when the timer times out, the storage server sends a setting response to the client. The setting response includes a task identifier and an error code. The task identifier is used to indicate the file attribute setting task that the storage server executes according to the setting request. Optionally, the setting response may further include a verification code, which may be determined according to the reception time of the setting request. For example, the task identifier may be rsr_callback_id, the error code may be NFS4_PENDING, and the verification code may be rsr_recursiveverf. When rsr_callback_id = 0, rsr_recursiveverf = 0, and the error code is NFS4_OK, it indicates that the storage server has successfully set the file attributes of multiple files; when rsr_callback_id = 0, rsr_recursiveverf = 0, and the error code is the error code of setattr or NFS4ERR_BAD_STATEID, it indicates that the storage server has failed to set the file attributes of multiple files; when rsr_callback_id = 1, rsr_recursiveverf = 1, and the error code is NFS4_OK or PENDING, it indicates that the storage server instructs the client to re-check the setting result of the file attribute setting of multiple files.
[0156] For the explanations of steps 310 to 350, refer to the above description.
[0157] After the client receives the setting response and determines according to the re-check indicated by the setting response that the storage server has not completed setting the file attributes of multiple files, the client waits for the storage server to set the file attributes of multiple files and re-checks the setting status of the file attribute setting. That is, the client waits to execute step 370.
[0158] Step 370: The client sends a setting status query request.
[0159] The setting status query request includes a task identifier. The value of the task identifier included in the setting status query request may be the same as the value of the task identifier included in the setting response.
[0160] Optionally, after the client receives the setting response, it may also start a timer. When the client's timer times out, the client sends a setting status query request. The duration of the client's timer can be set according to requirements and is not limited in this application.
[0161] Step 380: The storage server receives the setting status query request sent by the client.
[0162] The storage server determines whether the task identifier included in the setting status query request is the same as the task identifier stored by the storage server. If the task identifier included in the setting status query request is the same as the task identifier stored by the storage server, the storage server queries the file attribute setting task indicated by the task identifier, sends a setting status query response, that is, executes step 390.
[0163] If the task identifier included in the setting status query request is different from the task identifier stored by the storage server, the storage server side feedbacks an error code NFS4ERR_BAD_STATEID or a setattr error code defined in NFSv4.2 to the client.
[0164] Optionally, the setting status query request also includes a check code.
[0165] The storage server can also verify the task identifier according to the check code. When the verification of the task identifier according to the check code is successful, a setting status query response is sent, that is, step 390 is executed.
[0166] When the verification of the task identifier according to the check code fails, it indicates that an error may occur during the process of the storage server setting the file attributes of multiple files. Step 3110 is executed to send an error code.
[0167] For example, the check code is the reception time when the storage server receives the setting request. The setting status query request includes a task identifier and a check code. The storage server determines that the task identifier included in the setting status query request is the same as the task identifier stored by the storage server, and the check code included in the setting status query request is the same as the reception time of the setting request stored by the storage server, and determines that the verification is successful.
[0168] Another example, the storage server determines that the task identifier included in the setting status query request is the same as the task identifier stored by the storage server, and the check code included in the setting status query request is different from the reception time of the setting request stored by the storage server, and determines that the verification fails. The storage server sends an error code, that is, step 3110 is executed. The error code is NFS4ERR_BAD_STATEID or a setattr error code defined in NFSv4.2.
[0169] Another example, the storage server determines that the task identifier included in the setting status query request is different from the task identifier stored by the storage server, and the check code included in the setting status query request is different from the reception time of the setting request stored by the storage server, and determines that the verification fails. The storage server discards the setting status query request.
[0170] Step 390: The storage server sends a setting status query response.
[0171] The setting status query response is used to indicate the setting result of setting the file attributes of multiple files according to the setting request. The setting status query response is used to indicate any one of success, failure, or recheck.
[0172] If the storage server has completed setting the file attributes of multiple files, the setting result is used to indicate success or failure. If the storage server has not completed setting the file attributes of multiple files, the setting result is used to indicate recheck. Thus, the client can release the channel for the file attribute setting task between the client and the storage server, so that the client can use the released channel to establish a connection for other tasks with the storage server, improving the utilization rate of network resources.
[0173] Step 3100: The client receives the setting status query response sent by the storage server.
[0174] If the setting result is used to indicate success, the client determines that the setting of the file attributes of multiple files is completed.
[0175] If the setting result is used to indicate failure, the client can resend the setting request to request the storage server to set the file attributes of multiple files.
[0176] If the setting result is used to indicate recheck, the client determines that the storage server has not completed setting the file attributes of multiple files. Then the client can wait for the storage server to set the file attributes of multiple files and resend the setting status query request to query the setting status of the file attributes of multiple files. That is, the client and the storage server execute steps 370 to 3120 again.
[0177] Step 3110: The storage server sends an error code.
[0178] When the verification of the task identifier according to the check code fails, it indicates that an error may occur during the process of the storage server setting the file attributes of multiple files. The error code can be NFS4ERR_BAD_STATEID.
[0179] Step 3120: The client receives the error code sent by the storage server.
[0180] When the client receives the error code or the failure indicated by the setting result, it determines that the setting of the file attributes of multiple files is incorrect. Then the client can resend the setting request to request the storage server to set the file attributes of multiple files.
[0181] Thus, by querying the setting status of the file attributes of multiple files again, the client obtains the setting result, avoiding the continuous occupation of the channel (slot) on the session between the storage server and the client, and improving the utilization rate of the channel.
[0182] Next, an asynchronous way for the storage server to send the setting response will be described.
[0183] Figure 6 A schematic diagram for providing an asynchronous feedback setting response for this application. Different from the file attribute setting shown above Figure 3 is that the storage server directly feeds back the setting response without waiting for the setting results of the file attributes of multiple files, and the setting result is used to indicate waiting for the storage server to feed back the setting results of the file attributes of multiple files. The client starts asynchronous listening to listen for the storage server to feed back the setting result. Among them, the setting response may include a task identifier and an error code. The task identifier is used to indicate the file attribute setting task executed by the storage server according to the setting request. Optionally, the setting response may further include a verification code, and the verification code may be determined according to the sending time of the setting request. For example, the task identifier may be rsr_callback_id, the error code may be NFS4_PENDING, and the verification code may be rsr_recursiveverf. When rsr_callback_id = 1, rsr_recursiveverf = 1, and the error code is NFS4_OK or PENDING, it means that the storage server instructs the client to wait for the storage server to feed back the setting results of the file attributes of multiple files.
[0184] Different from the file attribute setting shown above Figure 5 in (b) is that the client does not need to send a setting status query request, that is, it does not need to execute steps 370 to step 3120. The client asynchronously listens for the setting result fed back by the storage server. As Figure 6 shown, the above method flow further includes the following steps 3130 to step 3180.
[0185] Step 3130: The storage server sends a callback message.
[0186] After the storage server finishes setting the file attributes of multiple files, the storage server sends a callback message. The callback message includes a task identifier and a setting result. The task identifier is used to indicate the file attribute setting task executed by the storage server according to the setting request. The setting result includes any one of success or failure.
[0187] If the storage server is successful in setting the file attributes of multiple files, the setting result is used to indicate success. If the storage server fails to set the file attributes of multiple files, the setting result is used to indicate failure.
[0188] Step 3140: The client receives the callback message sent by the storage server.
[0189] The client determines whether the task identifier included in the callback message is the same as the task identifier stored by the client. If the task identifier included in the callback message is the same as the task identifier stored by the client, the client determines success or failure according to the setting result and sends a callback response, that is, step 3150 is executed.
[0190] When the client receives a callback message and the setting result indicates failure, it determines that the file attribute settings of multiple files are incorrect. Then the client can resend a setting request to request the storage server to set the file attributes of multiple files.
[0191] Optionally, the callback message can also include a check code.
[0192] The client can also verify the task identifier according to the check code. When the verification of the task identifier according to the check code is successful, a callback response is sent, that is, step 3150 is executed.
[0193] When the verification of the task identifier according to the check code fails, step 3170 is executed and an error code is sent.
[0194] For example, the check code is the sending time when the client sends a setting request. The callback message contains the task identifier and the check code. The client determines that the task identifier included in the callback message is the same as the task identifier stored by the client, and the check code included in the callback message is the same as the sending time of the setting request stored by the client, and determines that the verification is successful, that is, step 3150 is executed.
[0195] Another example is that the client determines that the task identifier included in the callback message is the same as the task identifier stored by the client, but the check code included in the callback message is different from the receiving time of the setting request stored by the client, and determines that the verification fails. The client sends an error code and terminates the file attribute setting task indicated by the task identifier, that is, step 3170 is executed.
[0196] Another example is that the client determines that the task identifier included in the callback message is different from the task identifier stored by the client, and the check code included in the callback message is different from the receiving time of the setting request stored by the client, and determines that the verification fails. The client discards the callback message.
[0197] Step 3150: The client sends a callback response.
[0198] Step 3160: The storage server receives the callback response sent by the client.
[0199] The callback response is used to indicate callback success or callback failure.
[0200] Step 3170: The client sends an error code.
[0201] When the verification of the task identifier according to the check code fails, the error code sent by the client can be NFS4ERR_BAD_STATEID.
[0202] Step 3180, the storage server receives the error code sent by the client.
[0203] Optionally, the storage server may cancel the task of file attribute setting and discard the setting result of the file attribute setting.
[0204] Thus, the client asynchronously listens for the setting result and obtains the setting result, avoiding continuously occupying the slot on the session between the storage server and the client, and improving the utilization rate of the slot.
[0205] The synchronous mode and the asynchronous mode will be described below with reference to Table 1.
[0206] Table 1
[0207]
[0208]
[0209] As can be seen from Table 1, when the storage server feeds back the setting response in the synchronous mode, the timer has not timed out, and the setting response sent by the storage server to the client indicates success or failure; when the timer times out, the setting response sent by the storage server to the client indicates waiting; furthermore, the storage server receives the setting status query request sent by the client and sends a setting status query response, indicating success, failure or waiting. When the storage server feeds back the setting response in the asynchronous mode, the setting response sent by the storage server to the client indicates waiting; furthermore, the storage server sends a callback message to the client, indicating success or failure, and receives a callback response.
[0210] In another possible implementation, if the client waits for a long time for the storage server to feed back the setting response, it can actively cancel the file attribute setting task, and the started setting task will be forcibly terminated as the session is destroyed.
[0211] Figure 7 This is a schematic diagram of canceling file attribute setting provided by the present application. As Figure 7 shown, the above method flow further includes the following steps 710 to 750.
[0212] Step 710, the client sends a setting cancellation request.
[0213] In some embodiments, when the storage server feeds back the setting response in the first possible implementation mode of the synchronous mode, since there may be a large number of files, the time for the storage server to perform file attribute setting is long, and the storage server cannot feed back the setting response in time. Then the client can send a setting cancellation request to the storage server.
[0214] In some other embodiments, if the client receives a callback message and fails to verify the task identifier as described in step 3140, the client may send a setting cancellation request to the storage server.
[0215] The setting cancellation request is used to indicate canceling the task corresponding to the setting request. The setting cancellation request may include the task identifier.
[0216] Step 720: The storage server receives the setting cancellation request sent by the client.
[0217] Step 730: The storage server cancels the task corresponding to the setting request according to the setting cancellation request.
[0218] The storage server terminates the file attribute setting task indicated by the task identifier included in the setting cancellation request. The storage server terminates setting the file attributes of multiple files.
[0219] In some embodiments, the storage server may have already set the file attributes of some of the multiple files. According to the setting cancellation request, it cancels the task corresponding to the setting request. Canceling the task corresponding to the setting request may mean stopping the continued execution of the file attribute setting task for multiple files and not continuing to set the attributes for the files whose attributes have not been set yet.
[0220] Step 740: The storage server sends a setting cancellation response.
[0221] Step 750: The client receives the setting cancellation response sent by the storage server.
[0222] The setting cancellation response is used to indicate cancellation success or failure. If the storage server has completed setting the file attributes of multiple files, it returns the error code NFS4_OK.
[0223] In this way, when the waiting duration for the client to wait for the storage server to reply with the setting result is relatively long, the client can actively send a setting cancellation request, and the storage server cancels the file attribute setting of multiple files, avoiding occupying the session channel between the client and the storage server for a long time and causing resource waste. After canceling the file attribute setting, the client can also re-initiate a file attribute setting request to instruct the storage server to re-execute the file attribute setting.
[0224] Next, the relevant command words (or operation words) for file attribute setting provided in this application are illustrated by examples.
[0225] 1. Operation word 1: RECURSIVE_SET – Recursively set the attributes of a directory and its sub-items
[0226] Parameter definition:
[0227] Struct RECURSIVE_SET4args{
[0228] bool rsa_sync; / * Synchronization flag * /
[0229] };
[0230] Result definition:
[0231]
[0232]
[0233] Among them, the RECURSIVE_SET operation word is used by the client to instruct the storage server to set the file attributes of a file and its multi-level sub-files. RECURSIVE_SET can be set in, after, or before the setattr operation word.
[0234] When the storage server receives the setattr operation word, if the setattr operation word does not contain the RECURSIVE_SET operation word, it performs file attribute setting according to the setattr operation word.
[0235] If the setattr operation word contains the RECURSIVE_SET operation word, the storage server determines to perform recursive setting of the file attributes of the file and its multi-level sub-files.
[0236] If the storage server completes the file attribute setting and the file attributes are successful, the value of rsr_callback_id can be 0, and the value of rsr_recursiversr_recursiveverf can be 0.
[0237] The client recognizes that the values of rsr_callback_id and rsr_recursiversr_recursiveverf are both 0, and determines that the storage server has completed the file attribute setting. If the storage server successfully sets the file attributes of multiple files, the setting result includes the success parameter NFS4_OK, and the client determines that the file attributes are successful based on the success parameter. If the storage server fails to set the file attributes of multiple files, the setting result includes the failure parameter, and the client determines that the file attributes are failed based on the success parameter.
[0238] If the storage server has not completed the file attribute setting, the value of rsr_callback_id can be a non-zero value, and the value of rsr_recursiversr_recursiveverf can be a non-zero value. For example, the values of rsr_callback_id and rsr_recursiversr_recursiveverf are both 1.
[0239] When the values of rsr_callback_id and rsr_recursiversr_recursiveverf recognized by the client are both 1, it is determined that the file attribute setting by the storage server has not been completed. According to NFS4_OK, it is determined that the file attribute setting is correct.
[0240] The above meanings of the values of rsr_callback_id and rsr_recursiversr_recursiveverf are only for illustrative purposes, and this application does not limit them. In actual applications, the values of rsr_callback_id and rsr_recursiversr_recursiveverf can also be other values.
[0241] In addition, when the value of rsa_sync is true, it means that the storage server sends a setting response in a synchronous manner.
[0242] 1) The client waits for the storage server to feedback the setting response. Until the file attribute settings of multiple files by the storage server are completed, the storage server obtains the setting result, and the client receives the setting response sent by the storage server.
[0243] 2) The storage server can feedback the setting response according to the timer. When the timer has not timed out, the storage server obtains the setting result, and the storage server sends a setting response to the client. The values of rsr_callback_id and rsr_recursiversr_recursiveverf are both 0. The client determines that the file attribute is successful according to the success parameter, or the client determines that the file attribute is failed according to the success parameter.
[0244] When the timer times out, the file attributes of multiple files by the storage server have not been set completed, and the storage server sends a setting response to the client. The setting response includes the error code NFS4ERR_PENDING, and the values of rsr_callback_id and rsr_recursiversr_recursiveverf are both 1. The client determines to recheck or wait according to rsr_callback_id, rsr_recursiversr_recursiveverf and the error code NFS4ERR_PENDING.
[0245] The client delays for a period of time and executes operation word 2 to query the execution progress of the file attribute setting. If the client receives the error code NFS4ERR_PENDING again, it executes operation word 2 to query the execution progress of the file attribute setting.
[0246] 2. Operation Word 2: RECURSIVE_SET_STATUS – Query the setting result of the attributes of the recursive setting directory and its sub-items
[0247] Parameter Definition
[0248] struct RECURSIVE_SET_STATUS4args { / * Setting status query request * /
[0249] stateid4 rssa_stateid; / * Task identifier * /
[0250] };
[0251] Result Definition
[0252]
[0253] Among them, the RECURSIVE_SET_STATUS operation word is used by the client to query the status of a recursive setting (the attributes of the directory and its sub-items) task.
[0254] If the storage server has completed the attribute setting for the directory and its sub-items, it returns NFS4_OK. For example, the value of rssr_status is NFS4_OK.
[0255] If any error occurs during the attribute setting process of the storage server for the directory and its sub-items, it returns an error code. This application does not expand or modify the error code, and the error code is consistent with the possible error codes of the setattr operation word.
[0256] If the storage server has not completed the attribute setting for the directory and its sub-items, it returns NFS4_PENDING. For example, the value of rssr_status is NFS4_PENDING.
[0257] 3. Operation Word 3: RECURSIVE_SET_CANCEL – The client cancels the task of setting file attributes
[0258] Parameter Definition:
[0259] struct RECURSIVE_SET_CANCEL4args { / * Setting cancellation request * /
[0260] stateid4 rsca_stateid; / * Task identifier * /
[0261] };
[0262] Result Definition:
[0263] struct RECURSIVE_SET_CANCEL4res{
[0264] nfsstat4 rscr_status; / * Set cancellation response * /
[0265] };
[0266] Among them, when the client needs to cancel the task of setting file attributes, it can send the RECURSIVE_SET_CANCEL operation word. The value of rsca_stateid can be the task identifier of the task to be cancelled.
[0267] The value of rsc_stateid comes from the response message of RECURSIVE_SET. For example, the task identifier included in the set status query response.
[0268] If the storage server fails to cancel the task, it returns NFS4ERR_DELAY, and the value of rscr_status is NFS4ERR_DELAY. After the client cancels the failure response, it delays and resends the set request.
[0269] If the storage server completes the attribute setting of the directory and its sub-items, it returns NFS4_OK. The value of rscr_status is NFS4_OK.
[0270] 4. Operation word 4: CB_RECURSIVE_SET_NOTIFY – Callback for the result of the task of recursively setting the attributes of a directory and its sub-items (used asynchronously, server to client)
[0271] Parameter definition:
[0272]
[0273] Result definition:
[0274] struct CB_RECURSIVE_SET_NOTIFY4res{
[0275] nfsstat4 crsnr_status; / * Callback response * /
[0276] };
[0277] Among them, the CB_RECURSIVE_SET_NOTIFY operation word is used for the storage server to call back the client, that is, the storage server notifies the client of the setting result of recursively setting the attributes of the directory and its sub-items.
[0278] If the storage server has completed setting the attributes of a directory and its sub-items, it returns NFS4_OK. The value of crsnr_status is NFS4_OK.
[0279] If any error occurs during the process of the storage server setting the attributes of a directory and its sub-items, it returns an error code. This application does not extend or modify the error code, and the error code is consistent with the possible error codes of the setattr operation word.
[0280] It can be understood that, to implement the functions in the above embodiments, the client and the server (such as: the storage server) include the corresponding hardware structures and / or software modules for executing each function. Those skilled in the art should easily realize that, combining the units and method steps of each example described in the embodiments disclosed in this application, this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving the hardware depends on the specific application scenarios and design constraint conditions of the technical solution.
[0281] As described above in conjunction with Figures 1 to 7 , the locking method and the lock recovery method provided according to this application are described in detail. Next, in conjunction with Figures 8 to 9 , the devices provided according to this application will be described. These devices can be used to implement the functions of the client or the storage server in the above method embodiments, and thus can also achieve the beneficial effects possessed by the above method embodiments. In this embodiment, the device can be a device such as Figure 3 , Figure 5 , Figure 6 or Figure 7 shown, and can also be a module (such as a chip) applied to the server or a module (such as a chip) applied to the client.
[0282] Such as Figure 8 shown, the client 800 includes a communication module 810, a processing module 820, and a storage module 830. The client 800 is used to implement the functions of the client in the above Figure 3 , Figure 5 , Figure 6 or Figure 7 method embodiments.
[0283] The communication module 810 is used to send a setting request, and the setting request is used to indicate setting the file attributes of multiple files. For example, the communication module 810 is used to execute Figure 3 step 310.
[0284] The communication module 810 is also used to receive a setting response, and the setting response is used to indicate the setting result of the file attributes of multiple files according to the setting request. For example, the communication module 810 is used to execute Figure 3 step 350.
[0285] Optionally, the communication module 810 is further configured to send a setting status query request, and the setting status query request includes a task identifier. For example, the communication module 810 is configured to execute Figure 5 step 370 in
[0286] Optionally, the communication module 810 is further configured to receive a setting status query response, and the setting status query response is used to indicate the setting result of setting the file attributes of multiple files according to the setting request. For example, the communication module 810 is configured to execute Figure 5 step 3100 in
[0287] Optionally, the communication module 810 is further configured to receive a callback message, and the callback message includes a task identifier and a setting result, and the setting result includes any one of success or failure. For example, the communication module 810 is configured to execute Figure 6 step 3140 in
[0288] Optionally, the communication module 810 is further configured to send a callback response, and the callback response is used to indicate callback success or callback failure. For example, the communication module 810 is configured to execute Figure 6 step 3150 in
[0289] Optionally, the processing module 820 is configured to verify the task identifier.
[0290] Optionally, the communication module 810 is further configured to send a setting cancellation request, and the setting cancellation request is used to indicate canceling the task corresponding to the setting request. For example, the communication module 810 is configured to execute Figure 7 step 710 in
[0291] Optionally, the communication module 810 is further configured to receive a setting cancellation response, and the setting cancellation response is used to indicate cancellation success or cancellation failure. For example, the communication module 810 is configured to execute Figure 7 step 750 in
[0292] The storage module 830 is configured to store the setting result and the file identifier, so as to facilitate the client to query the progress of the file attribute setting when waiting for the server to execute the file attribute setting.
[0293] As Figure 9 shown, the storage server 900 includes a communication module 910, a processing module 920, and a storage module 930. The storage server 900 is used to implement the functions of the storage server in the method embodiments shown in the above Figure 3 , Figure 5 , Figure 6 or Figure 7 above.
[0294] A communication module 910, configured to receive a setting request, where the setting request is used to indicate setting file attributes of multiple files. For example, the communication module 910 is configured to execute Figure 3 step 320 in
[0295] The communication module 910 is further configured to send a setting response, where the setting response is used to indicate a setting result of the file attributes of multiple files according to the setting request. For example, the communication module 910 is configured to execute Figure 3 step 340 in
[0296] A processing module 920, configured to set file attributes of multiple files according to the setting request. For example, the processing module 920 is configured to execute Figure 3 step 330 in
[0297] Optionally, the communication module 910 is further configured to receive a setting status query request, where the setting status query request includes a task identifier. For example, the communication module 910 is configured to execute Figure 5 step 390 in
[0298] Optionally, the communication module 910 is further configured to send a setting status query response, where the setting status query response is used to indicate a setting result of the file attributes of multiple files set according to the setting request. For example, the communication module 910 is configured to execute Figure 5 step 390 in
[0299] Optionally, the communication module 910 is further configured to send a callback message, where the callback message includes a task identifier and a setting result, and the setting result includes either success or failure. For example, the communication module 910 is configured to execute Figure 6 step 3130 in
[0300] Optionally, the communication module 910 is further configured to receive a callback response, where the callback response is used to indicate callback success or callback failure. For example, the communication module 910 is configured to execute Figure 6 step 3160 in
[0301] Optionally, the processing module 920 is configured to verify the task identifier.
[0302] Optionally, the communication module 910 is further configured to receive a setting cancellation request, where the setting cancellation request is used to indicate canceling the task corresponding to the setting request. For example, the communication module 910 is configured to execute Figure 7 step 720 in
[0303] Optionally, the communication module 910 is further configured to send a setting cancellation response, where the setting cancellation response is used to indicate cancellation success or cancellation failure. For example, the communication module 910 is configured to execute Figure 7 step 740 in
[0304] A processing module 920 is configured to cancel a task corresponding to a setting request according to a setting cancellation request. For example, the processing module 920 is configured to execute Figure 7 step 730 in
[0305] A storage module 930 is configured to store files, file attributes, and setting results, so as to facilitate the server to feedback the setting results to the client.
[0306] It should be understood that the client 800 and the storage server 900 in the embodiments of the present application may be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The above PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It may also be implemented by software Figure 3 、 Figure 5 、 Figure 6 or Figure 7 When implementing the method shown, and each module thereof may also be a software module. The client 800 and the storage server 900 and each module thereof may also be software modules.
[0307] According to the embodiments of the present application, the client 800 and the storage server 900 may correspondingly execute the methods described in the embodiments of the present application, and the above and other operations and / or functions of each unit in the client 800 and the storage server 900 are respectively for implementing Figure 3 、 Figure 5 、 Figure 6 or Figure 7 The corresponding processes of each method in, for the sake of brevity, are not described herein again.
[0308] Figure 10 FIG. is a schematic structural diagram of a computer device 1000 provided by the present application. As Figure 10 shown, the computer device 1000 includes a processor 1010, a bus 1020, a memory 1030, a communication interface 1040, and a memory 1050 (which may also be referred to as a main memory unit). The processor 1010, the memory 1030, the memory 1050, and the communication interface 1040 are connected through the bus 1020.
[0309] It should be understood that in this embodiment, the processor 1010 may be a CPU, and the processor 1010 may also be other general-purpose processors, digital signal processors (DSPs), ASICs, FPGAs or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0310] The processor may also be a graphics processing unit (GPU), a neural network processing unit (NPU), a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the program of the solution of the present application.
[0311] The communication interface 1040 is used to implement the communication between the computer device 1000 and external devices or components. In the present application, when the computer device 1000 is used to implement Figure 3 , Figure 5 , Figure 6 or Figure 7 the functions of the client shown, the communication interface 1040 is used to send a setting request. When the computer device 1000 is used to implement Figure 3 , Figure 5 , Figure 6 or Figure 7 the functions of the storage server shown, the communication interface 1040 is used to receive a setting request, so that the processor 1010 can set the file attributes of multiple files based on the setting request.
[0312] The bus 1020 may include a path for transmitting information among the above components (such as the processor 1010, the memory 1050, and the storage 1030). In addition to the data bus, the bus 1020 may also include a power bus, a control bus, a status signal bus, etc. However, for the sake of clarity, all kinds of buses are labeled as the bus 1020 in the figure. The bus 1020 may be a Peripheral Component Interconnect Express (PCIe) bus, or an extended industry standard architecture (EISA) bus, a unified bus (Ubus or UB), a Compute Express Link (CXL), a Cache Coherent Interconnect for Accelerators (CCIX), etc. The bus 1020 may be divided into an address bus, a data bus, a control bus, etc.
[0313] As an example, the computer device 1000 may include multiple processors. The processor may be a multi-CPU processor. Here, the processor may refer to one or more devices, circuits, and / or computing units for processing data (such as computer program instructions).
[0314] It is worth noting that Figure 10 only the example that the computer device 1000 includes 1 processor 1010 and 1 storage 1030 is taken here. Here, the processor 1010 and the storage 1030 are respectively used to indicate a type of device or equipment. In specific embodiments, the quantity of each type of device or equipment may be determined according to service requirements.
[0315] The memory 1050 can be a volatile memory pool or a non-volatile memory pool, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory 1050 is used to store file attributes and setting results, etc.
[0316] The memory 1030 can correspond to the storage medium for storing information such as files, file attributes, and setting results in the above method embodiments. For example, a disk, such as a mechanical hard disk or a solid-state drive.
[0317] The above computer device 1000 can be a general-purpose device or a special-purpose device. For example, the computer device 1000 can be an edge device (e.g., a box carrying a processing-capable chip), etc. Optionally, the computer device 1000 can also be a server or other devices with computing capabilities.
[0318] It should be understood that the computer device 1000 according to this embodiment can correspond to the client 800 and the storage server 900 in this embodiment, and can correspond to the execution according to Figure 3 、 Figure 5 、 Figure 6 or Figure 7 any one of the methods in, and the above and other operations and / or functions of each module in the client 800 and the storage server 900 are respectively for realizing Figure 3 、 Figure 5 、 Figure 6 or Figure 7The corresponding processes of the various methods in [the specific context] are not elaborated here for the sake of brevity.
[0319] The method steps in this embodiment can be implemented in a hardware manner or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a random access memory (RAM), flash memory, read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), registers, hard disks, removable hard disks, CD-ROMs, or any other form of storage medium well-known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. Additionally, the ASIC can be located in a computing device. Of course, the processor and the storage medium can also exist as discrete components in the computing device.
[0320] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are executed in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, or other programmable devices. The computer program or instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer program or instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired or wireless manner. The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disc (DVD); or it may be a semiconductor medium, such as a solid state drive (SSD). The above is only the specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A method for setting file attributes, characterized in that, Including: Sending a setting request to a storage system, where the setting request is used to set file attributes of multiple files; Receiving a setting response, where the setting response is used to indicate: according to the setting request, the setting result of the file attributes of the multiple files.
2. The method according to claim 1, wherein The setting request includes a recursive setting parameter, where the recursive setting parameter is used to indicate setting the file attributes of the first file and the multi-level sub-files included in the first file.
3. The method according to claim 1 or 2, characterized in that, The setting request includes the file identifier of the first file among the multiple files.
4. The method according to any one of claims 1-3, characterized in that The setting result is used to indicate success or failure.
5. The method according to any one of claims 1 to 3, characterized in that, The setting result is used to indicate recheck.
6. The method according to claim 5, wherein The setting request includes a synchronization identifier; the synchronization identifier is used to indicate that the storage system feeds back the setting response in a synchronous manner; the setting response includes a task identifier and a first error code, when the first error code is used to indicate recheck; After receiving the setting response, the method further includes: Sending a setting status query request, where the setting status query request includes the task identifier; Receiving a setting status query response, where the setting status query response is used to indicate: according to the setting request, the setting result of the file attributes of the multiple files.
7. The method according to any one of claims 1-3, characterized in that, The setting result is used to indicate waiting for the setting result fed back by the storage system.
8. The method according to claim 7, wherein The setting request includes an asynchronous identifier; the asynchronous identifier is used to indicate that the storage system feeds back the setting response in an asynchronous manner; the setting response includes a task identifier and a first error code, when the first error code is used to indicate waiting; After receiving the setting response, the method further includes: Receiving a callback message, where the callback message includes a task identifier and the setting result of the file attributes of the multiple files, and the setting result includes any one of success or failure; Sending a callback response.
9. The method according to claim 8, characterized in that The callback message further includes a check code; Sending a callback response, including: When the task identifier is successfully verified according to the check code, sending the callback response; After receiving the callback message, the method further includes: When the task identifier is verified to be failed according to the check code, sending a second error code.
10. The method according to any one of claims 5-9, characterized in that, The method further includes: Sending a setting cancellation request to the storage system, where the setting cancellation request is used to indicate canceling the task corresponding to the setting request; Receiving a setting cancellation response sent by the storage system, where the setting cancellation response is used to indicate cancellation success or cancellation failure.
11. The method according to claim 6 or 8, characterized in that, The setting response includes a task identifier and a first error code NFS4_OK; or, the setting response includes a task identifier and a first error code PENDING.
12. A method for setting file attributes, characterized in that, Including: A storage system receives a setting request, where the setting request is used to set file attributes of multiple files; Setting the file attributes of the multiple files according to the setting request; Sending a setting response, where the setting response is used to indicate: according to the setting request, the setting result of the file attributes of the multiple files.
13. The method according to claim 12, characterized in that, Setting the file attributes of the multiple files according to the setting request, specifically including: Querying all sub-files under the file; Setting all the queried sub-files according to the file attributes.
14. The method according to claim 12 or 13, characterized in that, The setting request includes a recursive setting parameter and a file identifier of a first file among the multiple files, and the recursive setting parameter is used to indicate setting the file attributes of the first file and the file attributes of the multi-level sub-files included in the first file.
15. The method according to any one of claims 12 - 14, characterized in that, The setting request includes a synchronization identifier; the synchronization identifier is used to indicate that the storage system feeds back the setting response in a synchronous manner; The sending of the setting response includes: When the timer does not time out, send the setting response, and the setting response is used to indicate whether the setting of the file attributes of the multiple files is successful or failed according to the setting request.
16. The method according to any one of claims 12 - 14, characterized in that, The setting request includes a synchronization identifier; The sending of the setting response includes: When the timer times out, send the setting response, and the setting response is used to indicate re-checking the setting result of the file attributes of the multiple files according to the setting request.
17. The method according to claim 16, wherein The setting response includes a task identifier and a first error code, and the first error code is used to indicate re-checking; After the sending of the setting response, the method further includes: Receiving a setting status query request, where the setting status query request includes the task identifier; Sending a setting status query response, and the setting status query response is used to indicate: the setting result of the file attributes of the multiple files according to the setting request.
18. The method according to claim 17, wherein The setting status query request further includes a check code; The sending of the setting status query response includes: When the task identifier is successfully verified according to the check code, send the setting status query response; The method further includes: When the task identifier is verified to be failed according to the check code, send a second error code.
19. The method according to any one of claims 12 - 14, characterized in that, The setting request includes an asynchronous identifier; the asynchronous identifier is used to indicate that the storage system feeds back the setting response in an asynchronous manner; the setting response is used to indicate waiting for the setting result of the file attributes of the multiple files according to the setting request; The setting response includes a task identifier and a first error code, and the first error code is used to indicate waiting; After the sending of the setting response, the method further includes: Sending a callback message, where the callback message includes a task identifier and the setting result of the file attributes of the multiple files, and the setting result includes either success or failure; Receiving a callback response.
20. The method according to any one of claims 16-19, characterized in that, The method further includes: Receiving a setting cancellation request, where the setting cancellation request is used to indicate canceling the task corresponding to the setting request; Canceling the task corresponding to the setting request according to the setting cancellation request; Sending a setting cancellation response, and the setting cancellation response is used to indicate whether the cancellation is successful or failed.
21. The method according to claim 17 or 19, characterized in that, The setting response includes a task identifier and a first error code NFS4_OK; or, the setting response includes a task identifier and a first error code PENDING.
22. A client, characterized in that, The client includes a module that executes the operation steps of the method described in any one of claims 1-11 above.
23. A storage server, characterized in that, The storage server includes a module that executes the operation steps of the method described in any one of claims 12-21 above.
24. A computer device, characterized in that, The computer device includes a memory and a processor, and the memory is used for storing a set of computer instructions; when the processor executes the set of computer instructions, it performs the operation steps of the method described in any one of claims 1-11 above; or, it performs the operation steps of the method described in any one of claims 12-21 above.
25. A communication system, characterized in that, The communication system includes a client and multiple storage servers. The client mounts the multiple storage servers. The client is used for performing the operation steps of the method described in any one of claims 1-11 above, and the storage server is used for performing the operation steps of the method described in any one of claims 12-21 above.
Citation Information
Cited By
File attribute setting method, client, storage server, device, and system
WO2025140215A1