# Patent

## Title
System and method for volume block number to disk block number mapping

## Abstract

The present invention provides a system and method for virtual block numbers (VBNs) to disk block number (DBN) mapping that may be utilized for both single and/or multiple parity based redundancy systems. Following parity redistribution, new VBNs are assigned to disk blocks in the newly added disk and disk blocks previously occupied by parity may be moved to the new disk.

## Background
RELATED APPLICATION
The present application is a continuation of U.S. patent application Ser. No. 12/105,609, entitled “SYSTEM AND METHOD FOR VOLUME BLOCK NUMBER TO DISK BLOCK NUMBER MAPPING,” filed on Apr. 18, 2008 by Atul Goel, the contents of which are incorporated by reference herein in their entirety.


FIELD OF THE INVENTION
The present invention relates to storage arrays of storage systems and, more specifically, to mapping volume block numbers to disk block numbers in a storage device array, such as a disk array of a storage system.
BACKGROUND OF THE INVENTION
A storage system typically comprises one or more storage devices into which information may be entered, and from which information may be obtained, as desired. The storage system may be implemented in accordance with a variety of storage architectures including, but not limited to, a network-attached storage environment, a storage area network and a disk assembly directly attached to a client or host computer. The storage devices are typically disk drives, organized as one or more disk arrays, wherein the term “disk” commonly describes a self-contained rotating magnetic media storage device. The term “disk” in this context is synonymous with hard disk drive (HDD) or direct access storage device (DASD).
Storage of information on the disk array is illustratively implemented as one or more storage volumes of physical disks, defining an overall logical arrangement of storage space. The disks within a volume are typically organized as one or more groups, wherein each group is operated as a Redundant Array of Independent (or Inexpensive) Disks (RAID) or other suitable redundancy technique. Most RAID implementations enhance the reliability/integrity of data storage through the redundant writing of data “stripes” across a given number of physical disks in the RAID group, and the appropriate storing of redundant information with respect to the striped data. The redundant information enables recovery of data lost when a storage device fails.
In the operation of a disk array, it is anticipated that a disk can fail. A goal of a high performance storage system is to make the mean time to data loss (MTTDL) as long as possible, preferably much longer than the expected service life of the system. Data can be lost when one or more disks fail, making it impossible to recover data from the device. Typical schemes to avoid loss of data include mirroring, backup and/or parity protection. Mirroring is an expensive solution in terms of consumption of storage resources, such as disks. Backup does not protect data modified since the backup was created. Parity schemes are common because they provide a redundant encoding of the data that allows for a single erasure (loss of one disk) with the addition of just one disk drive to the system.
Parity protection is used in computer systems to protect against loss of data on a storage device, such as a disk. A parity value may be computed by summing (usually modulo 2) data of a particular word size (usually one bit) across a number of similar disks holding different data and then storing the results on an additional similar disk. That is, parity may be computed on vectors 1-bit wide, composed of bits in corresponding positions on each of the disks. When computed on vectors 1-bit wide, the parity can be either the computed sum or its complement; these are referred to as even and odd parity respectively. Addition and subtraction on 1-bit vectors are both equivalent to exclusive-OR (XOR) logical operations. The data is then protected against the loss of any one of the disks, or of any portion of the data on any one of the disks. If the disk storing the parity is lost, the parity can be regenerated from the data. If one of the data disks is lost, the data can be regenerated by adding the contents of the surviving data disks together and then subtracting the result from the stored parity.
Typically, the disks are divided into parity groups, each of which comprises one or more data disks and a parity disk. A parity set is a set of blocks, including several data blocks and one parity block, where the parity block is the XOR of all the data blocks. A parity group is a set of disks from which one or more parity sets are selected. The disk space is divided into stripes, with each stripe containing one block from each disk. The blocks of a stripe are usually at the same locations on each disk in the parity group. Within a stripe, all but one block are blocks containing data (“data blocks”) and one block is a block containing parity (“parity block”) computed by the XOR of all the data. If the parity blocks are all stored on one disk, thereby providing a single disk that contains all (and only) parity information, a RAID-4 implementation is provided. If the parity blocks are contained within different disks in each stripe, usually in a rotating pattern, then the implementation is RAID-5. The term “RAID” and its various implementations are well-known and disclosed in A Case for Redundant Arrays of Inexpensive Disks (RAID), by D. A. Patterson, G. A. Gibson and R. H. Katz, Proceedings of the International Conference on Management of Data (SIGMOD), June 1988 and U.S. Pat. No. 6,993,701 issued on Jan. 31, 2006 for a ROW-DIAGONAL PARITY TECHNIQUE FOR ENABLING EFFICIENT RECOVERY FROM DOUBLE FAILURES IN A STORAGE ARRAY, by Peter Corbett, et al.
As used herein, the term “encoding” means the computation of a redundancy value over a predetermined subset of data blocks, whereas the term “decoding” means the reconstruction of a data or parity block by using a subset of data blocks and redundancy values. If one disk fails in the parity group, the contents of that disk can be decoded (reconstructed) on a spare disk or disks by adding all the contents of the remaining data blocks and subtracting the result from the parity block. Since two's complement addition and subtraction over 1-bit fields are both equivalent to XOR operations, this reconstruction consists of the XOR of all the surviving data and parity blocks. Similarly, if the parity disk is lost, it can be recomputed in the same way from the surviving data.
A noted disadvantage of such RAID implementations, particularly a RAID implementation utilizing distributed parity, e.g., RAID 5, involves a mapping technique of logical storage blocks identified by logical block numbers, e.g., volume block numbers (VBN) to physical storage block locations on disk identified by disk block numbers (DBN). The VBNs are typically utilized by a high-level module, such as a file system, executing on the storage system, while the DBNs are typically utilized by a low-level module, such as a RAID and/or disk driver module of the system. The VBNs represent logical block locations in a logical VBN storage space typically spanning multiple disks or other physical storage devices and the DBNs represent physical block locations in a physical DBN storage space. The noted disadvantage arises as each disk of the RAID implementation stores both data and parity blocks, and may be exacerbated when an objective of the implementation is to support seamless disk additions. Since file systems generally only read/write data blocks (i.e., parity blocks are “hidden” from the file system), the technique utilized to map logical blocks to their physical disk block locations must be sufficiently “intelligent” to skip the parity blocks. In addition, seamless disk additions require that the mapping techniques handle any incremental growth of the VBN and DBN storage spaces. To ensure a balanced/uniform distribution of parity blocks across all disks even after a disk addition (single or multiple), some physical block locations (i.e., DBNs) occupied by parity must now store user data instead. As a result, the mapping technique must be able to handle the conversion of parity blocks to data blocks, which may be triggered, e.g., as a result of the relocation of parity during disk addition. Conventional distributed parity architectures such as RAID 5 have generally been configured for file systems that utilize a flat, one-dimensional address storage space. The VBN to DBN mapping techniques for these configurations have typically been simple, as these techniques do not support disk additions. Those techniques that do support disk additions typically resort to extremely expensive parity re-computation and/or block copy operations.
However, disk topology aware file systems, such as the Write Anywhere File Layout (WAFL®) file system available from NetApp of Sunnyvale, Calif., may exploit knowledge of the layout of a disk array to implement highly efficient write operations. Typically, disk topology aware file systems utilize RAID 4 implementations that store the parity on dedicated disk drives, thereby obviating the need for the file system to be aware of the dedicated parity disks. RAID 4 implementation works because a disk topology aware file system has the advantage of being able to implement efficient write operations (e.g. efficient stripe updates) where the cost of updating parity is amortized over many updates to data blocks in nearby stripes.
A distributed parity organization, on the other hand, e.g. RAID-5, has the advantage of providing higher IOPs since all disk spindles are available for read operations. The obvious approach for implementing a distributed parity layout in a disk-topology-aware filesystem is to include parity blocks within the VBN space. With this scheme expansion by disk addition is easy. However, this approach suffers from many shortcomings. For example, this approach limits the VBN space which can be used for client data since some part of the address space is consumed by parity, thereby restricting the size of the maximum aggregate or flexvol which can be created. Secondly, filesystem management becomes complicated since constructs like allocation maps, active map, summary map, etc. must now be aware of parity blocks and must appropriately account for them when processing user operations. Finally, backup operations which use snapshots as the underlying mechanism require identical source destination geometries, thus severely limiting configurations.
SUMMARY OF THE INVENTION
The present invention overcomes the disadvantages of the prior art to providing a system and method for volume block number (VBN) to disk block number (DBN) mapping that may be utilized for both single and/or multiple parity based redundancy systems. Illustratively one of a plurality of parity distribution techniques is utilized to determine a new parity layout of a disk array organized into one or more Redundant Array of Inexpensive Disk (RAID) groups as the result of adding disks to a RAID group. Following parity (re)distribution, new VBNs are assigned to DBNs in the newly added disk and DBNs on older drives which stored parity blocks that were relocated to the new disk. By utilizing the programmatic assignment of VBNs, the present invention obviates the need to use persistently stored mapping/translation tables for each VBN/DBN relationship. In an illustrative embodiment of the present invention, flexible volumes stored within aggregates are utilized. In such embodiments, a physical volume block number (PVBN) may be utilized in place of a VBN. As such, the terms PVBNs and VBNs may be used interchangeably in describing the present invention.
The present invention permits the calculation of a PVBN value that is identified by a given DBN by first computing a table relative PVBN and identifying a logical disk number. The start (i.e., PVBN value of the first block) of the PVBN range, corresponding to the logical disk number, containing the desired PVBN is identified and the PVBN value is computed by adding a striped value to the start of the identified PVBN range.
Similarly, given a PVBN, the corresponding DBN may be identified by first computing a logical disk number for the PVBN and then computing a stripe by, e.g., subtracting a start of a PVBN range from the given PVBN. The PVBN is then converted to a table relative PVBN and the disk that stores the DBN is identified. The DBN on the identified disk is then identified as the block represented by the computed stripe on the identified disk. More generally, the present invention enables improved VBN-DBN mapping functionality to improve system performance and to enable dynamic disk additions to disk arrays utilizing distributed parity.
The present invention enables seamless parity block reallocations due to, e.g., a disk addition. The present invention also ensures that the arrangement of VBNs is computed in a manner such that the set of VBNs within a stripe is the same as the set which would be formed when using a dedicated parity organization, e.g., RAID 4. This holds true both with the initial organization at the moment a raidgroup is created as well as subsequent to expansion via disk additions. This property ensures that the filesystem can be oblivious to the placement of parity blocks and/or the redundancy level (e.g., single or double parity) of the underlying RAID array and can treat both RAID 4 and distributed parity organization in an identical manner. This greatly simplifies filesystem design and also provides a great deal of flexibility in configuring the underlying RAID array. Furthermore, by obviating the need for a static mapping table, the present invention gives greater flexibility for disk topology aware file systems.



