Home Home > GIT Browse > SLE15
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Iliopoulos <ailiopoulos@suse.com>2019-05-18 01:16:17 +0200
committerAnthony Iliopoulos <ailiopoulos@suse.com>2019-05-18 01:16:17 +0200
commit9a1c1d3a1a77329aab68e261b80b45a14b1e13c8 (patch)
tree3e7938faed01d1f258bfae58e6044f1e8ec3b14c
parent558f3864413e823b3ca07accd27a35242e927115 (diff)
xfs: export _inobt_btrec_to_irec and _ialloc_cluster_alignment
for scrub (bsc#1114427).
-rw-r--r--patches.fixes/xfs-export-_inobt_btrec_to_irec-and-_ialloc_cluster_.patch111
-rw-r--r--series.conf1
2 files changed, 112 insertions, 0 deletions
diff --git a/patches.fixes/xfs-export-_inobt_btrec_to_irec-and-_ialloc_cluster_.patch b/patches.fixes/xfs-export-_inobt_btrec_to_irec-and-_ialloc_cluster_.patch
new file mode 100644
index 0000000000..3ec898a8d9
--- /dev/null
+++ b/patches.fixes/xfs-export-_inobt_btrec_to_irec-and-_ialloc_cluster_.patch
@@ -0,0 +1,111 @@
+From e936945ee49693f40217db82a7db55c94e34ce4c Mon Sep 17 00:00:00 2001
+From: "Darrick J. Wong" <darrick.wong@oracle.com>
+Date: Fri, 16 Jun 2017 11:00:08 -0700
+Subject: [PATCH] xfs: export _inobt_btrec_to_irec and
+ _ialloc_cluster_alignment for scrub
+Git-commit: e936945ee49693f40217db82a7db55c94e34ce4c
+Patch-mainline: v4.13-rc1
+References: bsc#1114427
+
+Create a function to extract an in-core inobt record from a generic
+btree_rec union so that scrub will be able to check inobt records
+and check inode block alignment.
+
+Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
+Reviewed-by: Brian Foster <bfoster@redhat.com>
+Acked-by: Anthony Iliopoulos <ailiopoulos@suse.com>
+
+---
+ fs/xfs/libxfs/xfs_ialloc.c | 44 +++++++++++++++++++++++++++-----------------
+ fs/xfs/libxfs/xfs_ialloc.h | 5 +++++
+ 2 files changed, 32 insertions(+), 17 deletions(-)
+
+diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
+index 1e5ed940b84d..c514fe98bbab 100644
+--- a/fs/xfs/libxfs/xfs_ialloc.c
++++ b/fs/xfs/libxfs/xfs_ialloc.c
+@@ -46,7 +46,7 @@
+ /*
+ * Allocation group level functions.
+ */
+-static inline int
++int
+ xfs_ialloc_cluster_alignment(
+ struct xfs_mount *mp)
+ {
+@@ -98,24 +98,15 @@ xfs_inobt_update(
+ return xfs_btree_update(cur, &rec);
+ }
+
+-/*
+- * Get the data from the pointed-to record.
+- */
+-int /* error */
+-xfs_inobt_get_rec(
+- struct xfs_btree_cur *cur, /* btree cursor */
+- xfs_inobt_rec_incore_t *irec, /* btree record */
+- int *stat) /* output: success/failure */
++/* Convert on-disk btree record to incore inobt record. */
++void
++xfs_inobt_btrec_to_irec(
++ struct xfs_mount *mp,
++ union xfs_btree_rec *rec,
++ struct xfs_inobt_rec_incore *irec)
+ {
+- union xfs_btree_rec *rec;
+- int error;
+-
+- error = xfs_btree_get_rec(cur, &rec, stat);
+- if (error || *stat == 0)
+- return error;
+-
+ irec->ir_startino = be32_to_cpu(rec->inobt.ir_startino);
+- if (xfs_sb_version_hassparseinodes(&cur->bc_mp->m_sb)) {
++ if (xfs_sb_version_hassparseinodes(&mp->m_sb)) {
+ irec->ir_holemask = be16_to_cpu(rec->inobt.ir_u.sp.ir_holemask);
+ irec->ir_count = rec->inobt.ir_u.sp.ir_count;
+ irec->ir_freecount = rec->inobt.ir_u.sp.ir_freecount;
+@@ -130,6 +121,25 @@ xfs_inobt_get_rec(
+ be32_to_cpu(rec->inobt.ir_u.f.ir_freecount);
+ }
+ irec->ir_free = be64_to_cpu(rec->inobt.ir_free);
++}
++
++/*
++ * Get the data from the pointed-to record.
++ */
++int
++xfs_inobt_get_rec(
++ struct xfs_btree_cur *cur,
++ struct xfs_inobt_rec_incore *irec,
++ int *stat)
++{
++ union xfs_btree_rec *rec;
++ int error;
++
++ error = xfs_btree_get_rec(cur, &rec, stat);
++ if (error || *stat == 0)
++ return error;
++
++ xfs_inobt_btrec_to_irec(cur->bc_mp, rec, irec);
+
+ return 0;
+ }
+diff --git a/fs/xfs/libxfs/xfs_ialloc.h b/fs/xfs/libxfs/xfs_ialloc.h
+index 0bb89669fc07..b32cfb5aeb5b 100644
+--- a/fs/xfs/libxfs/xfs_ialloc.h
++++ b/fs/xfs/libxfs/xfs_ialloc.h
+@@ -168,5 +168,10 @@ int xfs_ialloc_inode_init(struct xfs_mount *mp, struct xfs_trans *tp,
+ int xfs_read_agi(struct xfs_mount *mp, struct xfs_trans *tp,
+ xfs_agnumber_t agno, struct xfs_buf **bpp);
+
++union xfs_btree_rec;
++void xfs_inobt_btrec_to_irec(struct xfs_mount *mp, union xfs_btree_rec *rec,
++ struct xfs_inobt_rec_incore *irec);
++
++int xfs_ialloc_cluster_alignment(struct xfs_mount *mp);
+
+ #endif /* __XFS_IALLOC_H__ */
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 1c6fb6e1c9..4a292b4cdc 100644
--- a/series.conf
+++ b/series.conf
@@ -3562,6 +3562,7 @@
patches.fixes/xfs-remove-bli-from-AIL-before-release-on-transactio.patch
patches.fixes/xfs-remove-double-underscore-integer-types.patch
patches.fixes/xfs-export-various-function-for-the-online-scrubber.patch
+ patches.fixes/xfs-export-_inobt_btrec_to_irec-and-_ialloc_cluster_.patch
patches.fixes/xfs-check-if-an-inode-is-cached-and-allocated.patch
patches.fixes/xfs-reflink-find-shared-should-take-a-transaction.patch
patches.fixes/xfs-make-errortag-a-per-mountpoint-structure.patch