On 08/12/17 15:30, Bob Peterson wrote:
Hi,

This is a version 2 replacement for this patch, with some improvements.
---
This patch just adds the capability for GFS2 to track which function
called gfs2_log_flush. This should make it easier to diagnose
problems based on the sequence of events found in the journals.

Signed-off-by: Bob Peterson <[email protected]>
<snip>
--- a/include/uapi/linux/gfs2_ondisk.h
+++ b/include/uapi/linux/gfs2_ondisk.h
@@ -406,6 +406,42 @@ struct gfs2_log_header {
        __be32 lh_hash;
  };
+/*
+ * Log Header version 2 constants - actor who wrote a log header
+ */
+
+enum gfs2_log_flushers {
+       /* Constants reserved for kernel space */
+       LHF_SHUTDOWN            = 0,

Should 0 be used for "unknown"?

+       LHF_JDATA_WPAGES        = 1,
+       LHF_SET_FLAGS           = 2,
+       LHF_AIL_EMPTY_GL        = 3,
+       LHF_AIL_FLUSH           = 4,
+       LHF_RGRP_GO_SYNC        = 5,
+       LHF_INODE_GO_SYNC       = 6,
+       LHF_INODE_GO_INVAL      = 7,
+       LHF_FREEZE_GO_SYNC      = 8,
+       LHF_KILL_SB             = 9,
+       LHF_DO_SYNC             = 10,
+       LHF_INPLACE_RESERVE     = 11,
+       LHF_WRITE_INODE         = 12,
+       LHF_MAKE_FS_RO          = 13,
+       LHF_SYNC_FS             = 14,
+       LHF_EVICT_INODE         = 15,
+       LHF_TRANS_END           = 16,
+       LHF_LOGD_JFLUSH_REQD    = 17,
+       LHF_LOGD_AIL_FLUSH_REQD = 18,
+       LHF_LOG_FLUSHERS        = 19, /* number of kernel log flushers */
+
+       /* Constants reserved for user space / gfs2-utils */
+       LHF_GFS2_CONVERT        = 26,
+       LHF_GFS2_EDIT           = 27,
+       LHF_GFS2_FSCK           = 28,
+       LHF_GFS2_FSCK_JREPLAY   = 29,
+       LHF_GFS2_MKFS           = 30,
+       LHF_GFS2_JADD           = 31

Would it be better to have values for the purposes that the utils would need to touch the log header, e.g. LHF_UTIL_REPLAY, LHF_UTIL_FIX or LHF_UTIL_CREATE. That way, if a util is renamed or a new util is written (even some third party tool that we don't know about) they would still have a sensible value to use.

Cheers,
Andy

Reply via email to