BRIEF DESCRIPTION OF THE DRAWINGS
The above and further advantages of the invention may be better understood by referring to the following description in conjunction with the accompanying drawings in which like reference numerals indicate identical or functionally similar elements:
FIG. 1 is a schematic block diagram of a storage system environment including a storage system in accordance with an illustrative embodiment of the present invention;
FIG. 2 is a schematic block diagram of an exemplary storage operating system for use on a storage system in accordance with an illustrative embodiment of the present invention;
FIG. 3 is a schematic block diagram of an exemplary inode in accordance with an illustrative embodiment of the present invention;
FIG. 4 is a schematic block diagram of an exemplary buffer tree in accordance with an illustrative embodiment of the present invention;
FIG. 5 is a schematic block diagram of an exemplary buffer tree in accordance with an illustrative embodiment of the present invention;
FIG. 6 is a schematic block diagram of a file system layout in accordance with an illustrative embodiment of the present invention;
FIG. 7 is a schematic block diagram of an exemplary on-disk layout in accordance with an illustrative embodiment of the present invention;
FIG. 8 is a schematic block diagram of a mapping data structure in accordance with an illustrative embodiment of the present invention;
FIG. 9 is a schematic block diagram illustrating VBN allocation in a single parity environment in accordance with an illustrative embodiment of the present invention;
FIG. 10 is a schematic block diagram illustrating VBN relocation in response to a disk addition in accordance with an illustrative embodiment of the present invention;
FIG. 11 is a schematic block diagram illustrating VBN relocation in response to a disk addition in accordance with an illustrative embodiment of the present invention;
FIG. 12 is a schematic block diagram illustrating VBN assignment in a double parity environment in accordance with an illustrative embodiment of the present invention;
FIG. 13 is a schematic block diagram illustrating VBN assignment in accordance with an illustrative embodiment of the present invention;
FIG. 14 is a schematic block diagram of a mapping table in accordance with an illustrative embodiment of the present invention;
FIG. 15 is a schematic block diagram illustrating an exemplary 5 disk RAID array that stores two repetitions of mapping table in accordance with an illustrative embodiment of the present invention;
FIG. 16 is a flowchart detailing the steps of a procedure for determining a VBN given a particular DBN in accordance with an illustrative embodiment of the present invention; and
FIG. 17 is a flowchart detailing the steps of a procedure for determining a DBN given a particular VBN in accordance with an illustrative embodiment of the present invention.



