Logic address mark processing method
Through logical address marking processing methods, write uncorrectable commands in NVMe SSD systems are split and marked, which solves the problems of physical uncorrectable error processing efficiency and large metadata occupancy, and realizes efficient error marking and recovery, improving the system disaster recovery reliability and storage efficiency.
Patent Information
- Application Number
- CN202411380300.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-14
AI Technical Summary
In NVMe SSD systems, storage command processing is inefficient due to physically uncorrectable errors, and metadata occupies a large amount of metadata, making it difficult to efficiently mark and distinguish between read uncorrectable and write uncorrectable errors.
Provide a logical address marking method, which can split the write uncorrectable commands, allocate the aligned and non-aligned parts, update the flash conversion layer, and use the uncorrectable bitmap in the metadata for marking, distinguish between read uncorrectable and write uncorrectable. And analyze the return status when reading the command.
It improves the reliability of the host's error handling process, saves storage space, supports writing non-correctable commands in a large range, accurately marks and identifys the sources of non-correctable errors, and realizes efficient error handling and data recovery.
Smart Images

Figure CN119311603A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of storage devices, and in particular to a method for processing logical address tags. Background Art
[0002] The Write Uncorrectable command is an I / O command in the NVMe protocol that is used to mark a specified logical block as unavailable. In technical documents or discussions related to the NVMe protocol, expressions such as "Write Uncorrectable Command" and "Write Uncorrectable Instruction" may be used to describe "Write Uncorrectable".
[0003] Uncorrectable errors in NVMe SSDs (Non-Volatile Memory Meter Host Controller Interface Solid-State Drives) are usually caused by physical reasons such as hardware failure, flash memory cell wear and data corruption. Once these errors occur, they are generally difficult to recover.
[0004] In SSD systems, 4KB data mapping (NVM data frame size is 4KB, and each entry in the FTL table is mapped to one NVM data frame) is the most common practice. However, in order to support 512B sector size, non-4KB aligned commands must always be processed. When the sector size described in the storage command provided by the host is 512B, the logical addresses of some accessed sectors are not aligned with 4KB. This storage command is called a non-4KB aligned storage command or a non-aligned storage command.
[0005] The data in an NVM data frame is not necessarily modified at the same time. When one or more 512B sectors are modified, the old NVM data frame needs to be loaded from the medium first, and the new sector data overwrites the old sector data and then rewrites it back to the medium. During the process of loading the old data, if a physical uncorrectable error really occurs on the medium, the sectors in this data frame that are not covered by the new data will be marked with the uncorrectable bitmap in the metadata. If the marked position is read later, the uncorrectable error will be reported to the Host.
[0006] However, since two sets of 8-bit uncorrectable bitmaps need to be recorded in the metadata, corresponding to read uncorrectable and write uncorrectable, it will take up 16 bits, which takes up a lot of storage space. Summary of the invention
[0007] The purpose of this application is to provide a logical address marking processing method, which marks one or more LBAs as an uncorrectable state through an NVMe command, so as to verify the host's processing after encountering an uncorrectable error caused by the physical medium, and the uncorrectable state can be overwritten by a new write command.
[0008] To achieve the above object, the present application provides a method for processing a logical address mark, comprising the following steps:
[0009] In response to receiving an uncorrectable write command, the uncorrectable write command is split to obtain an aligned portion and an unaligned portion, and the aligned portion and the unaligned portion are marked as uncorrectable, and a flash translation layer is updated, wherein the updated flash translation layer includes: a correspondence between a logical block address and an uncorrectable physical block address;
[0010] After receiving the read command, the flash translation layer analyzes the read command and sets the command return status.
[0011] As above, in which, in response to receiving a write uncorrectable command, the write uncorrectable command is split to obtain an aligned part and a non-aligned part, and the aligned part and the non-aligned part are marked as uncorrectable in the following sub-steps:
[0012] S11: after receiving the write uncorrectable command, the logical block address in the write uncorrectable command is segmented to obtain a segmentation object, where the segmentation object is an aligned part or a non-aligned part, and S12 is executed;
[0013] S12: Determine whether the segmented object is a non-aligned part, if not, execute S13; if yes, execute S14;
[0014] S13: Allocate an uncorrectable physical block address for the segmentation object, and execute S15;
[0015] S14: Allocate a physical address for the segmented object and execute S15;
[0016] S15: Update the flash translation layer;
[0017] S16: Determine whether the physical address is an uncorrectable physical block address, if not, execute S17; if yes, execute S18;
[0018] S17: Save the data to the medium corresponding to the physical address, and execute S18;
[0019] S18: Determine whether all physical block addresses included in the write uncorrectable command have been processed. If not, execute S12; if so, execute S19;
[0020] S19: Returns command completion status.
[0021] As above, the sub-steps of allocating physical addresses to the segmented objects are as follows:
[0022] S141: Determine whether the logical block address of the split object is a logical block address that has been operated before. If not, execute S142; if yes, execute S143;
[0023] S142: Generate empty data and execute S145;
[0024] S143: Load the original data. After the loading is completed, execute S144;
[0025] S144: Determine whether the loaded original data encounters an uncorrectable error; if not, execute S145; if so, execute S146;
[0026] S145: Fill the corresponding sector with uncorrectable data, and execute S146;
[0027] S146: setting the bit corresponding to the uncorrectable bitmap in the metadata, and executing S147;
[0028] S147: Allocate physical address.
[0029] As above, after receiving the write uncorrectable command, the scope of the write uncorrectable command is divided into an aligned part and a non-aligned part according to the starting logical block address in the write uncorrectable command, the number of logical block addresses to be marked, and the format of the logical block address of the namespace of the current SSD device.
[0030] As above, an uncorrectable physical block address is allocated to each data frame in the segmentation object, wherein one data frame corresponds to one uncorrectable physical block address.
[0031] As mentioned above, by adding preset special format data in the sector, it is possible to distinguish whether the uncorrectable bitmap records read uncorrectable or write uncorrectable.
[0032] As above, the sector data to be marked by the command is filled with write-incorrectable data of a special format, and the incorrectable bitmap bit in the metadata corresponding to the sector to be marked by the command is set to 1.
[0033] As above, after receiving the read command, the flash translation layer analyzes the read command and sets the command return status as follows:
[0034] S21: After receiving the read command, query all physical block addresses corresponding to the logical block address of the read command through the flash translation layer;
[0035] S22: Determine whether the physical block address contains an uncorrectable physical block address, if not, execute S23; if yes, execute S30;
[0036] S23: Load data from the medium corresponding to the physical block address and execute S24;
[0037] S24: Determine whether the loading is successful, if so, execute S25; if not, execute S30;
[0038] S25: Determine whether there is an uncorrectable bitmap set in the metadata, if not, execute S26; if yes, execute S31;
[0039] S26: Determine whether the data has other errors. If not, execute S27; if yes, execute S33;
[0040] S27: Return the loaded user data to the host and execute S28;
[0041] S28: Set the command return status to success and execute S29;
[0042] S29: Returns the command completion status;
[0043] S30: Set the command return status to an uncorrectable error and execute S29;
[0044] S31: Determine whether the sector data corresponding to the set bit is write-uncorrectable data, if so, execute S30; if not, execute S32;
[0045] S32: Count the current uncorrectable errors and execute S30;
[0046] S33: Set the command return status to the corresponding error status and execute S29.
[0047] As above, if there is an uncorrectable bitmap set in the metadata, it is determined whether the sector corresponding to the uncorrectable bitmap setting is included in the range of the read command. If so, the command return status is set to an uncorrectable error; then the source of the uncorrectable bit setting is determined based on the sector data. If it comes from the previous write uncorrectable command, it will not be counted in the uncorrectable count according to the protocol, otherwise it needs to be counted.
[0048] As described above, after the command return status is set to an uncorrectable error, this read command will no longer perform data transmission and can directly return the command completion status to the host.
[0049] The beneficial effects achieved by this application are as follows:
[0050] (1) Help the host to inject errors and verify its own error handling process at the host level, thereby improving its disaster recovery reliability.
[0051] (2) When the host detects that certain LBAs in the storage device have unrecoverable errors, it can use this command to mark these LBAs as uncorrectable. In this way, when reading or writing these marked LBAs in the future, the system will know that the data at these locations is unreliable, and take corresponding measures, such as avoiding the use of these damaged areas, triggering the error handling mechanism in advance, or performing data recovery operations. Only a set of 8-bit data needs to be recorded in the uncorrectable bitmap of the metadata, which can indicate both uncorrectable read and uncorrectable write. The special format of the data in the bitmap is used to distinguish and save storage space.
[0052] (3) Write uncorrectable supports marking as uncorrectable state with a single LBA as the granularity, regardless of the number of LBAs in the FTL indirect addressing granularity, thereby improving the accuracy and flexibility of the marking range. The maximum operation range of write uncorrectable can reach the maximum value of the LBA block number area in the NVMe command (up to 32MB in 512B format and up to 256MB in 4KB format). The implementation method of this application can complete a large range of write uncorrectable commands in a very short time.
[0053] (4) Without occupying additional metadata space, the LBA where the uncorrectable error occurred can be marked, and whether it is caused by the write uncorrectable error command can be accurately distinguished.
[0054] (5) Reuse the uncorrectable bitmap in the current metadata to implement the write uncorrectable command. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0056] Figure 1 A flowchart of an embodiment of a method for processing a logical address mark;
[0057] Figure 2 A flowchart of a write path for writing uncorrectable commands;
[0058] Figure 3 The uncorrectable bitmap of the 4KB data block and the arrangement and correspondence of 8 sectors;
[0059] Figure 4 A flowchart for a read path supporting write uncorrectable commands;
[0060] Figure 5 A flowchart of an embodiment of writing an uncorrectable command and reading a command. DETAILED DESCRIPTION
[0061] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0062] like Figure 1 As shown, the present application provides a logical address tag processing method, comprising the following steps:
[0063] S1: In response to receiving an uncorrectable write command, the uncorrectable write command is split to obtain an aligned part and an unaligned part, and the aligned part and the unaligned part are marked as uncorrectable, and a flash translation layer is updated, wherein the updated flash translation layer includes: a correspondence between a logical block address and an uncorrectable physical block address.
[0064] Further, such as Figure 2 As shown, in response to receiving a write uncorrectable command, the sub-steps of splitting the write uncorrectable command, obtaining an aligned part and a non-aligned part, and marking the aligned part and the non-aligned part as uncorrectable are as follows:
[0065] S11: After receiving the write uncorrectable command, the logical block address in the write uncorrectable command is segmented to obtain a segmentation object, where the segmentation object is an aligned part or a non-aligned part, and S12 is executed.
[0066] Furthermore, after receiving the uncorrectable write command, the storage device divides the scope of the uncorrectable write command into an aligned part and an unaligned part according to the starting logical block address (LBA) in the uncorrectable write command, the number of logical block addresses to be marked (Number of LBA blocks, NLB), and the format of the logical block address (LBA) of the namespace of the current SSD device.
[0067] Specifically, the alignment portion refers to: an LBA range that includes one or more complete 4KB NVM data frames.
[0068] The non-aligned portion refers to an LBA range that includes a portion of the 4KB NVM data, the size of which is not sufficient to form a complete NVM data frame.
[0069] S12: Determine whether the segmented object is a non-aligned part, if not, execute S13; if yes, execute S14.
[0070] S13: Allocate an uncorrectable physical block address to the segmentation object, and execute S15.
[0071] Further, an uncorrectable physical block address is allocated to each data frame in the segmented object, wherein one data frame corresponds to one uncorrectable physical block address, and S15 is executed.
[0072] The marked data frame is assigned a valid uncorrectable physical block address, which corresponds to a certain location of the real non-volatile medium.
[0073] S14: Allocate a physical address to the segmented object and execute S15.
[0074] Specifically, for the non-aligned part, when actually storing data, each data frame actually stored by the storage device consists of metadata (data containing additional information generated by the storage device) and user data (data sent by the host), and the user data consists of multiple sectors, each of which corresponds to an LBA (Logical Block Address). The metadata contains an uncorrectable bitmap, and each bit in the uncorrectable bitmap is used to identify the situation of a sector, that is, one bit corresponds to one sector.
[0075] Figure 3 A storage organization form that represents the arrangement of the uncorrectable bitmap and eight 512B sectors in the metadata within a 4KB NVM data frame, as well as the corresponding relationship.
[0076] Specifically, the metadata includes other metadata and an uncorrectable bitmap; the uncorrectable bitmap includes: bit 0, bit 1, bit 2, bit 3, bit 4, bit 5, bit 6 and bit 7; the user data includes: sector 0, sector 1, sector 2, sector 3, sector 4, sector 5, sector 6 and sector 7; the case of using bit 0 to identify sector 0, the case of using bit 1 to identify sector 1, the case of using bit 2 to identify sector 2, the case of using bit 3 to identify sector 3, the case of using bit 4 to identify sector 4, the case of using bit 5 to identify sector 5, the case of using bit 6 to identify sector 6, and the case of using bit 7 to identify sector 7.
[0077] Further, such as Figure 2 As shown, the sub-steps for allocating physical addresses to split objects are as follows:
[0078] S141: Determine whether the logical block address of the split object is a logical block address that has been operated before. If not, execute S142; if so, execute S143.
[0079] Specifically, for the non-aligned part, it is determined whether the LBA has been written with data.
[0080] S142: Generate empty data and execute S145.
[0081] Specifically, if no data has been written to the LBA, all-zero data (empty data) is generated, that is, the uncorrectable bitmap and user data bits in the metadata are all-zero data, and the rest of the metadata is an initialization value.
[0082] S143: Load the original data. After the loading is completed, execute S144.
[0083] Specifically, if data has been written to the LBA, the original metadata and user data are loaded.
[0084] S144: Determine whether the loaded original data encounters an uncorrectable error; if not, execute S145; if so, execute S146.
[0085] S145: Fill the corresponding sector with uncorrectable data and execute S146.
[0086] Specifically, if no errors are encountered during the loading process, no special processing is required.
[0087] Furthermore, the sector data only needs to record a set of 8-bit data. By adding preset special format data in the sector, it is possible to distinguish whether the uncorrectable bitmap records read uncorrectable or write uncorrectable, that is, the special format data corresponding to read uncorrectable is different from the special format data corresponding to write uncorrectable.
[0088] S146: Set the bit corresponding to the uncorrectable bitmap in the metadata, and execute S147.
[0089] Furthermore, the sector data to be marked by the command is filled with write-incorrectable data in a special format, and the incorrectable bitmap bit in the metadata corresponding to the sector to be marked by the command is set to 1.
[0090] Specifically, if an uncorrectable error is encountered when reading the physical medium during the process of loading the original metadata and user data, all bits of the uncorrectable bitmap of the entire data frame are directly set to 1.
[0091] Before the write uncorrectable command is supported, when a physical uncorrectable error is encountered during the non-aligned overwrite process of loading old data, the corresponding bits of one or more sectors not covered by the new data in the above metadata uncorrectable bitmap are set, so as to mark one or more sectors that encountered uncorrectable errors and failed to load successfully as uncorrectable, and then mark one or more LBAs corresponding to these sectors as uncorrectable.
[0092] After supporting the writing of uncorrectable commands, in addition to the above situation, after the storage device receives an uncorrectable command containing a non-aligned part, it will set the corresponding bits of one or more sectors marked as uncorrectable by the command in the above metadata uncorrectable bitmap according to the LBA range contained in the non-aligned part, so as to mark one or more LBAs corresponding to the non-aligned part as uncorrectable.
[0093] Since both of the above situations will cause certain bits of the metadata uncorrectable bitmap to be set, in order to distinguish the source of the uncorrectable bitmap, considering that the sector where the bitmap is set must not contain valid user data, if the source that cannot be corrected is a write uncorrectable command, then the storage device will use special format data in the data field of the sector to mark its source. This special format of data is called write uncorrectable data. For the case where the source is an uncorrectable error encountered during loading, no special processing is performed.
[0094] S147: Allocate physical address.
[0095] S15: Update the flash translation layer.
[0096] Specifically, for the alignment part, the storage device will allocate a special PBA (Physical Block Address), called an uncorrectable PBA, and update the FTL (Flash Translation Layer) to mark a 4KB NVM data frame as uncorrectable. If the alignment part contains multiple 4KB NVM data frames, each data frame will be allocated an uncorrectable PBA, and the corresponding relationship between the data frame and the uncorrectable PBA will be updated in the FTL. All data frames are saved to the medium corresponding to the allocated valid uncorrectable PBA.
[0097] For the non-aligned part, the correspondence of LBA is updated in FTL.
[0098] Specifically, updating the FTL is to update the correspondence between the LBA and the PBA.
[0099] S16: Determine whether the physical address is an uncorrectable physical block address, if not, execute S17; if so, execute S18.
[0100] S17: Save the data to the medium corresponding to the physical address, and execute S18.
[0101] S18: Determine whether all physical block addresses included in the write uncorrectable command have been processed. If not, execute S12; if so, execute S19.
[0102] S19: Returns command completion status.
[0103] Specifically, it is determined whether the command is completed. If it is completed, the command completion status is returned. If it is not completed, it is returned to continue to determine whether the unprocessed command range belongs to the aligned part or the non-aligned part.
[0104] S2: After receiving the read command, the read command is analyzed through the flash translation layer and the command return status is set.
[0105] Further, such as Figure 4 As shown, after receiving the read command, the flash translation layer analyzes the read command and sets the command return status in the following sub-steps:
[0106] S21: After receiving the read command, query all physical block addresses corresponding to the logical block address of the read command through the flash translation layer.
[0107] Specifically, when a read command is received, all PBAs corresponding to the LBAs included in the command are queried through the FTL.
[0108] S22: Determine whether the physical block address contains an uncorrectable physical block address, if not, execute S23; if yes, execute S30.
[0109] S23: Load data from the medium corresponding to the physical block address and execute S24.
[0110] Specifically, if the physical block address does not include an uncorrectable physical block address, data is loaded from the medium corresponding to the PBA.
[0111] S24: Determine whether the loading is successful, if so, execute S25; if not, execute S30.
[0112] S25: Determine whether there is an uncorrectable bitmap set in the metadata, if not, execute S26; if yes, execute S31.
[0113] Furthermore, if there is an uncorrectable bitmap set in the metadata, it is determined whether the sector corresponding to the uncorrectable bitmap setting is included in the range of the read command. If so, the command return status is set to an uncorrectable error; then the source of the uncorrectable bit setting is determined based on the sector data. If it comes from a previous write uncorrectable command, it will not be counted in the uncorrectable count according to the protocol, otherwise it needs to be counted.
[0114] If the uncorrectable bitmap is not set, or the sector corresponding to the setting is not within the range of the read command, it is determined whether the data has other errors. If so, the command return status needs to be set to the corresponding error status.
[0115] S26: Determine whether the data has other errors. If not, execute S27; if so, execute S33.
[0116] S27: Return the loaded user data to the host and execute S28.
[0117] S28: Set the command return status to success and execute S29.
[0118] S29: Returns command completion status.
[0119] Specifically, according to a preset return status, the command completion status is returned to the host.
[0120] S30: Set the command return status to an uncorrectable error and execute S29.
[0121] Furthermore, after the command return status is set to an uncorrectable error, this read command will no longer perform data transmission, and the command completion status can be directly returned to the host.
[0122] S31: Determine whether the sector data corresponding to the set bit is write-uncorrectable data. If so, execute S30; if not, execute S32.
[0123] S32: Count the current uncorrectable errors and execute S30.
[0124] S33: Set the command return status to the corresponding error status and execute S29.
[0125] Figure 5 This is the writing process for writing uncorrectable commands, and the processing flow for host read commands that may encounter uncorrectable marks.
[0126] Specifically, the data writing process may occur in response to an aligned or unaligned write uncorrectable command issued by the host. The data reading process may occur in response to a read command from the host, and the process may be related to the write uncorrectable flag or may be completely unrelated.
[0127] In this embodiment, a typical value 0xFFFF0ECC is used as an uncorrectable PBA, which represents an uncorrectable error (Uncorrectable Error Correction Code, UECC).
[0128] See also Figure 5 In the left half (write uncorrectable process), the storage device receives the write uncorrectable command from the host for LBA4-LBA15, and marks the LBAs containing both aligned and unaligned parts as uncorrectable. In response, the storage device first decomposes the LBA range implemented by the command into the unaligned LBA4-LBA7 part and the aligned part LBA8-LBA15 and processes them separately:
[0129] For the non-aligned part of LBA4-LBA7, firstly, the FTL needs to confirm whether it is an uninitialized NVM data frame. If it is, a group of all-zero data is generated as the data frame. If not, this group of data frames needs to be loaded.
[0130] If loading the data frame fails, such as Figure 5 As shown, a group of all-zero data is generated, and all bits of its uncorrectable bitmap are set, but the sector data is not modified.
[0131] If the data frame is loaded successfully, after obtaining the data frame, since the LBA mark range this time is LBA4-LBA7, the uncorrectable data is written into the sector data of sector 4-7 of this data frame, and the remaining sector data are not operated. The corresponding bit 4-7 of sector 4-7 in the metadata uncorrectable bitmap is set to 1, and the values of the remaining bits remain unchanged. Then a valid PBA is reassigned to the data frame, and the updated data is written to the position of the non-volatile storage medium corresponding to the valid PBA.
[0132] For the aligned portion of LBA8-LBA15, 0xFFFFECC is assigned to the portion as an uncorrectable PBA and the FTL is updated.
[0133] See also Figure 5 The right half (read uncorrectable process) responds to the host's read command. After querying the PBA corresponding to the LBA through the FTL, it first determines whether the PBA range contains the uncorrectable PBA 0xFFFFECC. If it does, the uncorrectable error is directly reported to the host without transmitting data. If the queried PBA is a regular PBA, then after loading its corresponding data frame according to the PBA, it will first confirm whether the corresponding bit of the data frame sector contained in the read command in the metadata uncorrectable bitmap is set. If so, it is necessary to determine its source based on the sector data content. If the source is a write uncorrectable command, the uncorrectable error will not be included in the statistics. Otherwise, the uncorrectable error will be counted and reported according to the protocol, and then the uncorrectable error will be directly reported to the host without transmitting data. If the above situation does not exist in the entire range of the read command, the read command is not related to the uncorrectable state, and the read command continues.
[0134] The beneficial effects achieved by this application are as follows:
[0135] (1) Help the host to inject errors and verify its own error handling process at the host level, thereby improving its disaster recovery reliability.
[0136] (2) When the host detects that certain LBAs in the storage device have unrecoverable errors, it can use this command to mark these LBAs as uncorrectable. In this way, when reading or writing these marked LBAs in the future, the system will know that the data at these locations is unreliable, and take corresponding measures, such as avoiding the use of these damaged areas, triggering the error handling mechanism in advance, or performing data recovery operations. Only a set of 8-bit data needs to be recorded in the uncorrectable bitmap of the metadata, which can indicate both uncorrectable read and uncorrectable write. The special format of the data in the bitmap is used to distinguish and save storage space.
[0137] (3) Write uncorrectable supports marking as uncorrectable state with a single LBA as the granularity, regardless of the number of LBAs in the FTL indirect addressing granularity, thereby improving the accuracy and flexibility of the marking range. The maximum operation range of write uncorrectable can reach the maximum value of the LBA block number area in the NVMe command (up to 32MB in 512B format and up to 256MB in 4KB format). The implementation method of this application can complete a large range of write uncorrectable commands in a very short time.
[0138] (4) Without occupying additional metadata space, the LBA where the uncorrectable error occurred can be marked, and whether it is caused by the write uncorrectable error command can be accurately distinguished.
[0139] (5) Reuse the uncorrectable bitmap in the current metadata to implement the write uncorrectable command.
[0140] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they are aware of the basic creative concepts. Therefore, the scope of protection of the present application is intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application. Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the protection scope of the present application and its equivalent technology, the present application is also intended to include these modifications and variations.
Claims
1. A method for processing a logical address mark, characterized in that: The steps include: In response to receiving an uncorrectable write command, the uncorrectable write command is split to obtain an aligned portion and an unaligned portion, and the aligned portion and the unaligned portion are marked as uncorrectable, and a flash translation layer is updated, wherein the updated flash translation layer includes: a correspondence between a logical block address and an uncorrectable physical block address; After receiving the read command, the flash translation layer analyzes the read command and sets the command return status.
2. The method for processing a logical address mark according to claim 1, characterized in that: In response to receiving a write uncorrectable command, the sub-steps of splitting the write uncorrectable command, obtaining an aligned portion and a non-aligned portion, and marking the aligned portion and the non-aligned portion as uncorrectable are as follows: S11: after receiving the write uncorrectable command, the logical block address in the write uncorrectable command is segmented to obtain a segmentation object, where the segmentation object is an aligned part or a non-aligned part, and S12 is executed; S12: Determine whether the segmented object is a non-aligned part, if not, execute S13; if yes, execute S14; S13: Allocate an uncorrectable physical block address for the segmentation object, and execute S15; S14: Allocate a physical address for the segmented object and execute S15; S15: Update the flash translation layer; S16: Determine whether the physical address is an uncorrectable physical block address, if not, execute S17; if yes, execute S18; S17: Save the data to the medium corresponding to the physical address, and execute S18; S18: Determine whether all physical block addresses included in the write uncorrectable command have been processed. If not, execute S12; if so, execute S19; S19: Returns command completion status.
3. The method for processing a logical address mark according to claim 2, characterized in that: The sub-steps for assigning physical addresses to split objects are as follows: S141: Determine whether the logical block address of the split object is a logical block address that has been operated before. If not, execute S142; if yes, execute S143; S142: Generate empty data and execute S145; S143: Load the original data. After the loading is completed, execute S144; S144: Determine whether the loaded original data encounters an uncorrectable error; if not, execute S145; If yes, execute S146; S145: Fill the corresponding sector with uncorrectable data, and execute S146; S146: setting the bit corresponding to the uncorrectable bitmap in the metadata, and executing S147; S147: Allocate physical address.
4. The method for processing a logical address mark according to claim 2, characterized in that: After receiving the uncorrectable write command, the scope of the uncorrectable write command is divided into an aligned part and a non-aligned part according to the starting logical block address in the uncorrectable write command, the number of logical block addresses to be marked, and the format of the logical block address of the namespace of the current SSD device.
5. The method for processing a logical address mark according to claim 2, characterized in that: An uncorrectable physical block address is allocated to each data frame in the segmented object, wherein one data frame corresponds to one uncorrectable physical block address.
6. The method for processing a logical address mark according to claim 3, characterized in that: By adding preset special format data in the sector, it is possible to distinguish whether the uncorrectable data recorded in the uncorrectable bitmap is read uncorrectable or write uncorrectable.
7. The method for processing a logical address mark according to claim 3, characterized in that: The sector data to be marked by the command is filled with write-uncorrectable data in a special format, and the uncorrectable bitmap bit in the metadata corresponding to the sector to be marked by the command is set to 1.
8. The method for processing a logical address mark according to claim 1, characterized in that: After receiving the read command, the flash translation layer analyzes the read command and sets the command return status in the following sub-steps: S21: After receiving the read command, query all physical block addresses corresponding to the logical block address of the read command through the flash translation layer; S22: Determine whether the physical block address contains an uncorrectable physical block address, if not, execute S23; if yes, execute S30; S23: Load data from the medium corresponding to the physical block address and execute S24; S24: Determine whether the loading is successful, if so, execute S25; if not, execute S30; S25: Determine whether there is an uncorrectable bitmap set in the metadata, if not, execute S26; if yes, execute S31; S26: Determine whether the data has other errors. If not, execute S27; if yes, execute S33; S27: Return the loaded user data to the host and execute S28; S28: Set the command return status to success and execute S29; S29: Returns the command completion status; S30: Set the command return status to an uncorrectable error and execute S29; S31: Determine whether the sector data corresponding to the set bit is write-uncorrectable data, if so, execute S30; if not, execute S32; S32: Count the current uncorrectable errors and execute S30; S33: Set the command return status to the corresponding error status and execute S29.
9. The method for processing a logical address mark according to claim 8, characterized in that: If there is an uncorrectable bitmap set in the metadata, determine whether the sector corresponding to the uncorrectable bitmap setting is included in the range of the read command. If so, set the command return status to uncorrectable error; then determine the source of the uncorrectable bit setting based on the sector data. If it comes from the previous write uncorrectable command, it will not be counted in the uncorrectable count according to the protocol, otherwise it needs to be counted.
10. The method for processing a logical address mark according to claim 8, characterized in that: After the command return status is set to an uncorrectable error, this read command will no longer perform data transmission and the command completion status can be directly returned to the host.