Movatterモバイル変換


[0]ホーム

URL:


CN105354102B - A kind of method and apparatus of file system maintenance and reparation - Google Patents

A kind of method and apparatus of file system maintenance and reparation
Download PDF

Info

Publication number
CN105354102B
CN105354102BCN201510662628.2ACN201510662628ACN105354102BCN 105354102 BCN105354102 BCN 105354102BCN 201510662628 ACN201510662628 ACN 201510662628ACN 105354102 BCN105354102 BCN 105354102B
Authority
CN
China
Prior art keywords
metadata
mistake
file system
error
occurs
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510662628.2A
Other languages
Chinese (zh)
Other versions
CN105354102A (en
Inventor
齐江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co LtdfiledCriticalHuawei Technologies Co Ltd
Priority to CN201510662628.2ApriorityCriticalpatent/CN105354102B/en
Publication of CN105354102ApublicationCriticalpatent/CN105354102A/en
Application grantedgrantedCritical
Publication of CN105354102BpublicationCriticalpatent/CN105354102B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

Translated fromChinese

本发明提供了一种文件系统维护和修复的方法和装置,当检测到所述文件系统中的元数据发生错误时,确定所述错误的元数据是否属于可隔离的元数据,所述可隔离的元数据为发生错误后,文件系统仍然可以继续提供部分服务的元数据;当确定所述发生错误的元数据属于可隔离的元数据时,将所述发生错误的元数据设置为只读或者不可访问。应用本发明技术方案,可以使文件系统中发生错误的元数据为可隔离的元数据时,将发生错误的元数据隔离,而文件系统继续运行,保证的文件系统工作的连续性,提高了系统的可容错能力,提升了整体业务的性能。

The present invention provides a method and device for maintaining and repairing a file system. When an error is detected in the metadata in the file system, it is determined whether the erroneous metadata belongs to the metadata that can be isolated. The metadata is the metadata that the file system can continue to provide some services after an error occurs; when it is determined that the metadata in which the error occurs belongs to the isolateable metadata, the metadata in which the error occurs is set to read-only or Not accessible. By applying the technical scheme of the present invention, when the metadata in the file system with the error can be isolated, the metadata with the error can be isolated, while the file system continues to run, the continuity of the file system work is guaranteed, and the system is improved. The fault tolerance capability improves the overall business performance.

Description

A kind of method and apparatus of file system maintenance and reparation
Technical field
The present invention relates to file system management technical fields, and in particular to a kind of method of file system maintenance and reparation andDevice.
Background technique
The file system of computer is the method for a kind of storage and organizational computing machine data, it to access it and searchIt becomes easy, file system is made using the abstract logic concept of file and directory tree instead of physical equipments such as hard disk and CDsWith the concept of data block.File system carries out tissue and distribution to the space of file-storage device, is responsible for file storage and to depositingThe file of storage is protected and is retrieved.In other words, file system be a set of storage for realizing data, it is hierarchically organized, access andThe abstract data type of the operations such as acquisition.
File system metadata is the information of the tissue about file data, data field and its relationship.In short, metadataIt is exactly the data about data.The metadata of generic-document system is divided into system file (by itself creating when file system formatBuild, be used for certain administrative purposes) metadata and user file (create) metadata by user.
In some cases, such as software itself mistake, power failure, or the scenes such as controller is abnormal of storage equipment,It may cause metadata to be damaged, i.e., file system can be in inconsistent state.In the prior art, metadata error is foundAfterwards, entire file system can be set as to read-only status, i.e. user cannot carry out any write operation to file system.To metadataWhen being repaired, file system can be unloaded, execute after repair action carry again again.
Conventionally, as entire file system is set as read-only, will lead to business overall performance is unavailable, industryIt is bigger that influence face is interrupted in business.Simultaneously as after any single metadata damage, file system will be set as to read-only or notIt may have access to, therefore when being repaired, in order to guarantee the integrality repaired, need to be scanned entire file system, find outThe metadata of mistake occurs in other, so that repair time is longer.
Summary of the invention
In view of this, the embodiment of the present invention provides the method and device of a kind of file system metadata isolation and reparation,For improving the fault-tolerant ability of file system and the remediation efficiency of file system.
In a first aspect, the embodiment of the present invention provides a kind of method of file system maintenance, when detecting the file systemIn metadata occur mistake when, determine whether the metadata of the mistake belongs to isolable metadata, it is described isolableMetadata is after mistake occurs, and file system still can continue to provide the metadata of partial service;When determining that the generation is wrongWhen metadata accidentally belongs to isolable metadata, set read-only or inaccessible for the metadata that mistake occurs.Since the file system after wrong metadata after isolation can still continue offer service, do not have to as in the prior art directly will be wholeA file system is set as read-only, to improve the continuity and fault-tolerant ability of file system traffic.
It with reference to first aspect, can be according to the metadata and described that mistake occurs under the first implementationThe data type of metadata and whether isolable corresponding relationship, determine it is described occur mistake metadata whether belong to and can be isolatedMetadata.
The first implementation with reference to first aspect, under second of implementation, the available generation mistakeMetadata data type;It is determined according to the data type of the metadata that mistake occurs and preset meta data category tableWhether the metadata that mistake occurs can be isolated, the meta data category table include metadata data type and whether can be everyFrom corresponding relationship.
With reference to first aspect and first, second kind of implementation of first aspect, in third under implementation,After the metadata by the generation mistake is set as read-only or inaccessible, the metadata that mistake occurs is determinedType of error whether be relevance mistake, after the relevance misrepresentation mistake occurs, the metadata phase with the mistakeMistake also has occurred in the metadata of pass;When determining that the type of error is relevance mistake, then by described and mistake memberThe relevant metadata of data is also set as read-only or inaccessible.Thus, it is possible to after detecting the metadata that mistake occurs, it willMetadata isolation associated with the type of error of the generation mistake metadata, thus the first number for the mistake being more fully isolatedAccording to reducing influence of the associated metadata error for file system, and improve comprehensive when repairing wrong metadataProperty.It can guarantee that the associated metadata of relevance mistake is isolated simultaneously, and then file system can be made to continue offer service,Improve the stability of file system.
The third implementation with reference to first aspect judges the member that mistake occurs under the 4th kind of implementationIt according to type of error and type of error and whether can be relevance when whether the type of error of data is relevance mistakeThe corresponding relationship of mistake determines whether the type of error is relevance mistake.
Third or the 4th kind of implementation with reference to first aspect, under the 5th kind of implementation, will it is described with it is describedIt is described relevant to the metadata of the mistake when the relevant metadata of the metadata of mistake is also set as read-only or inaccessibleMetadata includes the metadata of the metadata dependent on the mistake.Since mistake can also occur for the metadata dependent on the mistakeAccidentally, therefore, the relevant metadata is also isolated, the stability of file system can be improved.
With reference to first aspect or any one in first to the 5th kind of implementation of first aspect, in the 6th kind of realityUnder existing mode, the error message of the mistake is also added in error message list by the embodiment of the present invention, the error listingFor the metadata that mistake occurs to be reported to user.By error message list, user can be initiated it is primary repair orFile system be set as it is read-only before, all wrong metadata informations that will test are added to error message list, User spaceWhen carrying out errors repair, no longer need to carry out error scanning to file system, and can be directly according to error listing in listGeneration mistake metadata repaired.Meanwhile the metadata of the generation mistake in file system is not isolable memberBefore data, the isolable metadata of the generation mistake in file system can be added in error listing, therefore userDisposably multiple metadata can be repaired, improve remediation efficiency.
Second aspect receives user the embodiment of the invention also provides a kind of file system restorative procedure and is determining metadataThe instruction for freezing file system sent after mistake occurs, and file system is freezed according to the instruction for freezing file system.The metadata that mistake occurs is repaired in the metadata reparation instruction sent according to user.Receive the defrosting file that user sendsThe instruction of system, and according to the instruction of the defrosting file system defrosting file system.Freeze text by responding User spacePart system, and the metadata that mistake occurs is repaired, the quick reparation to file system may be implemented.
In conjunction with second aspect, in the first implementation, the embodiment of the present invention also to reporting of user error message list,The error message list includes that the error message of the metadata of mistake occurs.Since error message is added to error message columnIn table, returned to since the relevant information of relevant information and mistake that the metadata of mistake occurs passes through error message listUser, user no longer need to carry out error scanning to entire file system when carrying out errors repair, and can be directly according to mistakeThe metadata of generation mistake in list pairlist is repaired, and the time of errors repair is reduced.
The third aspect, the embodiment of the invention provides a kind of file system maintenance device, described device includes metadata inspectionModule and metadata isolation module are surveyed, can also include that module is collected in error message optionally.Described device can be used for executingMethod described in the various implementations of first aspect and first aspect.
Fourth aspect, the embodiment of the invention also provides a kind of file system prosthetic device, described device includes file systemSystem freezes module and metadata repair module, can also include information reporting module optionally.Described device can be used for executingVarious implementation the methods of second aspect and second aspect.
5th aspect, the present invention also provides a kind of computer system, the computer system includes processor, Yi JiyuThe memory that the processor is connected, wherein the processor calls the instruction stored in the memory for executing instituteState first aspect and first various implementations described in method.
6th aspect, the present invention also provides a kind of computer system, the computer system includes processor, Yi JiyuThe memory that the processor is connected, wherein the processor calls the instruction stored in the memory for executing instituteState second aspect and second various implementations described in method.
As it can be seen that the method and device provided in the present embodiment when mistake occurs for file system, first determines whether that mistake occursMetadata whether belong to isolable metadata, if then only setting read-only or can not for the metadata of the generation mistakeAccess, rather than as the prior art occur it is any mistake when entire file system is all set as read-only or inaccessible, becauseEven if the continuity that file system work occurs for this certain mistake still is able to be guaranteed, to improve the fault-tolerant of file systemAbility improves the continuity of whole business.
Meanwhile isolable metadata occur mistake after, file system can still continue to run, during this period ifStill an error has occurred, can be reported together with mistake before to user, such user can be disposably wrong to multiple generationsMetadata accidentally is repaired, and is improved remediation efficiency, is increased the comprehensive of reparation.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show belowThere is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only thisSome embodiments of invention for those of ordinary skill in the art without creative efforts, can be withIt obtains other drawings based on these drawings.
Fig. 1 is a kind of system architecture diagram of file system maintenance device in the embodiment of the present invention.
Fig. 2 is the flow diagram of the method for the first metadata provided in an embodiment of the present invention isolation.
Fig. 3 is the flow diagram of the method for second of metadata isolation provided in an embodiment of the present invention.
Fig. 4 is the flow diagram of the method for the third metadata isolation provided in an embodiment of the present invention.
Fig. 5 is a kind of flow diagram of the restorative procedure of file system metadata provided in an embodiment of the present invention.
Fig. 6 is a kind of structural schematic diagram of file system maintenance device provided in an embodiment of the present invention.
Fig. 7 is a kind of structural schematic diagram of computer system provided in an embodiment of the present invention.
Fig. 8 is a kind of structural schematic diagram of file system prosthetic device provided in an embodiment of the present invention.
Fig. 9 is the structural schematic diagram of another computer system provided in an embodiment of the present invention
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, completeSite preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based onEmbodiment in the present invention, those skilled in the art's every other implementation obtained without creative effortsExample, shall fall within the protection scope of the present invention.
The embodiment of the present invention provides a kind of method file system metadata isolation and repaired, to realize in file systemThe isolation and reparation of the metadata of mistake occurs, reduce metadata error influences caused by business, improves the industry of file systemBusiness continuity, and reduce the time of metadata reparation.
The present invention also provides corresponding file system metadata isolating devices, are described in detail separately below.
To facilitate understanding of the present embodiment of the invention, the concept that can be introduced in description of the embodiment of the present invention is introduced herein first.
Isolable metadata: as described in background technique, in some scenes, the metadata of file system can be damagedAnd lead to mistake.Classification analysis discovery is carried out to file system metadata, the damage of most metadata can not influenceThe whole business of file system, the i.e. corresponding data of other normal metadata can all continue to provide normal service.CauseThis, metadata can be classified, and will will not be impacted to the whole business of file system after above-mentioned appearance mistake, i.e., literaryThe meta data category that part system can continue to provide service is isolable metadata.Correspondingly, there is mistake in a part of metadataAfter accidentally, will lead to file system integrally cannot normally provide service, these metadata errors are generally mistake of overall importance, such as spaceAssignment bit map etc..For this kind of metadata, not isolable metadata can be classified as.It lists in table 1 in linux systemIn, classification that the metadata of some types is carried out according to the classification method.It should be understood that in different operating system,And under different types of file system, metadata has different type classification.Therefore, the type of metadata with whether can be everyIt will be different under specific operating system and file system from the corresponding relationship of reparation.
Metadata typeWhether reparation can isolate
SuperBlockReparation can be isolated
GlobalBitmapReparation can not be isolated
Extent BlockReparation can be isolated
ExtentReparation can be isolated
Chain ListReparation can not be isolated
Chain GroupReparation can not be isolated
Inode AllocReparation can be isolated
Local AllocReparation can be isolated
Truncate LogReparation can be isolated
JournalReparation can be isolated
Inline DataReparation can be isolated
InodeReparation can be isolated
Table 1
It is a kind of system architecture diagram of file system maintenance device in the embodiment of the present application in conjunction with Fig. 1.This system framework withFor Linux system, it is to be understood that, the thought according to provided by the present embodiment can the present invention is applied in othersIn operating system.Hardware layer contains system and runs relied on hardware device, including processor, memory, network interface etc..Client layer (also referred to as user's space or User space) and inner nuclear layer (also referred to as kernel sky are marked off on hardware layerBetween or kernel state).Application program in user's operation client layer, is called by system, and user asks the operation of file systemIt asks and (such as opens, reads and writes and close) and be transmitted to inner nuclear layer.Virtual File System is the abstract of file system, is responsible for passing requestGive specific file system.File system can there are many types, such as the third generation to extend file system (ThirdExtended filesystem, abbreviation Ext3), forth generation extension file system (Fourth extended filesystem,Abbreviation Ext4), second generation Oracle cluster file system (Oracle Cluster File System2, abbreviation OCFS2) etc.,The operation requests of User space application program are actually completed by these specific file system.File system and file system pipeThe data of reason are stored in the memory of hardware layer.In embodiments of the present invention, it may include in file system as shown in the figureAll or part of module, these modules can be used as new module and are integrated in file system, be also possible to existing file systemHave in itself in the functional module of system or it is transformed it is made to have mould described in the embodiment of the present inventionThe function of block.Wherein, metadata detection module is used to detect the metadata that mistake occurs in operation for file system;MetadataIsolation module is used to for the metadata that mistake occurs being isolated;Metadata repair module passes through for responding user in client layerThe reparation order that metadata fix tool initiates metadata, and metadata is repaired according to order is repaired;File systemFreeze module for responding the file system freeze request of user and freezing to file system;Information reporting module is used for willThe metadata error information reporting detected is informed the user that client layer.In the embodiment of the present application, it is also mentioned in client layerMetadata fix tool has been supplied, user can initiate to repair order by metadata fix tool to the metadata that mistake occurs,To call the repair module of the metadata in inner nuclear layer to repair the metadata that mistake occurs.
It should be noted that the embodiment of the present invention can be adapted for the computer equipment under general computer architecture, it can alsoTo be suitable for applying other processing equipments or smart machine that file system principle carries out data management, for example, embeddedEquipment, mobile device, private server, intelligent terminal, Intelligent Network Element, intelligent things equipment, intelligent storage equipment etc..
Referring to Fig.2, being the flow diagram of the method for the first file system maintenance provided in an embodiment of the present invention.This hairThe method of bright embodiment is applied to the computer equipment under a kind of general computer architecture, also can be applied to apply file systemPrinciple of uniting carries out other processing equipments or smart machine of data management.The equipment includes processor and storage equipment,The data in storage equipment are managed by file system.System architecture cited by the present embodiment combination Fig. 1, by first numberThe method in the present embodiment is executed according to wrong isolation module, the metadata that mistake occurs in file system is isolated.Certainly,It should be understood that the thought based on the present embodiment, the method in the present embodiment can also be used as the function being attached in file systemCan, it is executed by file system itself, to achieve the effect that identical or similar as the present embodiment.
The method of the embodiment of the present invention may include following steps:
S101, when detecting that mistake occurs for metadata in the file system, determine that the metadata of the mistake isNo to belong to isolable metadata, the isolable metadata is after mistake occurs, and file system still can continue to provideThe metadata of partial service.
After metadata detection module detects that mistake occurs for metadata, different from directly file system is set in the prior artTo be read-only or inaccessible, the type for the metadata that mistake occurs can be judged in embodiments of the present invention.According to precedingMetadata can be divided into isolable metadata and not isolable metadata, according to this classification, of the invention real in statingIt applies in example, judges whether the metadata that mistake occurs belongs to isolable metadata.
It detects that mistake occurs for metadata, can be believing to metadata error of receiving that file system other modules reportBreath, i.e. file system are in the process of running, it was found that the metadata error information reported after metadata error, for example, file systemWhen specific a certain metadata is accessed in system, the failure of metadata access is caused since mistake occurs for metadata, thus onThe error message is reported.It may include the metadata mark, metadata type or metadata mistake that mistake occurs in error messageType of error accidentally.
In another case, file system can dispatch metadata detection module or other have the mould of corresponding functionBlock carries out active detecting to metadata.For example, be scanned to metadata, thus find the metadata of generation mistake, and onIt is reporting the wrong metadata with aforementioned similar error message.
Optionally, in one implementation, whether the metadata for judging the generation mistake belongs to isolableMetadata includes: according to the data type that wrong metadata and metadata occurs and whether isolable correspondence is closedSystem, determines whether the metadata that mistake occurs belongs to isolable metadata.
Specifically, the data type that the metadata of mistake occurs is obtained, according to the data of the metadata that mistake occursType and the preset meta data category table determine whether the metadata that mistake occurs can be isolated, the meta data categoryTable include metadata data type and whether isolable corresponding relationship.
In another concrete implementation mode, the data type of the available metadata that mistake occurs;According toThe data type of the metadata that mistake occurs and preset meta data category table determine that the metadata that mistake occurs isIt is no to be isolated, the meta data category table include metadata data type and whether isolable corresponding relationship.
Preset meta data category table can be comprising different types of metadata respectively whether can occur mistake after canWith the classification information of isolation, i.e., after determining the data type of a metadata, which can be obtained according to the classification chartWhether the metadata of type belongs to isolable metadata;Alternatively, preset meta data category table can be and contain different mistakesThe accidentally classification information that can type be isolated, that is, after determining the wrong type of error that a metadata is occurred, according to thisWhether the metadata that classification chart can obtain the generation type of error belongs to isolable metadata.
S102, when determine it is described occur mistake metadata belong to isolable metadata when, by it is described occur mistakeMetadata is set as read-only or inaccessible.
When metadata is isolable metadata, i.e., when mistake occurs for the metadata, file system still canOffer service is enough provided.Therefore, and in the prior art, read-only mode difference is set by entire file system, the present invention is realIt applies in example and only to set read-only or inaccessible for isolable metadata, i.e., for other metadata in file system,Service is still normally provided, and for isolable metadata, then it is set to read-only or inaccessible.When can be isolatedMetadata when being set as read-only, user can access to the metadata, but can only carry out reading behaviour to the metadataMake, and write operation cannot be carried out to the metadata;When setting inaccessible for isolable metadata, user cannotIt accesses to the metadata, i.e., the user's operation including read operation and write operation is not allowed to.
Specifically, when setting read-only for metadata, can be asked if it is reading by the way that isolated marks are arranged to metadataIt asks, i.e. the operation will not bring any update, then be allowed to;Otherwise, error message is directly returned to, i.e. User space application program existsIsolation metadata can not be updated operation before being repaired.When setting inaccessible for metadata, User space application journeySequence accesses segregate metadata, can return to error message, i.e., User space application program is before isolation metadata is repairedIt can not access to the metadata.
As it can be seen that can make to occur in file system by setting read-only or inaccessible for isolable metadataWhen the metadata of mistake is isolable metadata, file system will not be integrally set as read-only, the file system work of guaranteeContinuity, improve the fault tolerant ability of system, improve the continuity of whole business.
It is the flow diagram of the method for second of metadata isolation provided in an embodiment of the present invention refering to Fig. 3.The present inventionEmbodiment is illustrated in the first aforementioned embodiment, the method for the present embodiment contain S101 in the first embodiment,S102 step, thus with the same or similar description of the step, repeat no more in the present embodiment.
In embodiments of the present invention, further include step S103:
The error message of the mistake is added in error message list, the error message list will be for that will occur mistakeMetadata accidentally is reported to user.
After mistake occurs for metadata, the error message of metadata can be added in error message list.Error messageIt can include but is not limited to the position of the relevant information such as metadata of metadata itself, data type of metadata etc. and first numberAccording to such as wrong type of the relevant information of mistake.Error message notifies user to carry out mistake and repair after can be used for report of user stateMultiple, user can repair one by one the metadata that mistake occurs according to error message list.
As it can be seen that since error message to be added in error message list, the related letter of the metadata since mistake occursThe relevant information of breath and mistake passes through error message list and returns to User space, and User space is when carrying out errors repair, nothingNeed to again to file system carry out error scanning, and can directly according to error listing in list generation mistake metadata intoRow is repaired.Meanwhile before the metadata of the generation mistake in file system is not isolable metadata, in file systemThe isolable metadata that mistake occurs can be added in error listing, therefore user can be disposably to multiple metadataIt is repaired, improves remediation efficiency.
It is the flow diagram of the method for the third metadata isolation provided in an embodiment of the present invention refering to Fig. 4.The present inventionEmbodiment is illustrated in the first aforementioned embodiment, the method for the present embodiment contain S101 in the first embodiment,S102 step, and may include the S103 step in second of embodiment, thus with the same or similar description of the step,It is repeated no more in the present embodiment.
In embodiments of the present invention further include: S104, determine it is described occur mistake metadata type of error whether beRelevance mistake, after the relevance misrepresentation mistake occurs, metadata relevant to the metadata of the mistake also occursMistake;When determining that the type of error is relevance mistake, then by the metadata relevant to the metadata of the mistakeAlso it is set as read-only or inaccessible.
Relevance mistake, refer to generation mistake often as caused by multiple metadata, or when mistake generation after,It will lead to multiple metadata and mistake occur.That is, when there is relevance mistake, generation mistake relevant to the mistakeMetadata is greater than one.Therefore, when the type of error of metadata is relevance mistake, the generation for not only needing will test is wrongMetadata accidentally is isolated, and should will be also isolated in the relevant metadata of relevance mistake.
Specifically, can will be set as read-only or inaccessible in metadata relevant to the relevance mistake, specificallyImplementation is similar with method described in previous embodiment, and details are not described herein.
In one implementation, according to type of error and type of error with whether be that the corresponding relationship of relevance mistake obtainsIt whether is relevance mistake to the type of error.Specifically, according to type of error and type of error and whether being relevance mistakeCorresponding relationship accidentally determines whether the type of error is relevance mistake.It is similar with preceding method in one in implementation, the corresponding relationship can be realized by meta data category table.Whether meta data category table can belong to query metadataThe meta data category table used in isolable metadata is same table, available according to the meta data category tableThe data type of the metadata of mistake occurs, or obtains occurring the dislocation type of mistake, so that it is determined that the mistake that metadata occursAccidentally whether type is relevance mistake.Also it can be used alone the classification chart different from meta data category table above-mentioned, judgeMethod with it is aforementioned similar.
In one implementation, the metadata relevant to the metadata of the mistake is also set as read-only or can notWhen access, the metadata relevant to the metadata of the mistake includes the metadata of the metadata dependent on the mistake.For example, in linux system, the metadata error of Extent block or Extent type, the metadata and phase of the typeThere are dependences between the metadata of pass, therefore when mistake occurs for the metadata for finding this type, associated therewithMistake can equally occur for metadata.Therefore, it is necessary to the associated metadata dependent on wrong metadata is isolated.
As it can be seen that in the present embodiment, since the relevant metadata of relevance mistake is set as read-only or inaccessible,It can guarantee that the associated metadata of relevance mistake is isolated, and then file system can be allow to continue offer service, togetherWhen increase the comprehensive of reparation.
It is a kind of flow diagram of the restorative procedure of file system metadata provided in an embodiment of the present invention refering to Fig. 5.The method of this method combination aforementioned metadata isolation is described, and on the basis of preceding method, increases response User space pairThe reparation of metadata operates.Therefore, there is same or similar step in the aforementioned embodiment, in the present embodiment no longer into oneStep is described.
The step of cut-off rule is executed the above are User space in figure, it can initiated by user, or by being in User spaceApplication program is initiated.Cut-off rule is once the step of kernel state executes, and is initiated by kernel and is executed.Specific step is as follows:
S501, after detecting that metadata is wrong, judge occur mistake metadata whether be isolable metadata,Preferably, can be judged by tabling look-up.It can be set as read-only with segregate metadata.It optionally, can be to this yuanIsolated marks are arranged in data, the chained list of an isolation metadata are added, and the metadata that mistake occurs is reported to client layer.
When accessing segregate metadata, if it is read request, i.e., the operation will not bring any update, then permittedPerhaps;Otherwise, direct return-EIO, i.e. User space application program can not be updated operation before isolation metadata is repaired.
File system instruction is freezed in the segregate list of meta data that S502, user report according to kernel, initiation, and one by oneSegregate metadata is initiated to repair instruction, is completed after all repairing, the instruction of defrosting operating system is initiated.Wherein, reparation refers toIt enables and calls the metadata repair module of inner nuclear layer to repair metadata by the metadata fix tool of client layer.For notSame metadata, the mode of reparation is not exactly the same, since the present invention is not related to the specific restorative procedure of metadata,Details are not described herein.
S503, the instruction for freezing file system that user sends after determining metadata generation mistake is received, and according to instituteIt states and freezes the instruction of file system and freeze file system, keep the coherency state of file system in repair process.
The freeze operation of file system is intended to write all dirty file system metadatas and data disk, generates oneWith the almost consistent disk image of file system.The operation of any modification file system must just can be carried out after defrosting.PhaseFor unloading operation, unloading of file system closes all openings firstly the need of the business for stopping all operations in file systemHandle, by dirty data brush return disk.And freeze be a kind of temporary suspension operation, therefore the duration freezed is shorter, butBe restore file system time it is also shorter.In the case where having obtained the list that the metadata of mistake occurs, according to listTime used in progress metadata reparation greatly shortens compared with the existing technology, so being more conducive to by the way of freezingQuick reparation to file system.
The metadata that mistake occurs is repaired in S504, the metadata reparation instruction sent according to user, if can be withIt is single to repair, directly repair;If being related to the metadata of relevance mistake, need to repair simultaneously and relevance mistakeRelevant metadata.
S505, the instruction for receiving the defrosting file system that user sends, and according to the instruction solution of the defrosting file systemFreeze the file system.
As it can be seen that in the present embodiment, the metadata for the generation mistake that user can be reported according to kernel be isolatedList, state by freezing file system, to occur mistake metadata repair.Due to having been obtained for that mistake occursThe list of metadata carries out error scanning to file system in the prior art without picture, therefore can shorten repair time, reducesThe time that file system is hung up, improve the efficiency of system.
It is a kind of structural schematic diagram of file system maintenance device provided in an embodiment of the present invention refering to Fig. 6.Described deviceIt can be performed or for executing the method provided in preceding method embodiment.Therefore it combines same or similar in previous embodimentDescription, repeat no more in the present embodiment.Described device can be the computer under general computer architecture or be integrated inModule or equipment in computer, other processing for being readily applicable to apply the progress data management of file system principle are setStandby or smart machine or integrated module or equipment in the apparatus.It is a kind of file in the present embodiment in conjunction with Fig. 2The possible system architecture diagram of system metadata isolating device, it is aforementioned in the system architecture of the computer equipment is carried outIllustrate, repeats no more here.
The 603 file system maintenance device includes:
601 metadata detection modules, for judging institute when detecting that mistake occurs for the metadata in the file systemState occur mistake metadata whether belong to can segregate metadata, the isolable metadata be occur mistake after, textPart system still can continue to provide the metadata of partial service;
602 metadata isolation modules will if belonging to isolable metadata for the metadata that mistake occursThe metadata that mistake occurs is set as read-only or inaccessible.
Optionally, the metadata detection module is also used to: judging the type of error of the metadata that mistake occurs isNo is relevance mistake, after the relevance misrepresentation mistake occurs, metadata relevant to the metadata of the mistakeMistake has occurred;The metadata isolation module is also used to:, will described and institute if the type of error is relevance mistakeThe relevant metadata of metadata for stating mistake is also set as read-only or inaccessible.
Optionally, whether the metadata detection module can also judge the type of error that wrong metadata occursFor relevance mistake, specifically, for judging whether the type of error of the metadata that mistake occurs is relevance mistakeWhen, according to type of error and type of error with whether be that the corresponding relationship of relevance mistake determines whether the type of error is passConnection property mistake.
Optionally, the metadata isolation module is specifically used for, by first number relevant to the metadata of the mistakeWhen according to being also set as read-only or inaccessible, the metadata relevant to the metadata of the mistake includes depending on the mistakeThe metadata of metadata accidentally.
Optionally, it can also include that module is collected in error message according to device of calculating in the present embodiment, be used for the mistakeError message be added in error message list.
In the present embodiment, the device can be to execute the side in aforementioned S101, S102, S103 and S104Method and its corresponding specific or optional implementation.It therefore, can be in conjunction in previous embodiment for described deviceThe description of method is understood.
In one implementation, equipment is stored in computer be stored with the program generation that above-mentioned each functions of modules can be achievedCode, computer processor reads said program code, to realize the concrete function of above-mentioned each module.
As it can be seen that in the present embodiment file system metadata isolating device by by isolable metadata be set as it is read-only orPerson is inaccessible, and when can make to occur in file system the isolable metadata of metadata of mistake, file system will not be byEntirety is set as read-only, and the continuity of the file system work of guarantee improves the fault tolerant ability of system, improves whole businessContinuity.
Simultaneously as error message is added in error message list, the related letter of the metadata due to sending mistakeThe relevant information of breath and mistake passes through error message list and returns to User space, and User space is when carrying out errors repair, nothingNeed to again to file system carry out error scanning, and can directly according to error listing in list generation mistake metadata intoRow is repaired.Meanwhile before the metadata of the generation mistake in file system is not isolable metadata, in file systemThe isolable metadata that mistake occurs can be added in error listing, therefore user can be disposably to multiple metadataIt is repaired, improves remediation efficiency.
Simultaneously as the relevant metadata of relevance mistake is set as read-only or inaccessible, it is ensured that associationThe associated metadata of property mistake is isolated, and then file system can be allow to continue offer service, while increasing reparationIt is comprehensive.
It is a kind of structural schematic diagram of computer system 700 provided in an embodiment of the present invention with reference to Fig. 7.The computerSystem can execute the method in preceding method embodiment, specifically, the computer system includes:
Processor 701, and the memory 702 being connected with the processor;
Wherein, the processor calls the instruction stored in the memory to be used for:
When detecting that mistake occurs for the metadata in the file system, determine whether the metadata of the mistake belongs toIsolable metadata, the isolable metadata are that file system, which still can continue to provide, partially to be taken after mistake occursThe metadata of business;
If the metadata that mistake occurs belongs to isolable metadata, the metadata that mistake occurs is setIt is set to read-only or inaccessible.
It should be understood that memory 702 may include read-only memory and random access memory, and at sensorIt manages device 702 and instruction and data is provided.The a part of of memory 702 can also include nonvolatile RAM(NVRAM)。
A kind of system architecture in conjunction with provided in earlier figures 1, in a kind of implementation of the present embodiment, file system withAnd the data that file system is managed are stored in memory 702, it will of course be understood that, the file system and fileThe data that system is managed, which also can store, to be in other storage equipment that processor 701 is connected.
In some embodiments, memory 702 stores following element, executable modules or data structures, orTheir subset of person or their superset: operating system, include various system programs, such as communication layers, sensor tubeReason system, driving layer etc., for realizing various basic businesses and the hardware based task of processing;And types of applications program.
In an implementation mode, when determining whether the metadata that mistake occurs belongs to isolable metadata,Whether the processor is specifically used for according to the metadata that mistake occurs and the data type of metadata and isolableCorresponding relationship, determines whether the metadata that mistake occurs belongs to isolable metadata.Optionally, determine that the generation is wrongWhether metadata accidentally when belonging to isolable metadata, can be according to the data type of the metadata that mistake occurs and pre-If meta data category table determine it is described occur mistake metadata whether can be isolated, the meta data category table includes metadataData type and whether isolable corresponding relationship
In an implementation mode, it is described by it is described occur mistake metadata be set as it is read-only or it is inaccessible itAfterwards, the processor is also used to determine whether the type of error of the metadata that mistake occurs is relevance mistake, the passAfter connection property misrepresentation mistake occurs, mistake is also had occurred in metadata relevant to the metadata of the mistake;If the mistakeAccidentally type is relevance mistake, then the metadata relevant to the metadata of the mistake is also set as read-only or can not visitedIt asks.Optionally, when whether the type of error for judging the metadata that mistake occurs is relevance mistake, according to mistakeType and type of error with whether be that the corresponding relationship of relevance mistake determines whether the type of error is relevance mistake.It canChoosing, the metadata relevant to the metadata of the mistake includes the metadata of the metadata dependent on the mistake.
In one implementation, the processor is also used to for the error message of the mistake being added to error message columnIn table, the error message list is used to the metadata that mistake occurs being reported to user.
In the present embodiment, the computer system can be to execute aforementioned S101, S102, S103 and S104In method and its corresponding specific or optional implementation.Therefore, before being combined for the computer systemThe description for stating the method in embodiment is understood.
As it can be seen that in the present embodiment file system metadata isolating device by by isolable metadata be set as it is read-only orPerson is inaccessible, and when can make to occur in file system the isolable metadata of metadata of mistake, file system will not be byEntirety is set as read-only, and the continuity of the file system work of guarantee improves the fault tolerant ability of system, improves whole businessContinuity.
Simultaneously as error message is added in error message list, the related letter of the metadata due to sending mistakeThe relevant information of breath and mistake passes through error message list and returns to User space, and User space is when carrying out errors repair, nothingNeed to again to file system carry out error scanning, and can directly according to error listing in list generation mistake metadata intoRow is repaired.Meanwhile before the metadata of the generation mistake in file system is not isolable metadata, in file systemThe isolable metadata that mistake occurs can be added in error listing, therefore user can be disposably to multiple metadataIt is repaired, improves remediation efficiency.
Simultaneously as the relevant metadata of relevance mistake is set as read-only or inaccessible, it is ensured that associationThe associated metadata of property mistake is isolated, and then file system can be allow to continue offer service, while increasing reparationIt is comprehensive.
A kind of file system prosthetic device 800 provided in an embodiment of the present invention refering to Fig. 8, described device it is executable orPerson is for executing the method provided in preceding method embodiment.Therefore description same or similar in previous embodiment is combined,It repeats no more in the present embodiment.Described device can be the computer under general computer architecture or integrate in a computerModule perhaps equipment is readily applicable to apply other processing equipments or intelligence that file system principle carries out data managementIt can equipment or integrated module or equipment in the apparatus.It is a kind of file system member number in the present embodiment in conjunction with Fig. 2According to the possible system architecture diagram of isolating device, it is aforementioned in the system architecture of the computer equipment is illustrated,Details are not described herein again.
The file system maintenance device includes:
File system freezes module 801, for receive user determine metadata occur mistake after send freeze fileThe instruction of system, and file system is freezed according to the instruction for freezing file system, and receive the defrosting text that user sendsThe instruction of part system, and according to the instruction of the defrosting file system defrosting file system;
Metadata repair module 802, the metadata reparation instruction for being occurred according to user is to the metadata that mistake occursIt is repaired.
Optionally, described device can also include information reporting module, for reporting of user error message list so as toThe metadata that mistake occurs is determined in user, the error message list includes that the error message of the metadata of mistake occurs.
The file system, which freezes module, can be used for executing method described in aforementioned S503, S505;The metadata reparationModule can execute method described in aforementioned S502, S504.Therefore it can refer to the aforementioned description in embodiment of the method to this dressIt sets and is understood.
As it can be seen that in the present embodiment, the metadata for the generation mistake that user can be reported according to kernel be isolatedList, state by freezing file system, to occur mistake metadata repair.Due to having been obtained for that mistake occursThe list of metadata carries out error scanning to file system in the prior art without picture, therefore can shorten repair time, reducesThe time that file system is hung up, improve the efficiency of system
It is a kind of structural schematic diagram of computer system 900 provided in an embodiment of the present invention with reference to Fig. 9.The computerSystem can execute the method in preceding method embodiment, specifically, the computer system includes:
Processor, and the memory being connected with the processor;
Wherein, the processor calls the instruction stored in the memory to be used for:
The instruction for freezing file system that user sends after determining metadata generation mistake is received, and is freezed according to describedFile system is freezed in the instruction of file system;
The metadata that mistake occurs is repaired in the metadata reparation instruction sent according to user;
The instruction for the defrosting file system that user sends is received, and according to the instruction of defrosting file system defrostingFile system.
Optionally, the processor is also used to:
The metadata of mistake, the error message list occurs in order to which user determines to reporting of user error message listError message comprising the metadata of mistake occurs.
Computer system described in the present embodiment is same or similar with the structure of computer system described in Fig. 7, therefore, canTo understand the framework of the computer system in the present embodiment in reference Fig. 7 the associated description of the computer system.
The computer system can be used for executing method described in aforementioned S502, S503, S504, S505, therefore can refer toThe aforementioned description in embodiment of the method understands the present apparatus.
As it can be seen that in the present embodiment, the metadata for the generation mistake that user can be reported according to kernel be isolatedList, state by freezing file system, to occur mistake metadata repair.Due to having been obtained for that mistake occursThe list of metadata carries out error scanning to file system in the prior art without picture, therefore can shorten repair time, reducesThe time that file system is hung up, improve the efficiency of system
The apparatus embodiments described above are merely exemplary, wherein described, unit can as illustrated by the separation memberIt is physically separated with being or may not be, component shown as a unit may or may not be physics listMember, it can it is in one place, or may be distributed over multiple network units.It can be selected according to the actual needsIn some or all of the modules achieve the purpose of the solution of this embodiment.In addition, Installation practice attached drawing provided by the inventionIn, the connection relationship between module indicates there is communication connection between them, and it is total specifically to can be implemented as one or more communicationLine or signal wire.Those of ordinary skill in the art can understand and implement without creative efforts.
Through the above description of the embodiments, it is apparent to those skilled in the art that the present invention is implementedPlotting unit described in example can add the mode of required common hardware to realize by software, naturally it is also possible to pass through specialized hardwareIt is realized including specific integrated circuit, dedicated cpu, private memory, special components and parts etc..Under normal circumstances, all by computerThe function that program is completed can be realized easily with corresponding hardware, moreover, being used to realize the specific hard of same functionPart structure is also possible to diversified, such as analog circuit, digital circuit or special circuit etc..
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, anyThose familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all containLid is within protection scope of the present invention.Therefore, protection scope of the present invention should be based on the protection scope of the described claims.

Claims (20)

CN201510662628.2A2015-10-142015-10-14A kind of method and apparatus of file system maintenance and reparationActiveCN105354102B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201510662628.2ACN105354102B (en)2015-10-142015-10-14A kind of method and apparatus of file system maintenance and reparation

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201510662628.2ACN105354102B (en)2015-10-142015-10-14A kind of method and apparatus of file system maintenance and reparation

Publications (2)

Publication NumberPublication Date
CN105354102A CN105354102A (en)2016-02-24
CN105354102Btrue CN105354102B (en)2019-03-01

Family

ID=55330076

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201510662628.2AActiveCN105354102B (en)2015-10-142015-10-14A kind of method and apparatus of file system maintenance and reparation

Country Status (1)

CountryLink
CN (1)CN105354102B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109426586B (en)*2017-08-252023-05-12中兴通讯股份有限公司Data file repairing method, device and computer readable storage medium
CN107861842B (en)*2017-11-082021-10-15郑州云海信息技术有限公司 Metadata damage detection method, system, device and storage medium
CN111209138A (en)*2018-11-222020-05-29浙江宇视科技有限公司Operation and maintenance method and device of data storage system
CN110532032B (en)*2019-07-312021-01-05华为技术有限公司Startup file system detection method and related equipment
CN114327662B (en)*2021-12-302024-10-18山石网科通信技术股份有限公司Processing method and device of operating system, storage medium and processor

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US7698597B2 (en)*2006-02-282010-04-13International Business Machines CorporationMethod of isolating erroneous software program components
WO2012029091A1 (en)*2010-08-312012-03-08Hitachi, Ltd.Management server and data migration method using the same

Also Published As

Publication numberPublication date
CN105354102A (en)2016-02-24

Similar Documents

PublicationPublication DateTitle
CN105354102B (en)A kind of method and apparatus of file system maintenance and reparation
CN110178121B (en)Database detection method and terminal thereof
US9652326B1 (en)Instance migration for rapid recovery from correlated failures
US8910172B2 (en)Application resource switchover systems and methods
CN103164254B (en)For maintaining the conforming method and system of memory storage in mirror image virtual environment
US20040225697A1 (en)Storage operation management program and method and a storage management computer
US20130132765A1 (en)Mechanism to Provide Assured Recovery for Distributed Application
JP2007241486A (en) Storage system
WO2017220013A1 (en)Service processing method and apparatus, and storage medium
CA2686384A1 (en)Dynamic cli mapping for clustered software entities
US20160371151A1 (en)Information processing system, information processing apparatus, and information processing apparatus control method
CN104765652B (en)A kind of data backup and data reconstruction method and device
US20240419354A1 (en)Disk processing method and system, and electronic device
US9880776B1 (en)Content-driven data protection method for multiple storage devices
CN114816820A (en) Chproxy cluster fault repair method, device, device and storage medium
CN102799503B (en)Recover method applied to large quantity of small files
CN113986450A (en)Virtual machine backup method and device
US8112598B2 (en)Apparatus and method for controlling copying
CN110058963B (en)Method, apparatus and computer program product for managing a storage system
CN109672544B (en) A data processing method, device and distributed storage system
CN113268206B (en)Network target range resource hot plug implementation method and system
CN105893176A (en)Management method and device of network storage system
CN108319522A (en)A method of reinforcing distributed memory system reliability
CN105242985A (en)Data recovery method and apparatus
CN109582497A (en)One kind being based on the quick emergency starting method of dynamic data increment

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp