~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/Documentation/filesystems/ext4/mmp.rst

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /Documentation/filesystems/ext4/mmp.rst (Version linux-6.12-rc7) and /Documentation/filesystems/ext4/mmp.rst (Version linux-5.13.19)


  1 .. SPDX-License-Identifier: GPL-2.0                 1 .. SPDX-License-Identifier: GPL-2.0
  2                                                     2 
  3 Multiple Mount Protection                           3 Multiple Mount Protection
  4 -------------------------                           4 -------------------------
  5                                                     5 
  6 Multiple mount protection (MMP) is a feature t      6 Multiple mount protection (MMP) is a feature that protects the
  7 filesystem against multiple hosts trying to us      7 filesystem against multiple hosts trying to use the filesystem
  8 simultaneously. When a filesystem is opened (f      8 simultaneously. When a filesystem is opened (for mounting, or fsck,
  9 etc.), the MMP code running on the node (call       9 etc.), the MMP code running on the node (call it node A) checks a
 10 sequence number. If the sequence number is EXT !!  10 sequence number. If the sequence number is EXT4\_MMP\_SEQ\_CLEAN, the
 11 open continues. If the sequence number is EXT4 !!  11 open continues. If the sequence number is EXT4\_MMP\_SEQ\_FSCK, then
 12 fsck is (hopefully) running, and open fails im     12 fsck is (hopefully) running, and open fails immediately. Otherwise, the
 13 open code will wait for twice the specified MM     13 open code will wait for twice the specified MMP check interval and check
 14 the sequence number again. If the sequence num     14 the sequence number again. If the sequence number has changed, then the
 15 filesystem is active on another machine and th     15 filesystem is active on another machine and the open fails. If the MMP
 16 code passes all of those checks, a new MMP seq     16 code passes all of those checks, a new MMP sequence number is generated
 17 and written to the MMP block, and the mount pr     17 and written to the MMP block, and the mount proceeds.
 18                                                    18 
 19 While the filesystem is live, the kernel sets      19 While the filesystem is live, the kernel sets up a timer to re-check the
 20 MMP block at the specified MMP check interval.     20 MMP block at the specified MMP check interval. To perform the re-check,
 21 the MMP sequence number is re-read; if it does     21 the MMP sequence number is re-read; if it does not match the in-memory
 22 MMP sequence number, then another node (node B     22 MMP sequence number, then another node (node B) has mounted the
 23 filesystem, and node A remounts the filesystem     23 filesystem, and node A remounts the filesystem read-only. If the
 24 sequence numbers match, the sequence number is     24 sequence numbers match, the sequence number is incremented both in
 25 memory and on disk, and the re-check is comple     25 memory and on disk, and the re-check is complete.
 26                                                    26 
 27 The hostname and device filename are written i     27 The hostname and device filename are written into the MMP block whenever
 28 an open operation succeeds. The MMP code does      28 an open operation succeeds. The MMP code does not use these values; they
 29 are provided purely for informational purposes     29 are provided purely for informational purposes.
 30                                                    30 
 31 The checksum is calculated against the FS UUID     31 The checksum is calculated against the FS UUID and the MMP structure.
 32 The MMP structure (``struct mmp_struct``) is a     32 The MMP structure (``struct mmp_struct``) is as follows:
 33                                                    33 
 34 .. list-table::                                    34 .. list-table::
 35    :widths: 8 12 20 40                             35    :widths: 8 12 20 40
 36    :header-rows: 1                                 36    :header-rows: 1
 37                                                    37 
 38    * - Offset                                      38    * - Offset
 39      - Type                                        39      - Type
 40      - Name                                        40      - Name
 41      - Description                                 41      - Description
 42    * - 0x0                                         42    * - 0x0
 43      - __le32                                  !!  43      - \_\_le32
 44      - mmp_magic                               !!  44      - mmp\_magic
 45      - Magic number for MMP, 0x004D4D50 (“MM     45      - Magic number for MMP, 0x004D4D50 (“MMP”).
 46    * - 0x4                                         46    * - 0x4
 47      - __le32                                  !!  47      - \_\_le32
 48      - mmp_seq                                 !!  48      - mmp\_seq
 49      - Sequence number, updated periodically.      49      - Sequence number, updated periodically.
 50    * - 0x8                                         50    * - 0x8
 51      - __le64                                  !!  51      - \_\_le64
 52      - mmp_time                                !!  52      - mmp\_time
 53      - Time that the MMP block was last update     53      - Time that the MMP block was last updated.
 54    * - 0x10                                        54    * - 0x10
 55      - char[64]                                    55      - char[64]
 56      - mmp_nodename                            !!  56      - mmp\_nodename
 57      - Hostname of the node that opened the fi     57      - Hostname of the node that opened the filesystem.
 58    * - 0x50                                        58    * - 0x50
 59      - char[32]                                    59      - char[32]
 60      - mmp_bdevname                            !!  60      - mmp\_bdevname
 61      - Block device name of the filesystem.        61      - Block device name of the filesystem.
 62    * - 0x70                                        62    * - 0x70
 63      - __le16                                  !!  63      - \_\_le16
 64      - mmp_check_interval                      !!  64      - mmp\_check\_interval
 65      - The MMP re-check interval, in seconds.      65      - The MMP re-check interval, in seconds.
 66    * - 0x72                                        66    * - 0x72
 67      - __le16                                  !!  67      - \_\_le16
 68      - mmp_pad1                                !!  68      - mmp\_pad1
 69      - Zero.                                       69      - Zero.
 70    * - 0x74                                        70    * - 0x74
 71      - __le32[226]                             !!  71      - \_\_le32[226]
 72      - mmp_pad2                                !!  72      - mmp\_pad2
 73      - Zero.                                       73      - Zero.
 74    * - 0x3FC                                       74    * - 0x3FC
 75      - __le32                                  !!  75      - \_\_le32
 76      - mmp_checksum                            !!  76      - mmp\_checksum
 77      - Checksum of the MMP block.                  77      - Checksum of the MMP block.
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php