HANDLING PATTERN IDENTIFIERS IN A DATA STORAGE SYSTEM

20200341656 ยท 2020-10-29

    Inventors

    Cpc classification

    International classification

    Abstract

    Techniques for handling pattern identifiers in a data storage system. By replacing a block pointer with a pattern identifier, the techniques can identify a data block (or an indirect data block) as a bad block, without resorting to the use of a separate flag or bad block (BB) bit in per-block metadata (e.g., a mapping pointer) of the data block. The techniques can also avoid waste of valuable metadata space by using pattern identifiers at various levels of a mapping tree, leveraging pointer granularity at lower levels, mid-levels, and progressively higher levels of the mapping tree.

    Claims

    1. A method of handling pattern identifiers for identifying bad blocks in a data storage system, comprising: determining that a data block located in a storage area of the data storage system is a bad block, the storage area of the bad block being pointed to by a block pointer in a mapping layer of the data storage system; replacing the block pointer pointing to the bad block with a predetermined data pattern identifier (ID), thereby causing the entire storage area mapped via the block pointer to be regarded by the data storage system as having a data pattern corresponding to the predetermined data pattern ID; and in response to receipt of a storage IO request from a host computer to read data located in the storage area having the data pattern, returning a media error by the data storage system to the host computer.

    2. The method of claim 1 further comprising: setting an existing attribute flag or bit associated with the block pointer to indicate that the block pointer has been replaced with the predetermined data pattern ID.

    3. The method of claim 3 further comprising: having set the existing attribute flag or bit associated with the block pointer, avoiding setting a separate bad block (BB) bit in per-block metadata of the data block.

    4. The method of claim 1 further comprising: implementing multiple levels of indirection for accessing data in the data storage system, the multiple levels of indirection including a mapping layer having a multi-level tree with a leaf level and at least one higher level above the leaf level, wherein the replacing of the block pointer includes replacing the block pointer in the leaf level of the multi-level tree with the predetermined data pattern ID.

    5. A method of handling pattern identifiers for saving metadata space in a data storage system, comprising: implementing multiple layers of indirection for accessing host data in the data storage system, the multiple layers of indirection including at least a mapping layer having a multi-level tree with a lower level and a higher level, at least one block pointer in the higher level pointing to at least one block pointer in the lower level, and the at least one block pointer in the lower level pointing to at least one data block located in a storage area of the data storage system; replacing the at least one block pointer in the higher level of the multi-level tree with a predetermined data pattern identifier (ID), thereby causing the entire storage area mapped via the at least one block pointer in the higher level to be regarded by the data storage system as having a data pattern corresponding to the predetermined data pattern ID; and having replaced the at least one block pointer in the higher level of the multi-level tree with the predetermined data pattern ID, performing block allocation in the higher level of the multi-level tree while avoiding performing block allocation in the lower level of the multi-level tree, thereby saving metadata space associated with at least the lower level of the multi-level tree.

    6. The method of claim 5 further comprising: setting an existing attribute flag or bit associated with the at least one block pointer in the higher level to indicate that the at least one block pointer has been replaced with the predetermined data pattern ID.

    7. The method of claim 1 wherein the multi-level tree has the lower level, the higher level, and a lowest level below the lower level, wherein the lowest level of the multi-level tree is a leaf level, and wherein the method further comprises: performing block allocation in the higher level of the multi-level tree while avoiding performing block allocation in the lower level and the leaf level of the multi-level tree, thereby saving metadata space associated with at least the lower level and the leaf level of the multi-level tree.

    8. The method of claim 1 wherein the multi-level tree has the lower level, the higher level, and a highest level above the higher level, wherein at least one block pointer in the highest level points to the at least one block pointer in the higher level, and wherein the method further comprises: replacing the at least one block pointer in the highest level of the multi-level tree with the predetermined data pattern identifier (ID), thereby causing the entire storage area mapped via the at least one block pointer in the highest level to be regarded by the data storage system as having the data pattern corresponding to the predetermined data pattern ID.

    9. The method of claim 8 further comprising: performing block allocation in the highest level of the multi-level tree while avoiding performing block allocation in the higher level and the lower level of the multi-level tree, thereby saving metadata space associated with at least the higher level and the lower level of the multi-level tree.

    10. A system for handling pattern identifiers for identifying bad blocks in a data storage system, comprising: a memory; and storage processing circuitry configured to execute program instructions out of the memory: to determine that a data block located in a storage area of the data storage system is a bad block, the storage area of the bad block being pointed to by a block pointer in a mapping layer of the data storage system; to replace the block pointer pointing to the bad block with a predetermined data pattern identifier (ID), thereby causing the entire storage area mapped via the block pointer to be regarded by the data storage system as having a data pattern corresponding to the predetermined data pattern ID; and in response to receipt of a storage TO request from a host computer to read data located in the storage area having the data pattern, to return a media error by the data storage system to the host computer.

    11. The system of claim 10 wherein the storage processing circuitry is further configured to execute the program instructions out of the memory: to set an existing attribute flag or bit associated with the block pointer to indicate that the block pointer has been replaced with the predetermined data pattern ID.

    12. The system of claim 11 wherein the storage processing circuitry is further configured to execute the program instructions out of the memory: having set the existing attribute flag or bit associated with the block pointer, to avoid setting a separate bad block (BB) bit in per-block metadata of the data block.

    13. The system of claim 10 wherein the storage processing circuitry is further configured to execute the program instructions out of the memory: to implement multiple levels of indirection for accessing data in the data storage system, the multiple levels of indirection including a mapping layer having a multi-level tree with a leaf level and at least one higher level above the leaf level; and to replace the block pointer in the leaf level of the multi-level tree with the predetermined data pattern ID.

    14. A system for handling pattern identifiers for saving metadata space in a data storage system, comprising: a memory; and storage processing circuitry configured to execute program instructions out of the memory: to implement multiple layers of indirection for accessing host data in the data storage system, the multiple layers of indirection including at least a mapping layer having a multi-level tree with a lower level and a higher level, at least one block pointer in the higher level pointing to at least one block pointer in the lower level, and the at least one block pointer in the lower level pointing to at least one data block located in a storage area of the data storage system; to replace the at least one block pointer in the higher level of the multi-level tree with a predetermined data pattern identifier (ID), thereby causing the entire storage area mapped via the at least one block pointer in the higher level to be regarded by the data storage system as having a data pattern corresponding to the predetermined data pattern ID; and having replaced the at least one block pointer in the higher level of the multi-level tree with the predetermined data pattern ID, to perform block allocation in the higher level of the multi-level tree while avoiding performing block allocation in the lower level of the multi-level tree, thereby saving metadata space associated with at least the lower level of the multi-level tree.

    15. The system of claim 14 wherein the storage processing circuitry is further configured to execute the program instructions out of the memory: to set an existing attribute flag or bit associated with the at least one block pointer in the higher level to indicate that the at least one block pointer has been replaced with the predetermined data pattern ID.

    16. The system of claim 14 wherein the multi-level tree has the lower level, the higher level, and a lowest level below the lower level, wherein the lowest level of the multi-level tree is a leaf level, and wherein the storage processing circuitry is further configured to execute the program instructions out of the memory: to perform block allocation in the higher level of the multi-level tree while avoiding performing block allocation in the lower level and the leaf level of the multi-level tree, thereby saving metadata space associated with at least the lower level and the leaf level of the multi-level tree.

    17. The system of claim 14 wherein the multi-level tree has the lower level, the higher level, and a highest level above the higher level, wherein at least one block pointer in the highest level points to the at least one block pointer in the higher level, and wherein the storage processing circuitry is further configured to execute the program instructions out of the memory: to replace the at least one block pointer in the highest level of the multi-level tree with the predetermined data pattern identifier (ID), thereby causing the entire storage area mapped via the at least one block pointer in the highest level to be regarded by the data storage system as having the data pattern corresponding to the predetermined data pattern ID.

    18. The system of claim 17 wherein the storage processing circuitry is further configured to execute the program instructions out of the memory: to perform block allocation in the highest level of the multi-level tree while avoiding performing block allocation in the higher level and the lower level of the multi-level tree, thereby saving metadata space associated with at least the higher level and the lower level of the multi-level tree.

    19. A computer program product including a set of non-transitory, computer-readable media having instructions that, when executed by control circuitry of a computerized apparatus, cause the control circuitry to perform a method of handling pattern identifiers for identifying bad blocks in a data storage system, the method comprising: determining that a data block located in a storage area of the data storage system is a bad block, the storage area of the bad block being pointed to by a block pointer in a mapping layer of the data storage system; replacing the block pointer pointing to the bad block with a predetermined data pattern identifier (ID), thereby causing the entire storage area mapped via the block pointer to be regarded by the data storage system as having a data pattern corresponding to the predetermined data pattern ID; and in response to receipt of a storage IO request from a host computer to read data located in the storage area having the data pattern, returning a media error by the data storage system to the host computer.

    20. The computer program product of claim 19 wherein the method further comprises: setting an existing attribute flag or bit associated with the block pointer to indicate that the block pointer has been replaced with the predetermined data pattern ID.

    Description

    BRIEF DESCRIPTION OF THE DRAWINGS

    [0022] The foregoing and other objects, features, and advantages will be apparent from the following description of particular embodiments of the disclosure, as illustrated in the accompanying drawings, in which like reference characters refer to the same parts throughout the different views.

    [0023] FIG. 1a is a block diagram of an exemplary storage environment, in which techniques can be practiced for handling pattern identifiers in a data storage system;

    [0024] FIG. 1b is a block diagram of an exemplary namespace layer, as well as multiple exemplary layers of indirection for accessing host data in the data storage system of FIG. 1a, in which the multiple layers of indirection include a mapping layer, a virtualization layer, and a physical layer;

    [0025] FIG. 1c is a block diagram of a first exemplary hierarchy of block pointer sets configured as a multi-level tree implemented in the mapping layer of FIG. 1b;

    [0026] FIG. 1d is a block diagram of a second exemplary hierarchy of block pointer sets configured as a multi-level tree implemented in the mapping layer of FIG. 1b;

    [0027] FIG. 1e is a block diagram of a third exemplary hierarchy of block pointer sets configured as a multi-level tree implemented in the mapping layer of FIG. 1b;

    [0028] FIG. 2 is a flow diagram of an exemplary method of handling pattern identifiers for identifying bad blocks in a data storage system; and

    [0029] FIG. 3 is a flow diagram of an exemplary method of handling pattern identifiers for saving metadata space in a data storage system.

    DETAILED DESCRIPTION

    [0030] Techniques are disclosed herein for handling pattern identifiers (IDs) in a data storage system. By replacing a block pointer with a pattern ID, the disclosed techniques can identify a data block (or an indirect data block) as a bad block, without resorting to use of a separate flag or bad block (BB) bit in per-block metadata (e.g., a mapping pointer) of the data block. The disclosed techniques can also avoid waste of valuable metadata space by using pattern IDs at various levels of a multi-level tree (also referred to herein as the mapping tree), leveraging pointer granularity at lower levels and progressively higher levels of the mapping tree.

    [0031] FIG. 1a depicts an illustrative embodiment of an exemplary storage environment 100, in which techniques can be practiced for handling pattern IDs in a data storage system. As shown in FIG. 1a, the storage environment 100 can include a plurality of host computers 102.1, 102.2, . . . , 102.n and a data storage system 104, which are interconnected by a communications medium 103 that includes at least one network 108. For example, each of the plurality of host computers 102.1, . . . , 102.n may be configured as a web server computer, a file server computer, an email server computer, an enterprise server computer, or any other suitable client or server computer or computerized device. The plurality of host computers 102.1, . . . , 102.n can be configured to provide, over the network 108, storage input/output (IO) requests (e.g., small computer system interface (SCSI) commands, network file system (NFS) commands) to the data storage system 104. For example, such storage IO requests (e.g., write requests, read requests) may direct the data storage system 104 to write and/or read data blocks, data pages, data files, and/or any other suitable data elements (also referred to herein as host data) to/from logical units (LUNs), file systems, and/or any other suitable storage objects stored in association with the data storage system 104.

    [0032] The communications medium 103 can be configured to interconnect the plurality of host computers 102.1, . . . , 102.n with the data storage system 104 to enable them to communicate and exchange data and/or control signaling. As shown in FIG. 1a, the communications medium 103 is illustrated as a cloud to represent a variety of different communications topologies such as a backbone topology, a hub-and-spoke topology, a loop topology, an irregular topology, or any suitable combination thereof. As such, the communications medium 103 can include copper-based data communications devices and cabling, fiber optic devices and cabling, wireless devices, or any suitable combination thereof. Further, the communications medium 103 can be configured to support storage area network (SAN)-based communications, network attached storage (NAS)-based communications, local area network (LAN)-based communications, metropolitan area network (MAN)-based communications, wide area network (WAN)-based communications, wireless communications, distributed infrastructure communications, and/or any other suitable wired, wireless, or fiber communications.

    [0033] The data storage system 104 can include a communications interface 110, storage processing circuitry 112, and a memory 114. The communications interface 110 can include SCSI target adapters, network interface adapters, and/or any other suitable adapters for converting electronic, wireless, and/or optical signals received over the network 108 to a form suitable for use by the storage processing circuitry 112. The memory 114 can include persistent memory (e.g., flash memory, magnetic memory) and non-persistent memory (e.g., dynamic random access memory (DRAM), static random access memory (SRAM)), and can accommodate a variety of specialized software constructs, including, but not limited to, a namespace layer 116, a mapping layer 118, a virtualization layer 120, a physical layer 122, and/or any other suitable software constructs.

    [0034] The namespace layer 116 is a logical structure configured to organize storage objects such as LUNs, file systems, and/or any other suitable storage objects, accessible to the plurality of host computers 102.1, . . . , 102.n. The namespace layer 116 can track logical addresses of storage objects, such as offsets into LUNs or file system addresses. For example, if a LUN made up of one or more extents were to have a maximum size of 10 gigabytes (Gb), then the namespace layer 116 may provide a 10Gb logical address range to accommodate the LUN.

    [0035] The mapping layer 118 is a logical structure configured to map the logical addresses of the storage objects in the namespace layer 116 to virtualization structures (also referred to herein as virtual pointers) in the virtualization layer 120. To that end, the mapping layer 118 can include a hierarchy of mapping structures (also referred to herein as block pointer sets) configured as a multi-level tree (the mapping tree). Further, each block pointer set in each level (e.g., a lowest level, a mid-level, a highest level) of the mapping tree can include one or more block pointers.

    [0036] The virtualization layer 120 is a logical structure configured to provide block virtualization for purposes of supporting data deduplication, for example. The virtualization layer 120 can have an aggregation of virtual layer blocks (VLBs), each of which can include a plurality of virtual pointers (e.g., 512 virtual pointers). Further, the lowest level of the mapping tree in the mapping layer 118 can include a plurality of block pointers (also referred to herein as leaf pointers), each of which can point to one of the virtual pointers included in a respective VLB of the virtualization layer 120.

    [0037] The physical layer 122 is configured to store an aggregation of physical layer blocks (PLBs). For example, each PLB may include an aggregation of compressed data blocks, individually compressed data blocks, and/or uncompressed data blocks. Further, each virtual pointer included in a respective VLB of the virtualization layer 120 may point to a data block in a respective PLB of the physical layer 122. It is noted that, although the physical layer 122 is described herein using the term physical, an underlying storage drive array 106 (see FIG. 1a) is typically responsible for the actual, physical storage of the host data.

    [0038] The storage drive array 106 can include a plurality of storage drives 124.1, 124.2, . . . , 124.m (also referred to herein as the physical drives), such as magnetic disk drives, electronic flash drives, optical drives, and/or any other suitable physical drives. The storage drive array 106 can be locally attached to an IO channel of the data storage system 104, while also being accessible over the network 108.

    [0039] The storage processing circuitry 112 can include one or more physical storage processors or engines (e.g., running specialized software), data movers, director boards, blades, IO modules, storage drive controllers, switches, and/or any other suitable computer hardware or combination thereof. For example, the storage processing circuitry 112 may process storage IO requests (e.g., write requests, read requests) provided by the respective host computers 102.1, . . . , 102.n over the network 108, and store host data in a redundant array of independent (or inexpensive) disks (RAID) environment implemented by the storage drive array 106.

    [0040] In the context of the storage processing circuitry 112 being implemented using one or more processors running specialized software, a computer program product can be configured to deliver all or a portion of the software constructs to the respective processor(s). Such a computer program product can include one or more non-transient computer-readable storage media, such as a magnetic disk, a magnetic tape, a compact disk (CD), a digital versatile disk (DVD), an optical disk, a flash drive, a solid state drive (SSD), a secure digital (SD) chip or device, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), and so on. The non-transient computer-readable storage media can be encoded with sets of instructions that, when executed by the respective processor(s), perform the techniques disclosed herein.

    [0041] FIG. 1b depicts the namespace layer 116, the mapping layer 118, the virtualization layer 120, and the physical layer 122 implemented in the data storage system 104 of FIG. 1a. As shown in FIG. 1b, the namespace layer 116 can be configured to organize at least one LUN 126, and to track logical addresses of the LUN 126 such as a logical address 132.0, a logical address 132.1, and so on, up to at least a logical address 132.p. The mapping layer 118 can include an array of block pointer sets 134 configured as a mapping tree, the lowest level of which can include a leaf pointer 140.0, a leaf pointer 140.1, and so on, up to at least a leaf pointer 140.q. The virtualization layer 120 can include an aggregation of VLBs such as a VLB 128, which can include a virtual pointer 136.0, a virtual pointer 136.1, and so on, up to at least a virtual pointer 136.r. The physical layer 122 can include an aggregation of PLBs such as a PLB 130, which can include a data block 138.0, a data block 138.1, and so on, up to at least a data block 138.s.

    [0042] During operation, the data storage system 104 of FIG. 1a can employ a pattern ID to identify a data block (or an indirect data block) as a bad block, without resorting to the use of a separate flag or bad block (BB) bit in per-block metadata (e.g., a mapping pointer) of the data block. The data storage system 104 can also avoid waste of valuable metadata space by using pattern IDs at various levels of the mapping tree, leveraging pointer granularity at lower levels and progressively higher levels of the mapping tree.

    [0043] The disclosed techniques for handling pattern IDs in a data storage system will be further understood with reference to the following illustrative example, as well as FIGS. 1c, 1d, and 1e. In this example, the mapping layer 118 (see FIG. 1c) includes a hierarchy of block pointer sets configured as a 3-level tree (the mapping tree), which includes a lowest level (also referred to herein as the leaf level) 118.0, a mid-level 118.1, and a highest level 118.2. As shown in FIG. 1c, the highest level 118.2 includes a block pointer set 142, the mid-level 118.1 includes a block pointer set 144.0 and a block pointer set 144.1, and the leaf level 118.0 includes a leaf pointer 140.0, a leaf pointer 140.1, a leaf pointer 140.2, and a leaf pointer 140.3. The mapping layer 118 is configured to map logical addresses of the LUN 126 (e.g., the logical address 132.0, the logical address 132.1, the logical address 132.2, the logical address 132.3) to virtual pointers of the VLB 128 (e.g., the virtual pointer 136.0, the virtual pointer 136.1, the virtual pointer 136.2, the virtual pointer 136.3). For example, the logical addresses 132.0, 132.1, 132.2, 132.3 may correspond to contiguous offsets into the LUN 126.

    [0044] As further shown in FIG. 1c, in the highest level 118.2, the block pointer set 142 includes at least two block pointers with associated attribute flags or bits, namely, a block pointer 146 with an associated attribute P 150, and a block pointer 148 with an associated attribute P 152. Further, in the mid-level 118.1, the block pointer set 144.0 includes at least two block pointers with associated attributes, namely, a block pointer 154 with an associated attribute P 158, and a block pointer 156 with an associated attribute P 160. Likewise, in the mid-level 118.1, the block pointer set 144.1 includes at least two block pointers with associated attributes, namely, a block pointer 162 with an associated attribute P 166, and a block pointer 164 with an associated attribute P 168. In addition, in the leaf level 118.0, the leaf pointer 140.0 includes a block pointer 170 with an associated attribute P 172, and the leaf pointer 140.1 includes a block pointer 174 with an associated attribute P 176. However, in the leaf level 118.0, a block pointer (not shown) previously included in the leaf pointer 140.2 has been replaced with a pattern ID (BB) 178 with an associated attribute P 180. Likewise, in the lowest level 118.0, a block pointer (not shown) previously included in the leaf pointer 140.3 has been replaced with a pattern ID 182 with an associated attribute P 184.

    [0045] It is noted that the mapping tree in the mapping layer 118 of FIG. 1c can be an extremely large structure, with each block pointer set including many block pointers (e.g., 512). Further, such a mapping tree can include one or more additional layers lower than the level 118.0, as well as one or more additional layers higher than the level 118.2. Each block pointer included in the block pointer sets 142, 144.0, 144.1 and the leaf pointers 140.0-140.3 can include one or more attributes in addition to the attributes designated as P in FIG. 1c.

    [0046] In this example, the block pointer 148 of the block pointer set 142 points to the block pointer set 144.0. Further, the block pointer 154 and the block pointer 156 (each included in the block pointer set 144.0) point to the leaf pointer 140.1 and the leaf pointer 140.0, respectively. In addition, the block pointer 170 included in the leaf pointer 140.0 points to the virtual pointer 136.0 of the VLB 128, and the block pointer 174 included in the leaf pointer 140.1 points to the virtual pointer 136.1 of the VLB 128. For example, in accordance with the mapping tree of FIG. 1c, the logical address 132.0 of the LUN 126 may be mapped to the virtual pointer 136.0 via the block pointer 148, the block pointer 156, and the block pointer 170. Further, the logical address 132.1 of the LUN 126 may be mapped to the virtual pointer 136.1 via the block pointer 148, the block pointer 154, and the block pointer 174. It is noted that other mappings of the logical addresses 132.0, 132.1 of the LUN 126 to the virtual pointers 136.0, 136.1 (or the virtual pointers 136.2, 136.3) of the VLB 128 are possible.

    [0047] Further, in this example, the block pointer 146 of the block pointer set 142 points to the block pointer set 144.1. In addition, the block pointer 162 and the block pointer 164 (each included in the block pointer set 144.1) point to the leaf pointer 140.3 and the leaf pointer 140.2, respectively.

    [0048] To avoid the use of a separate flag or BB-bit in the per-block metadata (e.g., a mapping pointer) of a data block to identify the data block as a bad block, the block pointer (not shown) previously included in the leaf pointer 140.2 has been replaced with the pattern ID (BB) 178, and the associated attribute P 180 has been set (as indicated in bold font) to indicate such replacement. For example, the pattern ID (BB) 178 may correspond to all 1's, all 0's, 0xDEADBEEF, or any other suitable special data pattern for identifying a bad block. Having replaced the previous block pointer with the pattern ID (BB) 178, the entire storage area mapped via the block pointer 146 and block pointer 164 is regarded by the data storage system 104 as having the same special data pattern (as indicated by the pattern ID (BB) 178), so long as the special data pattern is boundary aligned with the mapped storage area. Further, in the event a storage IO request is received over the network 108 from one of the host computers 102.1, 102.2, . . . , 102.n to read data located in the storage area having the special data pattern (as indicated by the pattern ID (BB) 178), the storage area can be recognized by the data storage system 104 as corresponding to a bad block, and a media error can then be returned over the network 108 to the respective host computer.

    [0049] Data patterns (e.g., all 1's, all 0's, 0xDEADBEEF, etc.) can also be employed to leverage the pointer granularity at the leaf level 118.0, as well as the mid-level 118.1 and the highest level 118.2 of the mapping tree, thereby avoiding waste of valuable metadata space. For example, the pointer granularity at the leaf level 118.0 may be such that each leaf pointer 140.0-140.3 maps to a first predetermined amount of contiguous storage area, such as 4 kilobytes (Kb) or any other suitable amount of storage area. Replacing the block pointer (not shown) previously included in the leaf pointer 140.3 with the pattern ID 182, and setting the associated attribute P 184 (as indicated in bold font) to indicate such replacement can therefore cause the entire storage area of 4 Kb mapped via the block pointer 146 and block pointer 162 to be regarded by the data storage system 104 as having the same data pattern (as indicated by the pattern ID 182), so long as the data pattern is boundary aligned with the mapped storage area.

    [0050] Turning to FIG. 1d, in the mid-level 118.1, the block pointer 154 previously included in the block pointer set 144.0 has been replaced with a pattern ID 155, and the associated attribute P 158 has been set (as indicated in bold font) to indicate such replacement. In similar fashion, the block pointer 156 previously included in the block pointer set 144.0 can also be replaced with a pattern ID 157, and the associated attribute P 160 can be set (as indicated in bold font) to indicate such replacement. For example, for the 3-level tree of FIG. 1d, the pointer granularity at the mid-level 118.1 may be such that each block pointer set 144.0, 144.1 maps to a second predetermined amount of contiguous storage area, such as 2 megabytes (Mb) or any other suitable amount of storage area. Further, the pattern ID 155, as well as the pattern ID 157, may correspond to the same data pattern (e.g., all 1's, all 0's, 0xDEADBEEF, etc.). Replacing each of the block pointers 154, 156 previously included in the block pointer set 144.0 with the pattern IDs 155, 157, respectively, and setting the associated attributes P 158, 160 (as indicated in bold font) to indicate such replacements can therefore cause the entire storage area of 2 Mb mapped via the block pointer 148 to be regarded by the data storage system 104 as having the same data pattern (as indicated by the pattern IDs 155, 157), so long as the respective data patterns are boundary aligned with the mapped storage area. Further, the data storage system 104 need only perform block allocation (i.e., the assignment or allocation of data blocks to the logical addresses of the LUN 126) at the mid-level 118.1 and the highest level 118.2 of the mapping tree, not at the leaf level 118.0 of the mapping tree, thereby saving valuable metadata space that might otherwise have been used for performing such block allocation.

    [0051] Turning now to FIG. 1e, in the highest-level 118.2, the block pointer 146 previously included in the block pointer set 142 has been replaced with a pattern ID 147, and the associated attribute P 150 has been set (as indicated in bold font) to indicate such replacement. In similar fashion, the block pointer 148 previously included in the block pointer set 142 can also be replaced with a pattern ID 149, and the associated attribute P 152 can be set (as indicated in bold font) to indicate such replacement. For example, for the 3-level tree of FIG. 1e, the pointer granularity at the highest-level 118.2 may be such that the block pointer set 142 maps to a third predetermined amount of contiguous storage area, such as 512 gigabytes (Gb) or any other suitable amount of storage area. Further, the pattern ID 147, as well as the pattern ID 149, may correspond to the same data pattern (e.g., all 1's, all 0's, 0xDEADBEEF, etc.). Replacing the block pointers 146, 148 previously included in the block pointer set 142 with the pattern IDs 147, 149, respectively, and setting the associated attributes P 150, 152 (as indicated in bold font) to indicate such replacements can therefore cause the entire storage area of 512Gb mapped via the block pointer set 142 to be regarded by the data storage system 104 as having the same data pattern (as indicated by the pattern IDs 147, 149), so long as the respective data patterns are boundary aligned with the mapped storage area. Further, the data storage system 104 need only perform block allocation at the highest level 118.2 of the mapping tree, not at the mid-level 118.1 or the leaf level 118.0 of the mapping tree, again saving valuable metadata space that might otherwise have been used for performing such block allocation. It is noted that, for multi-level trees with more than 3-levels, each block pointer at the highest level can map to a predetermined amount of contiguous storage area up to 256 terabytes (Tb) or more, as technology allows.

    [0052] An exemplary method of handling pattern IDs for identifying bad blocks in a data storage system is described below with reference to FIG. 2. As depicted in block 202, a determination is made that a data block located in a storage area of the data storage system is a bad block, the storage area of the bad block being pointed to by a block pointer in a mapping layer of the data storage system. As depicted in block 204, the block pointer pointing to the bad block is replaced with a predetermined data pattern ID, thereby causing the entire storage area mapped via the block pointer to be regarded by the data storage system as having a data pattern corresponding to the predetermined data pattern ID. As depicted in block 206, in response to receipt of a storage IO request from a host computer to read data located in the storage area having the data pattern, a media error is returned by the data storage system to the host computer.

    [0053] An exemplary method of handling pattern IDs for saving metadata space in a data storage system is described below with reference to FIG. 3. As depicted in block 302, multiple layers of indirection for accessing host data are implemented in the data storage system, the multiple layers of indirection including at least a mapping layer having a multi-level tree with a lower level and a higher level, at least one block pointer in the higher level pointing to at least one block pointer in the lower level, and the at least one block pointer in the lower level pointing to at least one data block located in a storage area of the data storage system. As depicted in block 304, the at least one block pointer in the higher level of the multi-level tree is replaced with a predetermined data pattern ID, thereby causing the entire storage area mapped via the at least one block pointer in the higher level to be regarded by the data storage system as having a data pattern corresponding to the predetermined data pattern ID. As depicted in block 306, having replaced the at least one block pointer in the higher level of the multi-level tree with the predetermined data pattern ID, block allocation is performed in the higher level of the multi-level tree while avoiding performing block allocation in the lower level of the multi-level tree, thereby saving metadata space associated with at least the lower level of the multi-level tree.

    [0054] While various embodiments of the disclosure have been particularly shown and described, it will be understood by those skilled in the art that various changes in form and/or details may be made herein without departing from the scope of the disclosure, as defined by the appended claims.