From: Christoph Hellwig <hch@lst.de>
To: stable@vger.kernel.org
Cc: linux-xfs@vger.kernel.org, Dave Chinner <dchinner@redhat.com>,
"Darrick J . Wong" <darrick.wong@oracle.com>
Subject: [PATCH 11/16] xfs: move more RT specific code under CONFIG_XFS_RT
Date: Thu, 19 Oct 2017 16:22:54 +0200 [thread overview]
Message-ID: <20171019142259.20082-12-hch@lst.de> (raw)
In-Reply-To: <20171019142259.20082-1-hch@lst.de>
From: Dave Chinner <dchinner@redhat.com>
commit bb9c2e5433250f5b477035dc478314f8e6dd5e36 upstream.
Various utility functions and interfaces that iterate internal
devices try to reference the realtime device even when RT support is
not compiled into the kernel.
Make sure this code is excluded from the CONFIG_XFS_RT=n build,
and where appropriate stub functions to return fatal errors if
they ever get called when RT support is not present.
Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
fs/xfs/xfs_bmap_util.c | 2 ++
fs/xfs/xfs_bmap_util.h | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index bbc389e353e8..cb62871fb91d 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -84,6 +84,7 @@ xfs_zero_extent(
GFP_NOFS, true);
}
+#ifdef CONFIG_XFS_RT
int
xfs_bmap_rtalloc(
struct xfs_bmalloca *ap) /* bmap alloc argument struct */
@@ -195,6 +196,7 @@ xfs_bmap_rtalloc(
}
return 0;
}
+#endif /* CONFIG_XFS_RT */
/*
* Check if the endoff is outside the last extent. If so the caller will grow
diff --git a/fs/xfs/xfs_bmap_util.h b/fs/xfs/xfs_bmap_util.h
index f1005393785c..ce330f06563e 100644
--- a/fs/xfs/xfs_bmap_util.h
+++ b/fs/xfs/xfs_bmap_util.h
@@ -28,7 +28,20 @@ struct xfs_mount;
struct xfs_trans;
struct xfs_bmalloca;
+#ifdef CONFIG_XFS_RT
int xfs_bmap_rtalloc(struct xfs_bmalloca *ap);
+#else /* !CONFIG_XFS_RT */
+/*
+ * Attempts to allocate RT extents when RT is disable indicates corruption and
+ * should trigger a shutdown.
+ */
+static inline int
+xfs_bmap_rtalloc(struct xfs_bmalloca *ap)
+{
+ return -EFSCORRUPTED;
+}
+#endif /* CONFIG_XFS_RT */
+
int xfs_bmap_eof(struct xfs_inode *ip, xfs_fileoff_t endoff,
int whichfork, int *eof);
int xfs_bmap_punch_delalloc_range(struct xfs_inode *ip,
--
2.14.2
next prev parent reply other threads:[~2017-10-19 14:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-19 14:22 4.9-stable updates for XFS Christoph Hellwig
2017-10-19 14:22 ` [PATCH 01/16] xfs: don't unconditionally clear the reflink flag on zero-block files Christoph Hellwig
2017-10-19 14:22 ` [PATCH 02/16] xfs: evict CoW fork extents when performing finsert/fcollapse Christoph Hellwig
2017-10-19 14:22 ` [PATCH 03/16] fs/xfs: Use %pS printk format for direct addresses Christoph Hellwig
2017-10-19 14:22 ` [PATCH 04/16] xfs: report zeroed or not correctly in xfs_zero_range() Christoph Hellwig
2017-10-19 14:22 ` [PATCH 05/16] xfs: update i_size after unwritten conversion in dio completion Christoph Hellwig
2017-10-19 14:22 ` [PATCH 06/16] xfs: perag initialization should only touch m_ag_max_usable for AG 0 Christoph Hellwig
2017-10-19 14:22 ` [PATCH 07/16] xfs: Capture state of the right inode in xfs_iflush_done Christoph Hellwig
2017-10-19 14:22 ` [PATCH 08/16] xfs: always swap the cow forks when swapping extents Christoph Hellwig
2017-10-19 14:22 ` [PATCH 09/16] xfs: handle racy AIO in xfs_reflink_end_cow Christoph Hellwig
2017-10-19 14:22 ` [PATCH 10/16] xfs: Don't log uninitialised fields in inode structures Christoph Hellwig
2017-10-19 14:22 ` Christoph Hellwig [this message]
2017-10-19 14:22 ` [PATCH 12/16] xfs: don't change inode mode if ACL update fails Christoph Hellwig
2017-10-19 14:22 ` [PATCH 13/16] xfs: reinit btree pointer on attr tree inactivation walk Christoph Hellwig
2017-10-19 14:22 ` [PATCH 14/16] xfs: handle error if xfs_btree_get_bufs fails Christoph Hellwig
2017-10-19 14:22 ` [PATCH 15/16] xfs: cancel dirty pages on invalidation Christoph Hellwig
2017-10-19 14:22 ` [PATCH 16/16] xfs: trim writepage mapping to within eof Christoph Hellwig
2017-10-24 12:54 ` 4.9-stable updates for XFS Greg KH
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=20171019142259.20082-12-hch@lst.de \
--to=hch@lst.de \
--cc=darrick.wong@oracle.com \
--cc=dchinner@redhat.com \
--cc=linux-xfs@vger.kernel.org \
--cc=stable@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;
as well as URLs for NNTP newsgroup(s).