?sphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget(/translations/zh_CN/filesystems/ext4/mmpmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/zh_TW/filesystems/ext4/mmpmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/it_IT/filesystems/ext4/mmpmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/ja_JP/filesystems/ext4/mmpmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/ko_KR/filesystems/ext4/mmpmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget(/translations/sp_SP/filesystems/ext4/mmpmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhB/var/lib/git/docbuild/linux/Documentation/filesystems/ext4/mmp.rsthKubhsection)}(hhh](htitle)}(hMultiple Mount Protectionh]hMultiple Mount Protection}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hX&Multiple mount protection (MMP) is a feature that protects the filesystem against multiple hosts trying to use the filesystem simultaneously. When a filesystem is opened (for mounting, or fsck, etc.), the MMP code running on the node (call it node A) checks a sequence number. If the sequence number is EXT4_MMP_SEQ_CLEAN, the open continues. If the sequence number is EXT4_MMP_SEQ_FSCK, then fsck is (hopefully) running, and open fails immediately. Otherwise, the open code will wait for twice the specified MMP check interval and check the sequence number again. If the sequence number has changed, then the filesystem is active on another machine and the open fails. If the MMP code passes all of those checks, a new MMP sequence number is generated and written to the MMP block, and the mount proceeds.h]hX&Multiple mount protection (MMP) is a feature that protects the filesystem against multiple hosts trying to use the filesystem simultaneously. When a filesystem is opened (for mounting, or fsck, etc.), the MMP code running on the node (call it node A) checks a sequence number. If the sequence number is EXT4_MMP_SEQ_CLEAN, the open continues. If the sequence number is EXT4_MMP_SEQ_FSCK, then fsck is (hopefully) running, and open fails immediately. Otherwise, the open code will wait for twice the specified MMP check interval and check the sequence number again. If the sequence number has changed, then the filesystem is active on another machine and the open fails. If the MMP code passes all of those checks, a new MMP sequence number is generated and written to the MMP block, and the mount proceeds.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXWhile the filesystem is live, the kernel sets up a timer to re-check the MMP block at the specified MMP check interval. To perform the re-check, the MMP sequence number is re-read; if it does not match the in-memory MMP sequence number, then another node (node B) has mounted the filesystem, and node A remounts the filesystem read-only. If the sequence numbers match, the sequence number is incremented both in memory and on disk, and the re-check is complete.h]hXWhile the filesystem is live, the kernel sets up a timer to re-check the MMP block at the specified MMP check interval. To perform the re-check, the MMP sequence number is re-read; if it does not match the in-memory MMP sequence number, then another node (node B) has mounted the filesystem, and node A remounts the filesystem read-only. If the sequence numbers match, the sequence number is incremented both in memory and on disk, and the re-check is complete.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hThe hostname and device filename are written into the MMP block whenever an open operation succeeds. The MMP code does not use these values; they are provided purely for informational purposes.h]hThe hostname and device filename are written into the MMP block whenever an open operation succeeds. The MMP code does not use these values; they are provided purely for informational purposes.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(h~The checksum is calculated against the FS UUID and the MMP structure. The MMP structure (``struct mmp_struct``) is as follows:h](hYThe checksum is calculated against the FS UUID and the MMP structure. The MMP structure (}(hhhhhNhNubhliteral)}(h``struct mmp_struct``h]hstruct mmp_struct}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhubh) is as follows:}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubhtable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1j!hjubj")}(hhh]h}(h]h ]h"]h$]h&]j,K uh1j!hjubj")}(hhh]h}(h]h ]h"]h$]h&]j,Kuh1j!hjubj")}(hhh]h}(h]h ]h"]h$]h&]j,K(uh1j!hjubhthead)}(hhh]hrow)}(hhh](hentry)}(hhh]h)}(hOffseth]hOffset}(hjWhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK&hjTubah}(h]h ]h"]h$]h&]uh1jRhjOubjS)}(hhh]h)}(hTypeh]hType}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hjkubah}(h]h ]h"]h$]h&]uh1jRhjOubjS)}(hhh]h)}(hNameh]hName}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK(hjubah}(h]h ]h"]h$]h&]uh1jRhjOubjS)}(hhh]h)}(h Descriptionh]h Description}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK)hjubah}(h]h ]h"]h$]h&]uh1jRhjOubeh}(h]h ]h"]h$]h&]uh1jMhjJubah}(h]h ]h"]h$]h&]uh1jHhjubhtbody)}(hhh](jN)}(hhh](jS)}(hhh]h)}(h0x0h]h0x0}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK*hjubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(h__le32h]h__le32}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK+hjubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(h mmp_magich]h mmp_magic}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK,hjubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(h-Magic number for MMP, 0x004D4D50 (“MMP”).h]h-Magic number for MMP, 0x004D4D50 (“MMP”).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK-hj ubah}(h]h ]h"]h$]h&]uh1jRhjubeh}(h]h ]h"]h$]h&]uh1jMhjubjN)}(hhh](jS)}(hhh]h)}(h0x4h]h0x4}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK.hj)ubah}(h]h ]h"]h$]h&]uh1jRhj&ubjS)}(hhh]h)}(h__le32h]h__le32}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hj@ubah}(h]h ]h"]h$]h&]uh1jRhj&ubjS)}(hhh]h)}(hmmp_seqh]hmmp_seq}(hjZhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK0hjWubah}(h]h ]h"]h$]h&]uh1jRhj&ubjS)}(hhh]h)}(h&Sequence number, updated periodically.h]h&Sequence number, updated periodically.}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK1hjnubah}(h]h ]h"]h$]h&]uh1jRhj&ubeh}(h]h ]h"]h$]h&]uh1jMhjubjN)}(hhh](jS)}(hhh]h)}(h0x8h]h0x8}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK2hjubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(h__le64h]h__le64}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK3hjubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(hmmp_timeh]hmmp_time}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK4hjubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(h)Time that the MMP block was last updated.h]h)Time that the MMP block was last updated.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK5hjubah}(h]h ]h"]h$]h&]uh1jRhjubeh}(h]h ]h"]h$]h&]uh1jMhjubjN)}(hhh](jS)}(hhh]h)}(h0x10h]h0x10}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK6hjubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(hchar[64]h]hchar[64]}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK7hj ubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(h mmp_nodenameh]h mmp_nodename}(hj$hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK8hj!ubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(h0Hostname of the node that opened the filesystem.h]h0Hostname of the node that opened the filesystem.}(hj;hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK9hj8ubah}(h]h ]h"]h$]h&]uh1jRhjubeh}(h]h ]h"]h$]h&]uh1jMhjubjN)}(hhh](jS)}(hhh]h)}(h0x50h]h0x50}(hj[hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK:hjXubah}(h]h ]h"]h$]h&]uh1jRhjUubjS)}(hhh]h)}(hchar[32]h]hchar[32]}(hjrhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK;hjoubah}(h]h ]h"]h$]h&]uh1jRhjUubjS)}(hhh]h)}(h mmp_bdevnameh]h mmp_bdevname}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(h__le16h]h__le16}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hjubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(hmmp_check_intervalh]hmmp_check_interval}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK@hjubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(h&The MMP re-check interval, in seconds.h]h&The MMP re-check interval, in seconds.}(hjhhhNhNubah}(h]h ]h"]h$]h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hhhhKKhjubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(h mmp_checksumh]h mmp_checksum}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKLhjubah}(h]h ]h"]h$]h&]uh1jRhjubjS)}(hhh]h)}(hChecksum of the MMP block.h]hChecksum of the MMP block.}(hj4hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKMhj1ubah}(h]h ]h"]h$]h&]uh1jRhjubeh}(h]h ]h"]h$]h&]uh1jMhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]colwidths-givenah"]h$]h&]uh1jhhhhhNhNubeh}(h]multiple-mount-protectionah ]h"]multiple mount protectionah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjRfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}jgjds nametypes}jgsh}jdhs footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.