DETAILED DESCRIPTION OF THE ILLUSTRATIVE EMBODIMENTS
The present invention provides a system and method for volume block number (VBN) to disk block number (DBN) mapping that may be utilized for both single and/or multiple parity based redundancy systems. Illustratively one of a plurality of parity distribution techniques is utilized to determine a new parity layout of a disk array organized into one or more Redundant Array of Inexpensive Disk (RAID) groups as the result of adding disks to a RAID group. Following parity (re)distribution, new VBNs are assigned to DBNs in the newly added disk and DBNs on older drives which stored parity blocks that were relocated to the new disk. By utilizing the programmatic assignment of VBNs, the present invention obviates the need to use persistently stored mapping/translation tables for each VBN/DBN relationship. In an illustrative embodiment of the present invention, flexible volumes stored within aggregates are utilized. In such embodiments, a physical volume block number (PVBN) may be utilized in place of a VBN. As such, the terms PVBNs and VBNs may be used interchangeably in describing the present invention.
The present invention permits the calculation of a PVBN value that is identified by a given DBN by first computing a table relative PVBN and identifying a logical disk number. The start (i.e., PVBN value of the first block) of the PVBN range, corresponding to the logical disk number, containing the desired PVBN is identified and the PVBN value is computed by adding a striped value to the start of the identified PVBN range.
Similarly, given a PVBN, the corresponding DBN may be identified by first computing a logical disk number for the PVBN and then computing a stripe by, e.g., subtracting a start of a PVBN range from the given PVBN. The PVBN is then converted to a table relative PVBN and the disk that stores the DBN is identified. The DBN on the identified disk is then identified as the block represented by the computed stripe on the identified disk. More generally, the present invention enables improved VBN-DBN mapping functionality to improve system performance and to enable dynamic disk additions to disk arrays utilizing distributed parity.
The present invention enables seamless parity block reallocations due to, e.g., a disk addition. The present invention also ensures that the arrangement of VBNs is computed in a manner such that the set of VBNs within a stripe is the same as the set which would be formed when using a dedicated parity organization, e.g., RAID 4. This holds true both with the initial organization at the moment a raidgroup is created as well as subsequent to expansion via disk additions. This property ensures that the filesystem can be oblivious to the placement of parity blocks and/or the redundancy level (e.g., single or double parity) of the underlying RAID array and can treat both RAID 4 and distributed parity organization in an identical manner. This greatly simplifies filesystem design and also provides a great deal of flexibility in configuring the underlying RAID array. Furthermore, by obviating the need for a static mapping table, the present invention gives greater flexibility for disk topology aware file systems.
A. Storage System Environment
FIG. 1 is a schematic block diagram of an environment 100 including a storage system 120 that may be advantageously used with the present invention. The inventive technique described herein may apply to any type of special-purpose (e.g., file server or filer) or general-purpose computer, including a standalone computer or portion thereof, embodied as or including a storage system 120. Moreover, the teachings of this invention can be adapted to a variety of storage system architectures including, but not limited to, a network-attached storage environment, a storage area network and a disk assembly directly-attached to a client or host computer. The term “storage system” should therefore be taken broadly to include such arrangements in addition to any subsystems configured to perform a storage function and associated with other equipment or systems.
In the illustrative embodiment, the storage system 120 comprises a processor 122, a memory 124, a network adapter 125 and a storage adapter 128 interconnected by a system bus 132. The memory 124 comprises storage locations that are addressable by the processor and adapters for storing software program code and data structures associated with the present invention. The processor and adapters may, in turn, comprise processing elements and/or logic circuitry configured to execute the software code and manipulate the data structures. A storage operating system 200, portions of which are typically resident in memory and executed by the processing elements, functionally organizes the system 120 by, inter alia, invoking storage operations executed by the storage system. It will be apparent to those skilled in the art that other processing and memory means, including various computer readable media, may be used for storing and executing program instructions pertaining to the inventive technique described herein.
The network adapter 125 comprises a plurality of ports adapted to couple the storage system 120 to one or more clients 110 over point-to-point links, wide area networks, virtual private networks implemented over a public network (Internet) or a shared local area network (hereinafter “network 105”). The network adapter 125 thus may comprise the mechanical, electrical and signaling circuitry needed to connect the storage system to the network 105, such as a computer network. Illustratively, the network 105 may be embodied as an Ethernet network or a Fibre Channel (FC) network. Each client 110 may communicate with the storage system 120 over network 105 by exchanging discrete frames or packets of data according to pre-defined protocols, such as TCP/IP.
The storage adapter 128 cooperates with the storage operating system 200 executing on the system 120 to access information requested by a user (or client). The information may be stored on any type of attached array of writeable storage device media such as video tape, optical, DVD, magnetic tape, bubble memory, electronic random access memory (including Flash memory), micro-electro mechanical and any other similar media adapted to store information, including data and parity information. However, as illustratively described herein, the information is preferably stored on disks 150, such as HDD and/or DASD, of array 140. The storage adapter includes input/output (I/O) interface circuitry that couples to the disks over an I/O interconnect arrangement, such as a conventional high-performance, FC serial link topology.
Storage of information on array 140 is preferably implemented as one or more storage “volumes” that comprise a cluster of physical storage disks 150, defining an overall logical arrangement of disk space. Each volume is generally, although not necessarily, associated with its own file system. The disks within a volume/file system are typically organized as one or more groups, wherein each group is operated as a Redundant Array of Independent (or Inexpensive) Disks (RAID). Most RAID implementations enhance the reliability/integrity of data storage through the redundant writing of data “stripes” across a given number of physical disks in the RAID group, and the appropriate storing of parity information with respect to the striped data.
B. Storage Operating System
To facilitate access to the disks, the storage operating system 200 implements a write-anywhere file system that cooperates with virtualization modules to provide a system that “virtualizes” the storage space provided by disks. The file system logically organizes the information as a hierarchical structure of named data containers, such as directory and file objects (hereinafter “directories” and “files”) on the disks. Each “on-disk” file may be implemented as set of disk blocks configured to store information, such as data, whereas the directory may be implemented as a specially formatted file in which names and links to other files and directories are stored. The virtualization system allows the file system to further logically organize information as a hierarchical structure of named data containers, such as virtual disk objects (vdisks) on the disks, thereby providing an integrated NAS and SAN system approach to storage by enabling file-based (NAS) access to the files and directories, while further enabling block-based (SAN) access to the vdisks on a file-based storage platform.
In the illustrative embodiment, the storage operating system is preferably the NetApp® Data ONTAP® operating system available from NetApp, Inc., Sunnyvale, Calif. that implements a Write Anywhere File Layout (WAFL®) file system. However, it is expressly contemplated that any appropriate storage operating system, including a write in-place file system, may be enhanced for use in accordance with the inventive principles described herein. As such, where the term “Data ONTAP” is employed, it should be taken broadly to refer to any storage operating system that is otherwise adaptable to the teachings of this invention.
As used herein, the term “storage operating system” generally refers to the computer-executable code operable on a computer that manages data access and may, in the case of a storage system, implement data access semantics, such as the Data ONTAP® storage operating system, which is implemented as a microkernel. The storage operating system can also be implemented as an application program operating over a general-purpose operating system, such as UNIX® or Windows XP®, or as a general-purpose operating system with configurable functionality, which is configured for storage applications as described herein.
In addition, it will be understood to those skilled in the art that the inventive technique described herein may apply to any type of special-purpose (e.g., storage serving appliance) or general-purpose computer, including a standalone computer or portion thereof, embodied as or including a storage system. Moreover, the teachings of this invention can be adapted to a variety of storage system architectures including, but not limited to, a network-attached storage environment, a storage area network and disk assembly directly-attached to a client or host computer. The term “storage system” should therefore be taken broadly to include such arrangements in addition to any subsystems configured to perform a storage function and associated with other equipment or systems.
FIG. 2 is a schematic block diagram of the storage operating system 200 that may be advantageously used with the present invention. The storage operating system comprises a series of software layers organized to form an integrated network protocol stack or, more generally, a multi-protocol engine that provides data paths for clients to access information stored on the multi-protocol storage system using block and file access protocols. The protocol stack includes a media access layer 210 of network drivers (e.g., gigabit Ethernet drivers) that interfaces to network protocol layers, such as the IP layer 212 and its supporting transport mechanisms, the TCP layer 214 and the User Datagram Protocol (UDP) layer 216. A file system protocol layer provides multi-protocol file access and, to that end, includes support for the DAFS protocol 218, the Network File System (NFS) protocol 220, the Common Internet File System (CIFS) protocol 222 and the Hypertext Transfer Protocol (HTTP) protocol 224. A VI layer 226 implements the VI architecture to provide direct access transport (DAT) capabilities, such as RDMA, as required by the DAFS protocol 218.
An iSCSI driver layer 228 provides block protocol access over the TCP/IP network protocol layers, while a FC driver layer 230 operates with the network adapter to receive and transmit block access requests and responses to and from the storage system. The FC and iSCSI drivers provide FC-specific and iSCSI-specific access control to the luns (vdisks) and, thus, manage exports of vdisks to either iSCSI or FCP or, alternatively, to both iSCSI and FCP when accessing a single vdisk on the storage system. In addition, the storage operating system includes a disk storage layer 240, such as a RAID system, that implements a disk storage protocol, such as a RAID protocol, and a disk driver layer 250 that implements a disk access protocol such as, e.g., a SCSI protocol.
In an illustrative embodiment of the present invention, the disk storage layer (e.g., RAID system 240) implements the novel VBN-DBN mapping technique. Illustratively, the disk storage layer 240 exports disk topology information, e.g., a mapping of VBN to DBN storage spaces to the virtualization system 255 for use by the file system 265. In the exemplary embodiment where the file system 265 comprises a disk topology aware file system, such as the above-mentioned WAFL file system, the file system 265 utilizes the exported disk topology information to improve write operations. It should be noted that the present invention may be utilized with file systems that are not disk topology aware. Furthermore, it should be noted that the implementation of the VBN-DBN mapping technique of the present invention may be implemented in other modules of the storage operating system 200. As such the description of the VBN-DBN mapping being implemented by disk storage layer 240 should be taken as exemplary only. It should be further noted that while the present invention is written in terms of VBN (or PVBN) to DBN mapping, the principles of the present invention may be utilized with any logical block to physical disk block mapping arrangement. As such, the description of VBN (PVBN) to DBN mapping should be taken as exemplary only. Illustratively, the disk storage module 240 includes one or more exemplary mapping data structures 800, described further below in reference to FIG. 8. The mapping data structure 800 is utilized by the disk storage module 240 to store information for use in performing the novel VBN-DBN mapping in accordance with an illustrative embodiment of the present invention.
Furthermore, in an illustrative embodiment of the present invention, the disk storage module 240 includes a VBN range list data structure 280, a VBN range index data structure 285 and a raidmap data structure 290. The VBN range list data structure 280 illustratively contains a list of each VBN range stored on a RAID group. The VBN range index data structure 285 contains an index that maps logical block numbers to a VBN range within the VBN range data structure 280. The raidmap index data structure 290 contains an index that maps disk numbers to raidmaps that identify physical disks.
Bridging the disk software layers with the integrated network protocol stack layers is a virtualization system 255 that is implemented by a file system 265 interacting with virtualization modules illustratively embodied as, e.g., vdisk module 270 and SCSI target module 260. It should be noted that the vdisk module 270, the file system 265 and SCSI target module 260 can be implemented in software, hardware, firmware, or a combination thereof. The vdisk module 270 interacts with the file system 265 to enable access by administrative interfaces in response to a system administrator issuing commands to the storage system 120. In essence, the vdisk module 270 manages SAN deployments by, among other things, implementing a comprehensive set of vdisk (lun) commands issued through a user interface by a system administrator. These vdisk commands are converted to primitive file system operations (“primitives”) that interact with the file system 265 and the SCSI target module 260 to implement the vdisks.
The SCSI target module 260, in turn, initiates emulation of a disk or lun by providing a mapping procedure that translates luns into the special vdisk file types. The SCSI target module is illustratively disposed between the FC and iSCSI drivers 230, 228 and the file system 265 to thereby provide a translation layer of the virtualization system 255 between the SAN block (lun) space and the file system space, where luns are represented as vdisks. By “disposing” SAN virtualization over the file system 265, the storage system reverses the approaches taken by prior systems to thereby provide a single unified storage platform for essentially all storage access protocols.
The file system 265 is illustratively a message-based system; as such, the SCSI target module 260 transposes a SCSI request into a message representing an operation directed to the file system. For example, the message generated by the SCSI target module may include a type of operation (e.g., read, write) along with a pathname (e.g., a path descriptor) and a filename (e.g., a special filename) of the vdisk object represented in the file system. The SCSI target module 260 passes the message into the file system 265 as, e.g., a function call, where the operation is performed.
The file system 265 illustratively implements the WAFL file system having an on-disk format representation that is block-based using, e.g., 4 kilobyte (KB) blocks and using inodes to describe the files. The WAFL file system uses files to store metadata describing the layout of its file system; these metadata files include, among others, an inode file. A file handle, i.e., an identifier that includes an inode number, is used to retrieve an inode from disk. A description of the structure of the file system, including on-disk inodes and the inode file, is provided in the U.S. Pat. No. 5,819,292 entitled METHOD FOR MAINTAINING CONSISTENT STATES OF A FILE SYSTEM AND FOR CREATING USER-ACCESSIBLE READ-ONLY COPIES OF A FILE SYSTEM, by David Hitz, et al.
Operationally, a request from the client 110 is forwarded as a packet over the computer network 105 and onto the storage system 120 where it is received at the network adapter 125. A network driver processes the packet and, if appropriate, passes it on to a network protocol and file access layer for additional processing prior to forwarding to the write-anywhere file system 265. Here, the file system generates operations to load (retrieve) the requested data from disk 150 if it is not resident “in-core,” i.e., in the memory 124. If the information is not in the memory, the file system 265 indexes into the inode file using the inode number to access an appropriate entry and retrieve a logical VBN. The file system then passes a message structure including the logical VBN to the RAID system 240; the logical VBN is mapped to a disk identifier and DBN (disk,DBN) and sent to an appropriate driver (e.g., SCSI) of the disk driver system 250. The mapping of the logical VBN to the DBN is illustratively performed using the present invention as described further below. The disk driver accesses the DBN from the specified disk 150 and loads the requested data block(s) in memory for processing by the storage system. Upon completion of the request, the storage system (and operating system) returns a reply to the client 110 over the network 105.
It should be noted that the software “path” through the storage operating system layers described above needed to perform data storage access for the client request received at the storage system may alternatively be implemented in hardware. That is, in an alternate embodiment of the invention, a storage access request data path may be implemented as logic circuitry embodied within a field programmable gate array (FPGA) or an application specific integrated circuit (ASIC). This type of hardware implementation increases the performance of the storage service provided by storage system 120 in response to a request issued by client 110. Moreover, in another alternate embodiment of the invention, the processing elements of adapter 125, 128 may be configured to offload some or all of the packet processing and storage access operations, respectively, from processor 122, to thereby increase the performance of the storage service provided by the system. It is expressly contemplated that the various processes, architectures and procedures described herein can be implemented in hardware, firmware or software.
As used herein, the term “storage operating system” generally refers to the computer-executable code operable to perform a storage function in a storage system, e.g., that manages data access and may implement file system semantics. In this sense, the Data ONTAP software is an example of such a storage operating system implemented as a microkernel and including a file system layer to implement file system semantics and manage data access. The storage operating system can also be implemented as an application program operating over a general-purpose operating system, such as UNIX® or Windows XP®, or as a general-purpose operating system with configurable functionality, which is configured for storage applications as described herein.
In addition, it will be understood to those skilled in the art that the inventive technique described herein may apply to any type of special-purpose (e.g., file server, filer or storage system) or general-purpose computer, including a standalone computer or portion thereof, embodied as or including a storage system 120. An example of a storage system that may be advantageously used with the present invention is described in U.S. Pat. No. 7,873,700, issued on Jan. 18, 2011, entitled, MULTI-PROTOCOL STORAGE APPLIANCE THAT PROVIDES INTEGRATED SUPPORT FOR FILE AND BLOCK ACCESS PROTOCOLS, by Brian Pawlowski, et al. Moreover, the teachings of this invention can be adapted to a variety of storage system architectures including, but not limited to, a network-attached storage environment, a storage area network and disk assembly directly-attached to a client or host computer. The term “storage system” should therefore be taken broadly to include such arrangements in addition to any subsystems configured to perform a storage function and associated with other equipment or systems.
C. File System Arrangement
In the illustrative embodiment, a data container is represented in the write-anywhere file system as an inode data structure adapted for storage on the disks 150. FIG. 3 is a schematic block diagram of an inode 300, which preferably includes a meta-data section 305 and a data section 360. The information stored in the meta-data section 305 of each inode 300 describes the data container (e.g., a file) and, as such, includes the type (e.g., regular, directory, vdisk) 310 of file, its size 315, time stamps (e.g., access and/or modification time) 320 and ownership, i.e., user identifier (UID 325) and group ID (GID 330), of the file. The meta-data section 305 also includes a generation number 331. The contents of the data section 360 of each inode may be interpreted differently depending upon the type of file (inode) defined within the type field 310. For example, the data section 360 of a directory inode contains meta-data controlled by the file system, whereas the data section of a regular inode contains file system data. In this latter case, the data section 360 includes a representation of the data associated with the file.
Specifically, the data section 360 of a regular on-disk inode may include file system data or pointers, the latter referencing 4 KB data blocks on disk used to store the file system data. Each pointer is preferably a logical VBN to facilitate efficiency among the file system and the RAID system 240 when accessing the data on disks. Given the restricted size of the inode, file system data having a size that is less than or equal to 64 bytes is represented, in its entirety, within the data section of that inode. However, if the length of the contents of the data container exceeds 64 bytes but less than or equal to 64 KB, then the data section of the inode (e.g., a first level inode) comprises up to 16 pointers, each of which references a 4 KB block of data on the disk.
Moreover, if the size of the data is greater than 64 KB but less than or equal to 64 megabytes (MB), then each pointer in the data section 360 of the inode (e.g., a second level inode) references an indirect block (e.g., a first level L1 block) that contains 1024 pointers, each of which references a 4 KB data block on disk. For file system data having a size greater than 64 MB, each pointer in the data section 360 of the inode (e.g., a third level L3 inode) references a double-indirect block (e.g., a second level L2 block) that contains 1024 pointers, each referencing an indirect (e.g., a first level L1) block. The indirect block, in turn, that contains 1024 pointers, each of which references a 4 KB data block on disk. When accessing a file, each block of the file may be loaded from disk 150 into the memory 124.
When an on-disk inode (or block) is loaded from disk 150 into memory 124, its corresponding in-core structure embeds the on-disk structure. For example, the dotted line surrounding the inode 300 indicates the in-core representation of the on-disk inode structure. The in-core structure is a block of memory that stores the on-disk structure plus additional information needed to manage data in the memory (but not on disk). The additional information may include, e.g., a “dirty” bit 370. After data in the inode (or block) is updated/modified as instructed by, e.g., a write operation, the modified data is marked “dirty” using the dirty bit 370 so that the inode (block) can be subsequently “flushed” (stored) to disk. The in-core and on-disk format structures of the WAFL file system, including the inodes and inode file, are disclosed and described in the previously incorporated U.S. Pat. No. 5,819,292 titled METHOD FOR MAINTAINING CONSISTENT STATES OF A FILE SYSTEM AND FOR CREATING USER-ACCESSIBLE READ-ONLY COPIES OF A FILE SYSTEM by David Hitz et al., issued on Oct. 6, 1998.
FIG. 4 is a schematic block diagram of an embodiment of a buffer tree of a file that may be advantageously used with the present invention. The buffer tree is an internal representation of blocks for a file (e.g., file 400) loaded into the memory 124 and maintained by the write-anywhere file system 360. A root (top-level) inode 402, such as an embedded inode, references indirect (e.g., level 1) blocks 404. Note that there may be additional levels of indirect blocks (e.g., level 2, level 3) depending upon the size of the file. The indirect blocks (and inode) contain pointers 405 that ultimately reference data blocks 406 used to store the actual data of the file. That is, the data of file 400 are contained in data blocks and the locations of these blocks are stored in the indirect blocks of the file. Each level 1 indirect block 404 may contain pointers to as many as 1024 data blocks. According to the “write anywhere” nature of the file system, these blocks may be located anywhere on the disks 150.
A file system layout is provided that apportions an underlying physical volume into one or more virtual volumes (or flexible volumes) of storage system 120. An example of such a file system layout is described in U.S. Pat. No. 7,409,494 issued on Aug. 5, 2008, entitled EXTENSION OF WRITE ANYWHERE FILE SYSTEM LAYOUT, by John K. Edwards et al. and assigned to NetApp, Inc. The underlying physical volume is an aggregate comprising one or more groups of disks, such as RAID groups, of the storage system. The aggregate has its own physical volume block number (PVBN) space and maintains meta-data, such as block allocation structures, within that PVBN space. Each flexible volume has its own virtual volume block number (VVBN) space and maintains meta-data, such as block allocation structures, within that VVBN space. Each flexible volume is a file system that is associated with a container file; the container file is a file in the aggregate that contains all blocks used by the flexible volume. Moreover, each flexible volume comprises data blocks and indirect blocks that contain block pointers that point at either other indirect blocks or data blocks.
In one embodiment, PVBNs are used as block pointers within buffer trees of files (such as file 400) stored in a flexible volume. This “hybrid” flexible volume embodiment involves the insertion of only the PVBN in the parent indirect block (e.g., inode or indirect block). On a read path of a logical volume, a “logical” volume (vol) info block has one or more pointers that reference one or more fsinfo blocks, each of which, in turn, points to an inode file and its corresponding inode buffer tree. The read path on a flexible volume is generally the same, following PVBNs (instead of VVBNs) to find appropriate locations of blocks; in this context, the read path (and corresponding read performance) of a flexible volume is substantially similar to that of a physical volume. Translation from PVBN-to-disk, DBN occurs at the file system/RAID system boundary of the storage operating system 200.
In an illustrative dual VBN hybrid flexible volume embodiment, both a PVBN and its corresponding VVBN are inserted in the parent indirect blocks in the buffer tree of a file. That is, the PVBN and VVBN are stored as a pair for each block pointer in most buffer tree structures that have pointers to other blocks, e.g., level 1 (L1) indirect blocks, inode file level 0 (L0) blocks. FIG. 5 is a schematic block diagram of an illustrative embodiment of a buffer tree of a file 500 that may be advantageously used with the present invention. A root (top-level) inode 502, such as an embedded inode, references indirect (e.g., level 1) blocks 504. Note that there may be additional levels of indirect blocks (e.g., level 2, level 3) depending upon the size of the file. The indirect blocks (and inode) contain PVBN/VVBN pointer pair structures 508 that ultimately reference data blocks 506 used to store the actual data of the file.
The PVBNs reference locations on disks of the aggregate, whereas the VVBNs reference locations within files of the flexible volume. The use of PVBNs as block pointers 508 in the indirect blocks 504 provides efficiencies in the read paths, while the use of VVBN block pointers provides efficient access to required meta-data. That is, when freeing a block of a file, the parent indirect block in the file contains readily available VVBN block pointers, which avoids the latency associated with accessing an owner map to perform PVBN-to-VVBN translations; yet, on the read path, the PVBN is available.
FIG. 6 is a schematic block diagram of an embodiment of an aggregate 600 that may be advantageously used with the present invention. Luns (blocks) 602, directories 604, qtrees 606 and files 608 may be contained within flexible volumes 610, such as dual vbn flexible volumes, that, in turn, are contained within the aggregate 600. The aggregate 600 is illustratively layered on top of the RAID system, which is represented by at least one RAID plex 650 (depending upon whether the storage configuration is mirrored), wherein each plex 650 comprises at least one RAID group 660. Each RAID group further comprises a plurality of disks 630, e.g., one or more data (D) disks and at least one (P) parity disk. Each disk defines an address space, called a DBN space, which represents a set of disk block numbers to which content (metadata or user data) can be written.
Whereas the aggregate 600 is analogous to a physical volume of a conventional storage system, a flexible volume is analogous to a file within that physical volume. That is, the aggregate 600 may include one or more files, wherein each file contains a flexible volume 610 and wherein the sum of the storage space consumed by the flexible volumes is physically smaller than (or equal to) the size of the overall physical volume. The aggregate utilizes a PVBN space that defines a storage space of blocks provided by the disks of the physical volume, i.e., a PVBN space is formed using a collection of DBN spaces on disks contained in all raidgroups of a plex within the aggregate. Each embedded flexible volume (within a file) utilizes a VVBN space to organize those blocks, e.g., as files. Each VVBN space is an independent set of numbers that corresponds to locations within the file, which locations are then translated to PVBNs within the containing aggregate. The PVBNs, in turn, are further translated to DBNs on disk. As noted above, for optimization reasons, references to blocks within a flexible volume can be represented both in terms of a VVBN as well as the corresponding PVBN in order to reduce the number of disk accesses required to read a given block. If such a paired-address is present, then there is no need to translate the VVBN to the PVBN as it is already known. Since the flexible volume 610 is also a logical volume, it has its own block allocation structures (e.g., active, space and summary maps) in its VVBN space.
A container file is a file in the aggregate that contains all blocks used by a flexible volume. The container file is an internal (to the aggregate) feature that supports a flexible volume; illustratively, there is one container file per flexible volume. Similar to a pure logical volume in a file approach, the container file is a hidden file (not accessible to a user) in the aggregate that holds every block in use by the flexible volume. The aggregate includes an illustrative hidden meta-data root directory that contains subdirectories of flexible volumes:

    
    
        WAFL/fsid/filesystem file, storage label file
    
    


Specifically, a physical file system (WAFL) directory includes a subdirectory for each flexible volume in the aggregate, with the name of subdirectory being a file system identifier (fsid) of the flexible volume. Each fsid subdirectory (flexible volume) contains at least two files, a filesystem file and a storage label file. The storage label file is illustratively a 4 KB file that contains meta-data similar to that stored in a conventional RAID label. In other words, the storage label file is the analog of a RAID label and, as such, contains information about the state of the flexible volume such as, e.g., the name of the flexible volume, a universal unique identifier (uuid) and fsid of the flexible volume, whether it is online, being created or being destroyed, etc.
FIG. 7 is a schematic block diagram of an on-disk representation of an aggregate 700. The storage operating system 200, e.g., the RAID system 240, assembles a physical volume of PVBNs to create the aggregate 700, with PVBNs 1 and 2 comprising a “physical” volinfo block 702 for the aggregate. The volinfo block 702 contains block pointers to fsinfo blocks 704, each of which may represent a snapshot of the aggregate. Each fsinfo block 704 includes a block pointer to an inode file 706 that contains inodes of a plurality of files, including an owner map 710, an active map 712, a summary map 714 and a space map 716, as well as other special meta-data files. The inode file 706 further includes a root directory 720 and a “hidden” meta-data root directory 730, the latter of which includes a namespace having files related to a flexible volume in which users cannot “see” the files. The hidden meta-data root directory includes the WAFL/fsid/ directory structure that contains filesystem file 740 and storage label file 790. Note that root directory 720 in the aggregate is empty; all files related to the aggregate are organized within the hidden meta-data root directory 730.
In addition to being embodied as a container file having level 1 blocks organized as a container map, the file system file 740 includes block pointers that reference various file systems embodied as flexible volumes 750. The aggregate 700 maintains these flexible volumes 750 at special reserved inode numbers. Each flexible volume 750 also has special reserved inode numbers within its flexible volume space that are used for, among other things, the block allocation bitmap structures. As noted, the block allocation bitmap structures, e.g., active map 762, summary map 764 and space map 766, are located in each flexible volume.
Specifically, each flexible volume 750 has the same inode file structure/content as the aggregate, with the exception that there is no owner map and no WAFL/fsid/filesystem file, storage label file directory structure in a hidden meta-data root directory 780. To that end, each flexible volume 750 has a volinfo block 752 that points to one or more fsinfo blocks 754, each of which may represent a snapshot, along with the active file system of the flexible volume. Each fsinfo block, in turn, points to an inode file 760 that, as noted, has the same inode structure/content as the aggregate with the exceptions noted above. Each flexible volume 750 has its own inode file 760 and distinct inode space with corresponding inode numbers, as well as its own root (fsid) directory 770 and subdirectories of files that can be exported separately from other flexible volumes.
The storage label file 790 contained within the hidden meta-data root directory 730 of the aggregate is a small file that functions as an analog to a conventional RAID label. A RAID label includes physical information about the storage system, such as the volume name; that information is loaded into the storage label file 790. Illustratively, the storage label file 790 includes the name 792 of the associated flexible volume 750, the online/offline status 794 of the flexible volume, and other identity and state information 796 of the associated flexible volume (whether it is in the process of being created or destroyed).
D. VBN to DBN Mapping
The present invention provides a system and method for volume block number (VBN) to disk block number (DBN) mapping that may be utilized for both single and/or multiple parity based redundancy systems. Illustratively one of a plurality of parity distribution techniques is utilized to determine a new parity layout of a disk array organized into one or more Redundant Array of Inexpensive Disk (RAID) groups as the result of adding disks to a RAID group. Following parity (re)distribution, new VBNs are assigned to DBNs in the newly added disk and DBNs on older drives which stored parity blocks that were relocated to the new disk. By utilizing the programmatic assignment of VBNs, the present invention obviates the need to use persistently stored mapping/translation tables for each VBN/DBN relationship. In an illustrative embodiment of the present invention, flexible volumes stored within aggregates are utilized. In such embodiments, a physical volume block number (PVBN) may be utilized in place of a VBN. As such, the terms PVBNs and VBNs may be used interchangeably in describing the present invention.
The present invention permits the calculation of a PVBN value that is identified by a given DBN by first computing a table relative PVBN and identifying a logical disk number. The start (i.e., PVBN value of the first block) of the PVBN range, corresponding to the logical disk number, containing the desired PVBN is identified and the PVBN value is computed by adding a striped value to the start of the identified PVBN range.
Similarly, given a PVBN, the corresponding DBN may be identified by first computing a logical disk number for the PVBN and then computing a stripe by, e.g., subtracting a start of a PVBN range from the given PVBN. The PVBN is then converted to a table relative PVBN and the disk that stores the DBN is identified. The DBN on the identified disk is then identified as the block represented by the computed stripe on the identified disk. More generally, the present invention enables improved VBN-DBN mapping functionality to improve system performance and to enable dynamic disk additions to disk arrays utilizing distributed parity.
The present invention enables seamless parity block reallocations due to, e.g., a disk addition. The present invention also ensures that the arrangement of VBNs is computed in a manner such that the set of VBNs within a stripe is the same as the set which would be formed when using a dedicated parity organization, e.g., RAID 4. This holds true both with the initial organization at the moment a raidgroup is created as well as subsequent to expansion via disk additions. This property ensures that the filesystem can be oblivious to the placement of parity blocks and/or the redundancy level (e.g., single or double parity) of the underlying RAID array and can treat both RAID 4 and distributed parity organization in an identical manner. This greatly simplifies filesystem design and also provides a great deal of flexibility in configuring the underlying RAID array. Furthermore, by obviating the need for a static mapping table, the present invention gives greater flexibility for disk topology aware file systems.
FIG. 8 is a schematic block diagram of an exemplary mapping data structure 800 in accordance with an illustrative embodiment of the present invention. The mapping data structure 800 is utilized by the RAID module 240 for tracking information for implementing the VBN-DBN mapping of the present invention. The data structure 800 is illustratively embodied as a table, but may embody any data structure configured to describe a pattern used for mapping VBNs to DBNs for a given RAID group. In the illustrative embodiment, the RAID module maintains a mapping data structure 800 for each RAID group serviced by the RAID module. However, in an alternative embodiment of the present invention, the RAID module may maintain one mapping data structure 800 that is used system wide. Such a system wide mapping data structure 800 may be sized for the maximum sized RAID group possible, with each RAID group only using a subset of the mapping structure so defined. The mapping data structure 800 includes a number of parity blocks per stripe field 805, an initial size field 810, a number of disks field 815, a chunk size field 820, a repeat interval field 825, a reference count field 830, a map array field 835 and, in alternative embodiments, additional fields 840.
The number of parity blocks per stripe field 805 identifies the number of parity block within a stripe of a given RAID group. For example, in a double parity system, there are two parity blocks per stripe. The initial size field 810 describes a number of disks with which the RAID group was initially created. The contents of the initial size field 810 are utilized to seed the VBN storage space with a predefined parity pattern in accordance with an illustrative embodiment of the present invention. The number of disks field 815 identifies the current number of disks within the RAID group. By examining the contents of the initial size field 810 and the number of disks field 815, the disk storage module 240 may identify the current size of the RAID group as well as the number of disks that were added to the group after it was originally created. As disks are added to the RAID group, the number of disks field 815 is increased. The initial size field 810 and the number of disks field 815 enable the RAID module to determine the current VBN assignments using the programmatic technique of the present invention. The chunk size field 820 identifies the number of blocks, e.g., of 4 KB in size, mapped to by each table relative VBN stored within the mapping data structure 800. The repeat interval field 825 identifies a number of chunks at which the VBN-DBN mapping pattern and parity distribution repeat for a RAID group having a number of disks equal to that identified in field 815 with the number of disks defined in the initial size field 810. The reference count field 830 tracks number of the references to this mapping data structure 800. The reference count field 830 may be increased due to, e.g., an additional RAID group utilizing the mapping data structure 800. The map array 835 is a two-dimensional array describing the distribution pattern of VBNs relative to the size of the table and parity blocks across disks within the RAID group. The two-dimensional array 835 represents a contiguous VBN space relative to the repeat interval and the RAID group size.
FIG. 9 is a schematic block diagram of an exemplary assignment of VBNs to disks of an array 900 in accordance with an illustrative embodiment of the present invention. In the example, five disks of the disk array 900 are organized as a RAID group (disks 0-4) containing a single parity block in each stripe. As will be appreciated, the present invention may be utilized with any sized RAID groups. As such, the description of a five disk RAID group should be taken as exemplary only. In accordance with an illustrative parity assignment algorithm, a segment of VBN values begin at an initial data block of a disk and continue until a block that is to contain parity is reached. When a block that is to contain parity is reached, the VBN value that would have been assigned to the particular block is instead assigned to a correspondingly-positioned block on the same stripe in a last disk of the RAID group, i.e. disk 4 of the array. Thus, for example, on disk 0 of the array 900, VBN values 0, 1, 2, 3 are assigned to the first four data blocks. However the fifth block of the disk, which would have been assigned VBN 4, is occupied by parity (P). As such, VBN 4 is assigned to a correspondingly-positioned block, e.g., the fifth block, located on disk 4, i.e. the last disk of the RAID group. The assignment algorithm continues with VBN values 5, 6 and 7 assigned to the last three data blocks as well as VBN values 8, 9 and 10 on the next disk (disk 1). Since the next block (i.e., the fourth block) on disk 1 is occupied by parity, the VBN value that would have been assigned to that block (e.g., VBN 11) is instead assigned to the correspondingly-positioned block on disk 4. This illustrative assignment algorithm continues until all VBNs are appropriately assigned. As can be seen by the illustrative assignment algorithm, the set of VBNs within any given stripe is the same as the VBNs which would be assigned if the raidgroup, instead, was configured to use a dedicated parity organization, e.g., RAID 4. One of the objectives of assigning VBNs in this manner is to attempt to create long contiguous sequences of VBNs which are also physically contiguous on disk. The placement of parity blocks may be determined by a specific parity distribution technique. In this example, the distribution of parity blocks follows a left-symmetric pattern. However, any other distribution which spreads parity blocks uniformly across the disks of a raidgroup can be employed. Thus, for example, the placement of parity will differ between a RAID 5 implementation and a RAID-DP implementation.
FIG. 10 is a schematic block diagram illustrating an exemplary re-assignment of VBNs to disks of an array 1000 as a result of a disk addition in accordance with an illustrative embodiment of the present invention. In the example shown, a sixth disk (disk 5) has been added to the array 900 of FIG. 9 to thereby form array 1000. In illustrative array 1000, a parity (re)-balancing algorithm has determined that some parity blocks should be moved to the newly added disk, e.g., in the third block position on the newly added disk 5, as well as the eighth block position on disk 5. Thus, in the example the first block on disk 5 is assigned a VBN value 32 and the algorithm continues assigning VBN values to the remaining blocks on disk 5, e.g., up to VBN 39. In addition, parity initially assigned to blocks of a disk previously present in the RAID group (for example, disk 2), is relocated to correspondingly-positioned blocks on disk 5. Illustratively, in operation, the parity (re)-balancing algorithm is first applied and the parity blocks that have been moved to the newly added disks are identified. The DBN locations earlier occupied by the moved parity blocks are now unassigned. Then VBN assignment begins, where VBNs are sequentially assigned to blocks on the newly added disk. When a parity block is encountered on the newly added disk, the DBN occupied on its original disk, (i.e., prior to the disk addition) is assigned the next VBN. It should be noted that when a parity block is moved, no copy operation occurs. Instead, the destination block is treated as parity. As new disks are pre-zeroed prior to addition to a raidgroup, no change to parity within a stripe occurs. In accordance with an illustrative embodiment of the present invention, a plurality of differing parity assignment algorithms may be utilized. As such, the example described herein should be taken as exemplary only.
FIG. 11 is a schematic block diagram illustrating an exemplary re-assignment of VBNs to disks of an array 1100 as a result of a disk addition in accordance with an illustrative embodiment of the present invention. Similar to FIG. 10, a sixth disk (disk 5) has been added to the array 900 of FIG. 9 to thereby form array 1100. In distinction with array 1000, parity blocks are moved from two different disks (disks 2 and 3) to disk 5. For example, a parity (P) block on disk 2 is moved to disk 5, thereby causing VBN 34 to be assigned to disk 2. Similarly, a parity block from disk 3 is moved to disk 5.
FIG. 12 is a schematic block diagram illustrating an illustrative assignment of VBNs in a double parity array 1200 in accordance with an illustrative embodiment of the present invention. In the exemplary double parity array, VBNs are assigned to data blocks of a given disk until the assigned VBNs reach a block in which parity is to be stored. Once a block is reached in which parity is to be stored, the next VBN is assigned to the second to last disk of the array, e.g., a RAID group. Thus, for example, VBN 4 is assigned to a fifth block of disk 4 as parity is stored in a correspondingly positioned block on disk 0. If a VBN has previously been assigned to the block on the second to last disk, then the VBN is instead assigned to the correspondingly positioned block on the last disk. Thus, for example, the second parity block on the fourth stripe, initially would have been assigned a VBN value of 19, but because it occupies parity, an attempt was made to assign VBN 19 to a correspondingly positioned block on disk 4. However, because VBN 11 had been assigned to that block on disk 4, VBN 19 is assigned to a correspondingly positioned block on disk 5.
It should be noted that in alternative embodiments of the present invention, VBN assignments may be made at a chunk granularity, where a chunk represents a physically contiguous series of blocks. In such cases, VBNs within a chunk are numbered sequentially. In these alternative embodiments, the term “block” may be replaced with the term “chunk” in the descriptions of FIGS. 9-12 above.
FIG. 13 is a schematic block diagram illustrating an assignment of VBNs to disks of an array 1300 in accordance with an illustrative embodiment of the present invention. In the illustrative array 1300, VBNs are sequentially assigned to data blocks on a given disk until a parity block is reached. Once a parity block is reached, the VBN that would be assigned to that block is instead assigned to the correspondingly positioned block on the next disk of the array. Thus, VBN value 4 is assigned to the fifth block on disk 1 as the fifth block on disk 0 is a parity block. Sequential assignment of VBNs continues with the next disk, e.g., VBN value 5 is assigned to the next block location on disk 1, until the next parity block is reached at which time the next VBN value is assigned to the next disk. In accordance with the illustrative embodiment, in an array of n disks (disks 0 to n−1), when a parity block is reached on disk n−1, the process continues by allocation, the next VBN valued on disk 0. It should be noted that the above described illustrative embodiments are exemplary. In accordance with other alternative embodiments, VBNs may be allocated using different algorithmic techniques.
This process of VBN assignment represents an alternative embodiment to that described above in reference to FIG. 9 for assigning VBNs such that long chains of physically contiguous VBNs are formed. Long chains of physically contiguous VBNs permit abstracting the VBN space as a set of ranges wherein each range corresponds to the size of a disk. Advantageously, this permits the file system to treat each VBN range as corresponding to a logical disk and operate on it in a manner similar to a physical disk. Long chains ensure that this is possible while guaranteeing that the impact on read throughput is negligible.
FIG. 14 is a schematic block diagram of a mapping table 1400 in accordance with an illustrative embodiment of the present invention. As will be appreciated y one skilled in the art, the mapping table 1400 represents a two dimensional table that may be utilized for performing VBN to DBN mappings.
FIG. 15 is a schematic block diagram illustrating an exemplary 5 disk RAID array that stores two repetitions of mapping table 1400. The RAID array 1500 illustrates the pattern of VBN assignments assuming RAID groups where the number of the stripes is given by the repeat interval defined in field 825. The size of the RAID group is represented by size field 815 with the initial number of disks defined in field 810. As will be appreciated from FIGS. 14 and 15, in a RAID group, the pattern of parity blocks and VBNs (as shown in FIG. 14) is repeated along the length of the disks as shown in FIG. 15.
FIG. 16 is a flowchart detailing the steps of a procedure 1600 for computing a VBN from a given DBN in accordance with an illustrative embodiment of the present invention. Procedure 1600 may be utilized to, e.g., identify the VBN mapped to a given DBN. Illustratively, procedure 1600 may be utilized by the RAID module to perform VBN to DBN mapping while processing data access requests. The procedure 1600 begins in step 1605 and continues to step 1610 where a table relative VBN is first computed. The table relative VBN is illustratively identified by indexing into the map array 835 of mapping data structure 800. In accordance with an illustrative embodiment, the table relative VBN is located by indexing into the map using the stripe and the disk number of the array as indices. The stripe number is computed by first dividing the DBN with the chunk size 820 and then computing the module repeat interval 825 from the result. This process results in the stripe number within the two-dimensional array of the chunk within which the DBN is contained. The VBN contained within the entry within the two-dimensional array corresponding to the stripe (as computed above) and using the disk number as an index representing the table relative VBN. In step 1615, the logical disk number is identified. The logical disk number is illustratively computed by dividing the table relative VBN by the repeat interval. The start (i.e., VBN value of the first block) of the VBN range is then identified in step 1620. By utilizing the VBN range index data structure 285, the logical disk number is mapped to a VBN range on the actual RAID group. In step 1625 the VBN is computed by adding the stripe value (the DBN value) to the starting VBN value of the range of VBNs. The procedure completes in step 1630.
FIG. 17 is a flowchart detailing the steps of a procedure 1700 for a computing a DBN given a VBN in accordance with an illustrative embodiment of the present invention. The procedure 1700 begins in step 1705 and continues to step 1710 where the logical disk number for the VBN is computed. The logical disk number is illustratively computed by, e.g., locating the VBN in the VBN range list 280. The logical disk number is the disk identified as hosting the VBN range containing the desired VBN. In step 1715 the stripe is computed. The stripe is illustratively computed by subtracting the value of the start of the VBN range from the given VBN value. The VBN is then converted to a table relative VBN in step 1720. Illustratively, the table relative VBN is computed by multiplying the logical disk number by the repeat interval and then adding the table stripe value. The table stripe value is computed by, e.g., taking a chunk value modulo the repeat interval, where the chunk value equals the stripe divided by the chunk size. The disk storing the VBN is identified in step 1725 by searching the two-dimensional array for an entry corresponding to the “table relative VBN.” This search need only be done for entries in the two-dimensional array corresponding to the table stripe. The disk storing the VBN corresponds to the index of the column containing the table relative VBN. The raidmap index structure 290 can now be used to point to the actual physical disk. The DBN on the identified disk is then identified in step 1730. Illustratively, the DBN comprises the block representing the computed stripe on the identified disk. The procedure completes in step 1735.
The foregoing description has been directed to specific embodiments of this invention. Additionally, the procedures, processes and/or modules described herein may be implemented in hardware, software, embodied as a computer-readable medium having program instructions, firmware, or a combination thereof. Furthermore, it should be noted that the terms PVBN and VBN may be utilized interchangeably herein depending on the type of volume being utilized. It will be apparent, however, that other variations and modifications may be made to the described embodiments, with the attainment of some or all of their advantages. Therefore, it is the object of the appended claims to cover all such variations and modifications as come within the true spirit and scope of the invention.

## Claims

1. A method comprising:
creating a mapping data structure using an initial number of disks field and a current number of disks field;
computing a chunk by dividing a disk block number by a chunk size;
computing a table stripe value by taking the chunk modulo a repeat interval;
computing a table relative volume block number for the disk block number, wherein the disk block number is of a storage device of a storage device array;
storing the table relative volume block number as an entry in the mapping data structure;
identifying a logical disk number using the table relative volume block number;
computing a volume block number associated with the disk block number of the storage device; and
maintaining the mapping data structure by excluding parity from a volume block number space, wherein the mapping data structure is two dimensional and wherein the table relative volume block number is identified by indexing into the mapping data structure using the logical disk number as a first index and the table stripe value as a second index.

2. The method of claim 1 wherein the volume block number comprises a physical volume block number.

3. The method of claim 1 wherein computing the volume block number associated with the disk block number further comprises computing the volume block number by adding the disk block number to a start of a volume block number range.

4. The method of claim 3 further comprising identifying the start of the volume block number range by mapping the logical disk number into a range index.

5. The method of claim 1 further comprising passing the computed volume block number to a file system of the storage device array for use in processing a data access request.

6. The method of claim 1 wherein the storage device array implements a redundancy technique.

7. The method of claim 6 wherein the mapping data structure includes a reference count indicating a number of references to the mapping data structure.

8. The method of claim 1 wherein the mapping data structure is created further using a two-dimensional array describing a distribution pattern of volume block numbers relative to a size of the mapping data structure.

9. The method of claim 1 wherein the mapping data structure includes a reference count indicating a number of references to the mapping data structure.

10. The method of claim 1 wherein the mapping data structure includes the chunk size.

11. The method of claim 1 wherein the mapping data structure includes a number of parity blocks per stripe.

12. A non-transitory computer readable medium for mapping a volume block number to a disk block number in a storage device array of a storage system, the computer readable medium comprising program instructions that:
create a mapping data structure using an initial number of disks field and a current number of disks field;
compute a chunk by dividing a disk block number by a chunk size;
compute a table stripe value by taking the chunk modulo a repeat interval;
compute a table relative volume block number for the disk block number, wherein the disk block number is of a storage device of a storage device array;
store the table relative volume block number as an entry in the mapping data structure;
identify a logical disk number using the table relative volume block number;
compute a volume block number associated with the disk block number of the storage device; and
maintain the mapping data structure by excluding parity from a volume block number space, wherein the mapping data structure is two dimensional and wherein the table relative volume block number is identified by indexing into the mapping data structure using the logical disk number as a first index and the table stripe value as a second index.

13. The non-transitory computer readable medium of claim 12 wherein the mapping data structure includes a reference count indicating a number of references to the mapping data structure.

14. The non-transitory computer readable medium of claim 12 wherein the mapping data structure includes the chunk size.