Patent Publication Number: US-6041394-A

Title: Disk array write protection at the sub-unit level

Description:
BACKGROUND OF THE INVENTION 
     The invention relates generally to mass storage memory systems, and more particularly, to a method and apparatus for write protecting logical volumes of a mass memory accessible by multiple host computers. 
     In a typical memory system employing, for example, a disk drive, the entire disk drive can be manually or electronically write protected in advance. For a floppy disk drive, this involves merely flipping a tab, and in a larger disk drive, such as the gigabit drives available today, the write protect can either be manually set at the drive itself, or electronically set by a user or customer engineer. In either case, the drive becomes write protected against all incoming write requests. In addition, the write protection is typically set in advance, so that the status of the drive, that is, what data has been written to the drive, must be known in advance. 
     Large disk drive memories are typically divided into a plurality of logical volumes. Thus, a single disk drive might have 4, 8, or more logical volumes. In addition, each of the logical volumes can be accessible by plural host computers. Thus, one host computer may be responsible for writing and maintaining a database in a first logical volume on the disk drive and other host computers are ordinarily only expected to read the database for their varying purposes and applications. Other host computers may be responsible for other logical volumes on the same disk drive unit. 
     In some smart disk drive controllers, such as the EMC Symmetrix disk drive controller, logical volumes were initially protected manually during operation. In these instances, however, the user or customer engineer must know in advance when the write operation(s) for data on the drive which is to be protected, has been completed, and thereafter, the user or customer engineer would write protect the logical volume or the entire drive manually. 
     In our copending U.S. patent application Ser. No. 08/831,481, filed on Mar. 31, 1997, and entitled DISK ARRAY WRITE PROTECTION AT THE SUB-UNIT LEVEL, the contents of which are incorporated herein by reference, there is described a write protect mechanism operable from the host computer. This invention is an improvement upon the invention described in our earlier copending application. 
     SUMMARY OF THE INVENTION 
     The invention relates to a system having a plurality of host computers, a disk controller system, and at least one mass storage disk device controlled by the controller and having a plurality of logical volumes. At least one of the logical volumes can be written to by at least two of the hosts through different ports of, for example, channel directors or SCSI adapters (&#34;SA&#39;s&#34;) of the disk controller. 
     The method thus changes the write protect status of at least one logical volume accessible by the controller. The method features the steps of obtaining control of a write protect lock in response to a host request for a change in write protect status for at least one selected logical volume, the request being received from a first host; writing, in response to the first host request, a write protect message to a logical volume memory location associated with each logical volume which will be affected; setting a flag message in a message memory location indicating a change in one of the logical volume memory locations; polling the message memory location for set flag messages; writing, in response to a set flag message, in a local memory associated with a controller port for the requesting host, a status of at least all logical volumes accessible from the port; and preventing, at the controller, a host from writing to a protected logical volume as identified by data in the controller&#39;s local memory. 
     In another aspect, the apparatus of the invention features to a mass storage control system having a global memory, a plurality of channel directors, each channel director having at least one port and a local write status memory, each director being connected to the global memory and able to send and receive data and commands to and from at least one host computer, at each port; the global memory having a mailbox for each channel director which can read and write data to it; the global memory and the channel directors being configured so that each channel director can write data to each other channel director&#39;s mailbox in the global memory; each channel director ordinarily being able to received data and commands from a host and write the data to a logical volume of a mass storage disk drive system having a plurality of logical volumes. Each channel director, in response to a received logical volume write protect status change command from a host computer, obtains a write protect lock, writes a write protect status message to the mailbox within global memory of at least one channel director able to write to the logical volume, and writes any logical volume status change data to global memory. Each channel director periodically polls its mailbox for new write protect status messages; and each channel director responds to a new write protect message in its mailbox in the global memory by modifying a write protect data structure in its local memory. 
     The invention thus advantageously allows a host computer to protect, dynamically and on the fly, one or more logical volumes to which it needs to limit write access. In other aspects, the invention advantageously allows the write access limitation to be effected at the channel director port level, without the host knowing the storage system configuration. 
    
    
     BRIEF DESCRIPTION OF THE DRAWING 
     Other objects, advantages, and features of the invention will be apparent from the following description taken together with the drawings in which: 
     FIG. 1 is a system description in accordance with the invention describing the environment in which the invention operates; 
     FIG. 2 is a block diagram showing the interconnection of various channel directors to the global memory in accordance with the invention; 
     FIG. 3 is a flow chart illustrating the operation of a system in accordance with the invention; and 
     FIGS. 4A-4D are data structures useful in implementation of a particular embodiment of the invention. 
    
    
     DESCRIPTION OF A PREFERRED EMBODIMENT OF THE INVENTION 
     Referring to FIG. 1, the invention relates to a computer system 10 which has a plurality of host computers 12a, 12b, . . . , 12n and a mass storage system 13 having a plurality of disk drive elements 14a, 14b, . . . , 14k. Interconnecting the host computers 12 and the disk drive elements 14 is a disk drive controller 16, for example, that made by EMC and known as the Symmetrix controller. The disk drive controller 16 receives memory commands from the various host computers over buses 18a, 18b, . . . , 18n respectively, for example, connected and operating in accordance with a SCSI protocol, and delivers the data associated with those commands to the appropriate disk drive elements 14 over respective connecting buses 20a, 20b, . . . 20k. Buses 20 also preferably operate in accordance with a SCSI protocol. 
     Each of the disk drive elements 14 typically has in excess of nine gigabytes of memory and is logically divided, in accordance with known techniques, into a plurality of logical volumes. Each disk drive element 14 can thus have a plurality of logical volumes, for example 4, 8, or more logical volumes on a single disk drive element. In a typical configuration, the controller system also connects to a console PC 22 through a connecting bus 24. Console PC 22 is used for maintenance and access to the controller and can be employed to set parameters of the controller as is well known in the art. 
     As indicated above, in operation, it can often occur that one host, for example host 12a, as well as a second host, for example host 12b, can each write not only to the same disk drive element, for example disk drive element 14a, but even to the same logical volume of that disk drive element. In accordance with the invention, one host computer can command, through the disk drive controller 16, and without knowing the host/disk drive element configuration, that a particular logical volume to which it has read and write privileges be write-protected against all other host computers, at, for example, in the Symmetrix device, the channel director port level. 
     Thus, referring to FIG. 2, within the disk controller 16 with which the invention is particularly useful, each host computer connects to a port of a channel director 30 (also referred to as a SCSI adaptor or SA) over the SCSI bus lines 18. Each channel director can have four or more ports. Each channel director in turn connects, over a one or more system buses 32 or 34, to a global memory 36. The global memory, preferably, is a large memory through which the channel directors can communicate to the disk drives, and it includes a portion acting as a cache memory for the system. The global memory also has therein a plurality of mailboxes 38, one mailbox for each channel director 30 and a section 39 of memory with a memory portion for each logical volume. Each mailbox, which physically consists of a portion of the global memory, can be read and written by each channel director. 
     The global memory section 39 contains typically plural separate device ID memories 40 (FIG. 4A), each ID memory being associated with a different logical volume of the disk drives to which the controller has access. Global memory also provides in the mailbox for each channel director, a write protect status buffer 42 (FIG. 4B) which the channel director will periodically poll to determine whether the write protection of any of the logical volumes to which it has access has changed. As will be described in more detail below, the write protection data is stored on a port by port basis for each channel director. A change in write protect status, in the illustrated embodiment, is signalled by a particular semaphore or flag in each write protect status buffer 42. Thus, each channel director can read its mailbox, and in particular, the mailbox slot relating to write protect messages, and determine whether write protection for any of the logical volumes it can access has changed. If there is a change, the channel director will access that information as described below, and store the retrieved data in its local memory and in a non-volatile memory. Thus, as will be described further below, the presence of a flag or semaphore at the write protect status message slot in a channel director&#39;s mailbox indicates that the write protect status for that channel director has changed since the last time that channel director read (or polled) the write protect status memory 42. After reading a status memory 42, the flag is reset. 
     Referring to FIG. 3, in operation, each of the write protect status messages, is initialized, in global memory, at first power-up, to zero. This is indicated at step 100. Further, the contents of a non-volatile memory 90 of each channel director 30, is also initialized to &#34;zero&#34; indicating that no logical drive is write protected. Finally the contents of each non-volatile memory is loaded into global memory in the device ID memory 40 for each logical volume or device in the system, and is loaded into a local memory at each channel director. 
     The write protect status information data in each non-volatile memory 90, is retained in the event of a power failure, and following a power loss, and following initial microcode loading, the information in each memory 90 is retrieved and placed, as noted above, in both global memory, at each device ID memory header (step 100), and in the local write protect status buffer memory within each channel director (step 102). Accordingly, after the initialization process (steps 100, 102), at turn-on, the non-volatile memories 90, the local write protect status buffer memories 92 within the channel directors, and the write protect device ID header 40 for each logical volume, stored in global memory, contain the same write protect status data. As a convention, upon initial turn-on, none of the logical volumes are write protected. 
     Thereafter, each channel director reads and writes through the global memory to the disk drives in accordance with &#34;normal operation&#34;. This is indicated at 104. If a command is received from a host computer directing the write protect status of a particular logical volume to be changed, for example to be write protected, as tested at step 106, the channel director 30 to which the command is directed acts to implement the command as follows. Before examining the system operation, however, a mode select command (FIG. 4C) will first be described. 
     The SCSI mode select command provides, on one of its pages, a procedure for altering the write protect attributes of any or all logical volumes controlled by the channel director port. In a particular preferred embodiment of the invention, referring to the table of FIG. 4C, the mode select command, from the host, operates to modify the write protect status of all logical volumes which are visible from the port receiving the command or to modify only the one logical volume specified in the command. 
     In operation, in the illustrated embodiment of the invention, the command structure is illustrated in FIG. 4C. The value of &#34;P&#34; in FIG. 4C identifies whether the command only applies to the specific identified logical volume (P=0) or whether the command applies to all logical volumes that are visible from the effected port (P=1). In the &#34;mode&#34; section of the command, one of, for example, five codes can appear. A &#34;00&#34; code indicates that no operation will be performed. A &#34;01&#34; code value causes a write enable for all logical volume(s) seen from this port; a &#34;02&#34; value causes a write disable to be effected on all logical volume(s) seen from the port; a &#34;03&#34; value causes a write enable for all logical volume(s) seen from this port and a write disable for those logical volume(s) from all other ports; and a &#34;04&#34; value causes a write disable for all logical volumes seen from this port and a write enable for those logical volumes from any other connected and authorized port. It is important to recognize that the host computer need not know the configuration of the controller system, that is, which logical volumes are available at which ports, to use this command. That detailed information is available to the disk controller system, and is automatically accounted for by the controller as it implements the command. As a result, at 108, the controller (if it has the write protect lock) writes the write protect message and sets semaphores for each affected channel director (including the channel director receiving the command) and also writes in each affected device ID header 40 the correct (and changed if necessary) write protect status. 
     It is important to note, however, that in the preferred embodiment of the invention, as suggested above, the write protect status of a logical volume cannot be changed unless the channel director has the &#34;write protect lock&#34; as tested at step 109. To obtain the write protect lock, the channel director reads the write protect lock data structure (illustrated in FIG. 4D). If the write protect lock is held by another channel director, that channel director is identified in byte two and the value of byte three is set to the lock state. Otherwise, the value identified in byte three is in the unlock state, for example a &#34;zero&#34;, and the inquiring channel director can obtain the lock (step 109a) and set the write protect lock data structure appropriately. In addition to obtaining lock and writing the new write protect status data in global memory device ID memory headers, for each logical volume to be affected, the writing channel director also, as noted above, sets the semaphore or flag by leaving a message for each other affected channel director. In the illustrated embodiment of the invention, the flag is a &#34;5A&#34; (in hexadecimal), placed in byte 0 of the message word for each channel director. It also, in the illustrated embodiment of the invention, leaves that message for itself as well. A typical structure for the message word is illustrated, for example, in FIG. 4B. Finally, after performing these tasks, the disk director returns the lock (resetting the lock data structure of FIG. 4D) (Step 100b) and returns to &#34;normal operations&#34; at 104. If the lock had not been available at 109, operational flow would have immediately returned to a polling operation at 110, and the command would have failed. 
     In the illustrated embodiment of the invention, approximately every half-second, each channel director polls, at 110, its mailbox to determine whether a write protect status change message 43 is waiting for it. If a new message is available, at 112, that message is &#34;read&#34;, as indicated at 114, and the channel director&#39;s internal memory 92 and non-volatile memory 90 are updated. If no message is waiting, or if polling is not performed, control returns to &#34;normal operations&#34;. In order to update its internal or local memory 92, the channel director scans the global device ID headers 40 of at least all logical volumes to which it has access, or, as in the illustrated embodiment, all logical volume ID headers, and rebuilds its internal status buffer local memory 92 and its non-volatile memory 90 on a port by port basis. It then clears or resets the flag or semaphore (here the &#34;5A&#34;) in its mailbox status memory. 
     Thus, each channel director, including the channel director which wrote the write protect status charge message, will, after polling its mailbox, and finding a set flag (5A), read all device ID headers and update its own local memory which stores the write permissions for the logical volumes to which it has access, from each port. The information is also stored in the non-volatile memory to be used, if necessary, during power-up (for example after a power failure) (steps 100, 102). The channel lock is also released at 109b, setting &#34;L&#34; to &#34;O&#34; (FIG. 4D). Note that after a logical volume has been write protected, then, any host connected to a channel director port, which no longer has write permission to that logical volume, will be unable to write data to that logical volume (although it can still read data from the logical volume). Any attempt by an authorized host to write data will be &#34;rejected&#34; by the channel director which provides a device unavailable response to the host. 
     In this illustrated embodiment of the invention, the write protect message has the granularity of the channel director ports. In a typical Symmetrix device, there can be up to 32 channel directors, each having up to four ports. In other embodiments of the invention, however, the granularity can be different. 
     In a preferred embodiment of the invention, the write protect status for the logical volumes available to a port of a channel director can also be modified from the console PC 22 over connecting channel 24. The PC console thus has the capability to modify and write to the various data structures and mailboxes associated with the channel directors, and to write protect data &#34;on the fly&#34; as a process is proceeding. This mechanism can be employed, for example, where a particular host computer 12 does not have available to it the command structure or application software which will enable it to modify the protection of one or more of the logical volumes for which it may have responsibility. 
     The host computers can remove write protection for a logical volume in the same manner in which write protection is added for the volume. This is clear from the mode select command described above. In that instance, the command to the channel director causes the channel director to reset a write protect bit, that is, for example to rewrite it as a &#34;zero&#34;, following the general outline of operations illustrated in FIG. 3. The change in write protect status is then read as the channel directors periodically poll the global memory, read and recognize the set semaphore, read the device ID header data structures, and store the read data by updating their own respective internal memory 92 which defines the write permissions to which the channel director must adhere. The status data is also stored in each non-volatile memory 90). 
     Additions, subtractions, and other modifications of the preferred embodiment of the invention will be apparent to those of skill in the field and are within the scope of the following claims.