gfs2-uevents.txt 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. uevents and GFS2
  2. ==================
  3. During the lifetime of a GFS2 mount, a number of uevents are generated.
  4. This document explains what the events are and what they are used
  5. for (by gfs_controld in gfs2-utils).
  6. A list of GFS2 uevents
  7. -----------------------
  8. 1. ADD
  9. The ADD event occurs at mount time. It will always be the first
  10. uevent generated by the newly created filesystem. If the mount
  11. is successful, an ONLINE uevent will follow. If it is not successful
  12. then a REMOVE uevent will follow.
  13. The ADD uevent has two environment variables: SPECTATOR=[0|1]
  14. and RDONLY=[0|1] that specify the spectator status (a read-only mount
  15. with no journal assigned), and read-only (with journal assigned) status
  16. of the filesystem respectively.
  17. 2. ONLINE
  18. The ONLINE uevent is generated after a successful mount or remount. It
  19. has the same environment variables as the ADD uevent. The ONLINE
  20. uevent, along with the two environment variables for spectator and
  21. RDONLY are a relatively recent addition (2.6.32-rc+) and will not
  22. be generated by older kernels.
  23. 3. CHANGE
  24. The CHANGE uevent is used in two places. One is when reporting the
  25. successful mount of the filesystem by the first node (FIRSTMOUNT=Done).
  26. This is used as a signal by gfs_controld that it is then ok for other
  27. nodes in the cluster to mount the filesystem.
  28. The other CHANGE uevent is used to inform of the completion
  29. of journal recovery for one of the filesystems journals. It has
  30. two environment variables, JID= which specifies the journal id which
  31. has just been recovered, and RECOVERY=[Done|Failed] to indicate the
  32. success (or otherwise) of the operation. These uevents are generated
  33. for every journal recovered, whether it is during the initial mount
  34. process or as the result of gfs_controld requesting a specific journal
  35. recovery via the /sys/fs/gfs2/<fsname>/lock_module/recovery file.
  36. Because the CHANGE uevent was used (in early versions of gfs_controld)
  37. without checking the environment variables to discover the state, we
  38. cannot add any more functions to it without running the risk of
  39. someone using an older version of the user tools and breaking their
  40. cluster. For this reason the ONLINE uevent was used when adding a new
  41. uevent for a successful mount or remount.
  42. 4. OFFLINE
  43. The OFFLINE uevent is only generated due to filesystem errors and is used
  44. as part of the "withdraw" mechanism. Currently this doesn't give any
  45. information about what the error is, which is something that needs to
  46. be fixed.
  47. 5. REMOVE
  48. The REMOVE uevent is generated at the end of an unsuccessful mount
  49. or at the end of a umount of the filesystem. All REMOVE uevents will
  50. have been preceded by at least an ADD uevent for the same filesystem,
  51. and unlike the other uevents is generated automatically by the kernel's
  52. kobject subsystem.
  53. Information common to all GFS2 uevents (uevent environment variables)
  54. ----------------------------------------------------------------------
  55. 1. LOCKTABLE=
  56. The LOCKTABLE is a string, as supplied on the mount command
  57. line (locktable=) or via fstab. It is used as a filesystem label
  58. as well as providing the information for a lock_dlm mount to be
  59. able to join the cluster.
  60. 2. LOCKPROTO=
  61. The LOCKPROTO is a string, and its value depends on what is set
  62. on the mount command line, or via fstab. It will be either
  63. lock_nolock or lock_dlm. In the future other lock managers
  64. may be supported.
  65. 3. JOURNALID=
  66. If a journal is in use by the filesystem (journals are not
  67. assigned for spectator mounts) then this will give the
  68. numeric journal id in all GFS2 uevents.
  69. 4. UUID=
  70. With recent versions of gfs2-utils, mkfs.gfs2 writes a UUID
  71. into the filesystem superblock. If it exists, this will
  72. be included in every uevent relating to the filesystem.