public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: linux-xfs@vger.kernel.org
Subject: [PATCH 3/6] xfs: corruption needs to respect endianess too!
Date: Fri, 21 Apr 2017 17:21:20 +0200	[thread overview]
Message-ID: <20170421152123.11316-4-hch@lst.de> (raw)
In-Reply-To: <20170421152123.11316-1-hch@lst.de>

At least if we want to be able to recognize the pattern.  Add a missing
byte swap to the corruption injection case in xlog_sync.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
index bb58cd1873c9..3731f13f63e9 100644
--- a/fs/xfs/xfs_log.c
+++ b/fs/xfs/xfs_log.c
@@ -1852,7 +1852,7 @@ xlog_sync(
 	 */
 	if (log->l_badcrc_factor &&
 	    (prandom_u32() % log->l_badcrc_factor == 0)) {
-		iclog->ic_header.h_crc &= 0xAAAAAAAA;
+		iclog->ic_header.h_crc &= cpu_to_le32(0xAAAAAAAA);
 		iclog->ic_state |= XLOG_STATE_IOABORT;
 		xfs_warn(log->l_mp,
 	"Intentionally corrupted log record at LSN 0x%llx. Shutdown imminent.",
-- 
2.11.0


  parent reply	other threads:[~2017-04-21 16:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 15:21 a few sparse inspired cleanups / fixes Christoph Hellwig
2017-04-21 15:21 ` [PATCH 1/6] xfs: use NULL instead of 0 to initialize a pointer in xfs_getfsmap Christoph Hellwig
2017-04-21 19:04   ` Darrick J. Wong
2017-04-21 15:21 ` [PATCH 2/6] xfs: use NULL instead of 0 to initialize a pointer in xfs_ioc_getfsmap Christoph Hellwig
2017-04-21 19:04   ` Darrick J. Wong
2017-04-21 15:21 ` Christoph Hellwig [this message]
2017-04-21 19:05   ` [PATCH 3/6] xfs: corruption needs to respect endianess too! Darrick J. Wong
2017-04-21 15:21 ` [PATCH 4/6] xfs: fix __user annotations for xfs_ioc_getfsmap Christoph Hellwig
2017-04-21 19:08   ` Darrick J. Wong
2017-04-21 15:21 ` [PATCH 5/6] xfs: don't use bool values in trace buffers Christoph Hellwig
2017-04-21 19:33   ` Darrick J. Wong
2017-04-23  7:38     ` Christoph Hellwig
2017-04-21 15:21 ` [PATCH 6/6] xfs: remove xfs_trans_ail_delete_bulk Christoph Hellwig
2017-04-21 19:35   ` 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=20170421152123.11316-4-hch@lst.de \
    --to=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox