All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Eric Sandeen <sandeen@redhat.com>, linux-xfs <linux-xfs@vger.kernel.org>
Subject: [PATCH V2] xfs_io: add buf_lru_ref tag to inject table
Date: Thu, 30 Nov 2017 16:57:13 -0600	[thread overview]
Message-ID: <2ad83585-651a-ee47-d400-5dc91089a69e@sandeen.net> (raw)
In-Reply-To: <79e391ff-fbb5-baf9-bb36-776d956ccecf@redhat.com>

And catch it at build time if we get out of sync again.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/include/xfs.h b/include/xfs.h
index 9f0f11b..a40ca0c 100644
--- a/include/xfs.h
+++ b/include/xfs.h
@@ -64,6 +64,10 @@ extern int xfs_assert_largefile[sizeof(off_t)-8];
 #define __packed __attribute__((packed))
 #endif
 
+#ifndef BUILD_BUG_ON
+#define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+#endif
+
 #include <xfs/xfs_types.h>
 #include <xfs/xfs_fs.h>
 
diff --git a/io/inject.c b/io/inject.c
index a118879..fc3cf25 100644
--- a/io/inject.c
+++ b/io/inject.c
@@ -62,10 +62,14 @@ error_tag(char *name)
 		{ XFS_ERRTAG_DROP_WRITES,		"drop_writes" },
 		{ XFS_ERRTAG_LOG_BAD_CRC,		"log_bad_crc" },
 		{ XFS_ERRTAG_LOG_ITEM_PIN,		"log_item_pin" },
+		{ XFS_ERRTAG_BUF_LRU_REF,		"buf_lru_ref" },
 		{ XFS_ERRTAG_MAX,			NULL }
 	};
 	int	count;
 
+	/* If this fails, make sure every tag is defined in the array above */
+	BUILD_BUG_ON(sizeof(eflags) != (XFS_ERRTAG_MAX + 1) * sizeof(*e));
+
 	/* Search for a name */
 	if (name) {
 		for (e = eflags; e->name; e++)



  parent reply	other threads:[~2017-11-30 22:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-30 22:12 [PATCH] xfs_io: add buf_lru_ref tag to inject table Eric Sandeen
2017-11-30 22:23 ` Darrick J. Wong
2017-11-30 22:57 ` Eric Sandeen [this message]
2017-11-30 23:04   ` [PATCH V3] " Eric Sandeen
2017-11-30 23:13     ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ad83585-651a-ee47-d400-5dc91089a69e@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.